Issue #1691 - Part 4: Finish implementing call import. https://bugzilla.mozilla.org/show_bug.cgi?id=1499140

(cherry picked from commit 7bf7d64887944b127a72090dd62eb57f67c5089d)
This commit is contained in:
Brian Smith 2023-04-09 03:06:39 -05:00 committed by roytam1
commit 7a6dab0b38
35 changed files with 533 additions and 24 deletions

View file

@ -4708,3 +4708,28 @@ BaselineCompiler::emit_JSOP_IMPORTMETA()
frame.push(ObjectValue(*metaObject));
return true;
}
typedef JSObject* (*StartDynamicModuleImportFn)(JSContext*, HandleValue, HandleValue);
static const VMFunction StartDynamicModuleImportInfo =
FunctionInfo<StartDynamicModuleImportFn>(js::StartDynamicModuleImport,
"StartDynamicModuleImport");
bool
BaselineCompiler::emit_JSOP_DYNAMIC_IMPORT()
{
RootedValue referencingPrivate(cx, FindScriptOrModulePrivateForScript(script));
// Put specifier value in R0.
frame.popRegsAndSync(1);
prepareVMCall();
pushArg(R0);
pushArg(referencingPrivate);
if (!callVM(StartDynamicModuleImportInfo)) {
return false;
}
masm.tagValue(JSVAL_TYPE_OBJECT, ReturnReg, R0);
frame.push(R0);
return true;
}