Bug 1485698 - Check for no module meta object during JIT analysis r=jandem

This commit is contained in:
Jon Coppeard 2018-08-30 19:38:27 +01:00
Родитель f9c513f20c
Коммит 61e5b63a8e
2 изменённых файлов: 20 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,9 @@
let m = parseModule(`
function f(x,y,z) {
delete arguments[2];
import.meta[2]
}
f(1,2,3)
`);
instantiateModule(m);
evaluateModule(m);

Просмотреть файл

@ -13169,10 +13169,20 @@ IonBuilder::jsop_implicitthis(PropertyName* name)
AbortReasonOr<Ok> AbortReasonOr<Ok>
IonBuilder::jsop_importmeta() IonBuilder::jsop_importmeta()
{ {
if (info().analysisMode() == Analysis_ArgumentsUsage) {
// The meta object may not have been created yet. Just push a dummy
// value, it does not affect the arguments analysis.
MUnknownValue* unknown = MUnknownValue::New(alloc());
current->add(unknown);
current->push(unknown);
return Ok();
}
ModuleObject* module = GetModuleObjectForScript(script()); ModuleObject* module = GetModuleObjectForScript(script());
MOZ_ASSERT(module); MOZ_ASSERT(module);
// The object must have been created already when we compiled for baseline. // If we get there then the meta object must already have been created, at
// the latest when we compiled for baseline.
JSObject* metaObject = module->metaObject(); JSObject* metaObject = module->metaObject();
MOZ_ASSERT(metaObject); MOZ_ASSERT(metaObject);