Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 5636d826064c44024bbdef0bc7eaeb81177c6457..81920b590ffdd68cf4a57c98044f538d53f43fd9 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -20147,33 +20147,33 @@ void Module::CreateExport(Handle<Module> module, int cell_index, |
module->set_exports(*exports); |
} |
-Handle<Object> Module::LoadVariable(Handle<Module> module, int cell_index) { |
- Isolate* isolate = module->GetIsolate(); |
- Handle<Object> object; |
+Cell* Module::GetCell(Module* module, int cell_index) { |
+ DisallowHeapAllocation no_gc; |
+ Object* cell; |
switch (ModuleDescriptor::GetCellIndexKind(cell_index)) { |
case ModuleDescriptor::kImport: |
- object = handle(module->regular_imports()->get(ImportIndex(cell_index)), |
- isolate); |
+ cell = module->regular_imports()->get(ImportIndex(cell_index)); |
break; |
case ModuleDescriptor::kExport: |
- object = handle(module->regular_exports()->get(ExportIndex(cell_index)), |
- isolate); |
+ cell = module->regular_exports()->get(ExportIndex(cell_index)); |
break; |
case ModuleDescriptor::kInvalid: |
UNREACHABLE(); |
break; |
} |
- return handle(Handle<Cell>::cast(object)->value(), isolate); |
+ return Cell::cast(cell); |
+} |
+ |
+Handle<Object> Module::LoadVariable(Handle<Module> module, int cell_index) { |
+ Isolate* isolate = module->GetIsolate(); |
+ return handle(GetCell(*module, cell_index)->value(), isolate); |
} |
void Module::StoreVariable(Handle<Module> module, int cell_index, |
Handle<Object> value) { |
- Isolate* isolate = module->GetIsolate(); |
DCHECK_EQ(ModuleDescriptor::GetCellIndexKind(cell_index), |
ModuleDescriptor::kExport); |
- Handle<Object> object(module->regular_exports()->get(ExportIndex(cell_index)), |
- isolate); |
- Handle<Cell>::cast(object)->set_value(*value); |
+ GetCell(*module, cell_index)->set_value(*value); |
} |
MaybeHandle<Cell> Module::ResolveImport(Handle<Module> module, |