import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 1233109 - Refactor module parsing to instantiate ModuleBuilder earlier r=shu (ae6693165a)
- Bug 1233109 - Call into the ModuleBuilder as we parse rather than traversing the AST again afterwards r=shu (c28f785d33)
- Bug 1233109 - Check for duplicate exported names using the data in the ModuleBuilder and remove ModuleBox::exportNames r=shu (03999c3ebf)
- Bug 1233109 - Make the getters in Import/ExportEntryObject const r=shu (ed6c2e5dca)
- Bug 1228211 (part 1) - Rearrange nsDisplayCanvasBackgroundImage::Paint(). r=dholbert. (00f3aacb07)
- Bug 1228211 (part 2) - Remove unused functions in nsRenderingContext. r=dholbert. (86d9983e82)
- Bug 1231550 - Use DrawTarget instead of gfxContext and/or nsRenderingContext in many places in font/text code. r=jfkthame. (b0962c9b17)
- Bug 1234418 - Not trust glyph run starts from a cluster start character. r=jfkthame (b0920d8072)
- more of  Bug 1222166 - use gcc/clang warning f (690640c6c7)
- Bug 1064843 part 1 - Make nsImageFrame inherit nsContainerFrame. r=dholbert (bd5efe0a93)
- Bug 1238660 part 1 - Make mWinsInCascade initially false; r=hiro (8420017e68)
- Bug 1238660 part 2 - Preserve "wins in cascade" state when updating animations; r=hiro (348a8ef769)
- Bug 1230408 - Move suppress line break check out from control of SkipParentDisplayBasedStyleFixup. r=dbaron (ca853b3162)
- Bug 1238660 part 3 - Add crashtest; r=hiro (ab4daba520)
- Bug 1230005: Factor out relocation style decision; r=jolesen (03ea0e9ba0)
- Bug 1230005: Hide specifics of the LDR instruction; r=jolesen (92b0396f81)
- Bug 1230005: Flush the assembler buffer at the end of asm.js compilation; r=luke (06e0911bfb)
- Bug 1230005: Delay buffer flushing in asm.js until the last minute; r=luke (d3be91cca5)
- Bug 1233111 - Share method lists for SIMD types. r=bbouvier (70ec039259)
- Bug 1229642 - Fix unified build duplicate static name error (rs=jandem) (eb05c13fec)
- Bug 1231338 - SAB gating test cases. r=luke (a8c6740745)
- Bug 1233111 - Remove geometry altering SIMD conversions. r=bbouvier (a9c93d7694)
- Bug 1233111 - Add unsigned SIMD types to interpreter. r=bbouvier (6187dc7a1e)
- Bug 1233111 - Add ecma_7 shift tests. r=bbouvier (17c612dac5)
- Bug 1233111 - Implement SIMD shiftRightByScalar(). r=bbouvie (b9b0c848b7)
- Bug 1233111 - Add a new ToUint8() function. r=efaust (f1bc50a229)
- ug 1233111 - Implement saturating arithmetic for SIMD. r=bbouvier (42a98a07d6)
- Bug 1229642 - Factor out StringToNewUTF8CharsZ (r=jandem) (3c4f71214b)
- revert PM modification to setProfilingEnabled (4a05202975)
- Bug 1229642 - Split wasm::Module out of AsmJSModule (r=bbouvier) (75a1832b1a)
- Bug 1229642 - change to AsmJSActivation to WasmActivation (r=bbouvier) (a2e8513369)
- Bug 1229642 - Factor AsmJSLink.cpp into wasm/asm.js and consolidate AsmJS* into AsmJS.cpp (r=bbouvier) (3a489c6410)
This commit is contained in:
2023-08-01 11:58:43 +08:00
parent 01cb9ab79e
commit 7d2b02d5fd
232 changed files with 11079 additions and 8342 deletions
+20 -36
View File
@@ -16,7 +16,7 @@
using namespace js;
using namespace js::frontend;
template<typename T, Value ValueGetter(T* obj)>
template<typename T, Value ValueGetter(const T* obj)>
static bool
ModuleValueGetterImpl(JSContext* cx, const CallArgs& args)
{
@@ -24,7 +24,7 @@ ModuleValueGetterImpl(JSContext* cx, const CallArgs& args)
return true;
}
template<typename T, Value ValueGetter(T* obj)>
template<typename T, Value ValueGetter(const T* obj)>
static bool
ModuleValueGetter(JSContext* cx, unsigned argc, Value* vp)
{
@@ -34,7 +34,7 @@ ModuleValueGetter(JSContext* cx, unsigned argc, Value* vp)
#define DEFINE_GETTER_FUNCTIONS(cls, name, slot) \
static Value \
cls##_##name##Value(cls* obj) { \
cls##_##name##Value(const cls* obj) { \
return obj->getFixedSlot(cls::slot); \
} \
\
@@ -46,7 +46,7 @@ ModuleValueGetter(JSContext* cx, unsigned argc, Value* vp)
#define DEFINE_ATOM_ACCESSOR_METHOD(cls, name) \
JSAtom* \
cls::name() \
cls::name() const \
{ \
Value value = cls##_##name##Value(this); \
return &value.toString()->asAtom(); \
@@ -54,7 +54,7 @@ ModuleValueGetter(JSContext* cx, unsigned argc, Value* vp)
#define DEFINE_ATOM_OR_NULL_ACCESSOR_METHOD(cls, name) \
JSAtom* \
cls::name() \
cls::name() const \
{ \
Value value = cls##_##name##Value(this); \
if (value.isNull()) \
@@ -906,37 +906,8 @@ ModuleBuilder::ModuleBuilder(JSContext* cx, HandleModuleObject module)
{}
bool
ModuleBuilder::buildAndInit(frontend::ParseNode* moduleNode)
ModuleBuilder::initModule()
{
MOZ_ASSERT(moduleNode->isKind(PNK_MODULE));
ParseNode* stmtsNode = moduleNode->pn_expr;
MOZ_ASSERT(stmtsNode->isKind(PNK_STATEMENTLIST));
MOZ_ASSERT(stmtsNode->isArity(PN_LIST));
for (ParseNode* pn = stmtsNode->pn_head; pn; pn = pn->pn_next) {
switch (pn->getKind()) {
case PNK_IMPORT:
if (!processImport(pn))
return false;
break;
case PNK_EXPORT:
case PNK_EXPORT_DEFAULT:
if (!processExport(pn))
return false;
break;
case PNK_EXPORT_FROM:
if (!processExportFrom(pn))
return false;
break;
default:
break;
}
}
for (const auto& e : exportEntries_) {
RootedExportEntryObject exp(cx_, e);
if (!exp->moduleRequest()) {
@@ -1017,6 +988,7 @@ ModuleBuilder::appendLocalExportEntry(HandleExportEntryObject exp)
bool
ModuleBuilder::processImport(frontend::ParseNode* pn)
{
MOZ_ASSERT(pn->isKind(PNK_IMPORT));
MOZ_ASSERT(pn->isArity(PN_BINARY));
MOZ_ASSERT(pn->pn_left->isKind(PNK_IMPORT_SPEC_LIST));
MOZ_ASSERT(pn->pn_right->isKind(PNK_STRING));
@@ -1048,6 +1020,7 @@ ModuleBuilder::processImport(frontend::ParseNode* pn)
bool
ModuleBuilder::processExport(frontend::ParseNode* pn)
{
MOZ_ASSERT(pn->isKind(PNK_EXPORT) || pn->isKind(PNK_EXPORT_DEFAULT));
MOZ_ASSERT(pn->getArity() == pn->isKind(PNK_EXPORT) ? PN_UNARY : PN_BINARY);
bool isDefault = pn->getKind() == PNK_EXPORT_DEFAULT;
@@ -1114,6 +1087,7 @@ ModuleBuilder::processExport(frontend::ParseNode* pn)
bool
ModuleBuilder::processExportFrom(frontend::ParseNode* pn)
{
MOZ_ASSERT(pn->isKind(PNK_EXPORT_FROM));
MOZ_ASSERT(pn->isArity(PN_BINARY));
MOZ_ASSERT(pn->pn_left->isKind(PNK_EXPORT_SPEC_LIST));
MOZ_ASSERT(pn->pn_right->isKind(PNK_STRING));
@@ -1140,7 +1114,7 @@ ModuleBuilder::processExportFrom(frontend::ParseNode* pn)
}
ImportEntryObject*
ModuleBuilder::importEntryFor(JSAtom* localName)
ModuleBuilder::importEntryFor(JSAtom* localName) const
{
for (auto import : importEntries_) {
if (import->localName() == localName)
@@ -1149,6 +1123,16 @@ ModuleBuilder::importEntryFor(JSAtom* localName)
return nullptr;
}
bool
ModuleBuilder::hasExportedName(JSAtom* name) const
{
for (auto entry : exportEntries_) {
if (entry->exportName() == name)
return true;
}
return false;
}
bool
ModuleBuilder::appendExportEntry(HandleAtom exportName, HandleAtom localName)
{