Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 5636d826064c44024bbdef0bc7eaeb81177c6457..ae7eb7b89a745e44f8bcdc0aad154147b1c16c1f 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -20147,33 +20147,34 @@ 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(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 = regular_imports()->get(ImportIndex(cell_index)); |
break; |
case ModuleDescriptor::kExport: |
- object = handle(module->regular_exports()->get(ExportIndex(cell_index)), |
- isolate); |
+ cell = regular_exports()->get(ExportIndex(cell_index)); |
break; |
case ModuleDescriptor::kInvalid: |
UNREACHABLE(); |
+ cell = nullptr; |
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(module->GetCell(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); |
+ module->GetCell(cell_index)->set_value(*value); |
} |
MaybeHandle<Cell> Module::ResolveImport(Handle<Module> module, |