Index: src/compiler/js-typed-lowering.cc |
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc |
index b3f6af87b502cf0d60e530be4fe06d004c9682ba..0823b59b0739e802f1b89852b54a429bb38cd39c 100644 |
--- a/src/compiler/js-typed-lowering.cc |
+++ b/src/compiler/js-typed-lowering.cc |
@@ -1399,6 +1399,14 @@ Node* JSTypedLowering::BuildGetModuleCell(Node* node) { |
int32_t cell_index = OpParameter<int32_t>(node); |
Node* module = NodeProperties::GetValueInput(node, 0); |
+ Type* module_type = NodeProperties::GetType(module); |
+ |
+ if (module_type->IsHeapConstant()) { |
+ Handle<Module> module_constant = |
+ Handle<Module>::cast(module_type->AsHeapConstant()->Value()); |
+ Cell* cell_constant = module_constant->GetCell(cell_index); |
Michael Starzinger
2017/05/03 17:28:16
nit: Let's just make the local variable handlified
neis
2017/05/04 10:36:21
Done.
|
+ return jsgraph()->HeapConstant(handle(cell_constant, isolate())); |
+ } |
FieldAccess field_access; |
int index; |
@@ -1412,6 +1420,7 @@ Node* JSTypedLowering::BuildGetModuleCell(Node* node) { |
field_access = AccessBuilder::ForModuleRegularImports(); |
index = -cell_index - 1; |
} |
+ |
Node* array = effect = graph()->NewNode(simplified()->LoadField(field_access), |
module, effect, control); |
return graph()->NewNode( |