Index: src/compiler/js-generic-lowering.cc |
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc |
index ba3f2631d0e7b5e402947562e18a304a26ff5b27..aa70f5279a851d9bb29490bd850b75bc85739a5e 100644 |
--- a/src/compiler/js-generic-lowering.cc |
+++ b/src/compiler/js-generic-lowering.cc |
@@ -314,15 +314,10 @@ |
Callable callable = CodeFactory::LoadICInOptimizedCode( |
isolate(), p.typeof_mode(), SLOPPY, UNINITIALIZED); |
// Load global object from the context. |
- Node* native_context = |
- graph()->NewNode(machine()->Load(kMachAnyTagged), context, |
- jsgraph()->IntPtrConstant( |
- Context::SlotOffset(Context::NATIVE_CONTEXT_INDEX)), |
- effect, graph()->start()); |
- Node* global = graph()->NewNode( |
- machine()->Load(kMachAnyTagged), native_context, |
- jsgraph()->IntPtrConstant(Context::SlotOffset(Context::EXTENSION_INDEX)), |
- effect, graph()->start()); |
+ Node* global = graph()->NewNode(machine()->Load(kMachAnyTagged), context, |
+ jsgraph()->IntPtrConstant(Context::SlotOffset( |
+ Context::GLOBAL_OBJECT_INDEX)), |
+ effect, graph()->start()); |
node->InsertInput(zone(), 0, global); |
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
node->InsertInput(zone(), 2, jsgraph()->SmiConstant(p.feedback().index())); |
@@ -364,15 +359,10 @@ |
Callable callable = CodeFactory::StoreICInOptimizedCode( |
isolate(), p.language_mode(), UNINITIALIZED); |
// Load global object from the context. |
- Node* native_context = |
- graph()->NewNode(machine()->Load(kMachAnyTagged), context, |
- jsgraph()->IntPtrConstant( |
- Context::SlotOffset(Context::NATIVE_CONTEXT_INDEX)), |
- effect, graph()->start()); |
- Node* global = graph()->NewNode( |
- machine()->Load(kMachAnyTagged), native_context, |
- jsgraph()->IntPtrConstant(Context::SlotOffset(Context::EXTENSION_INDEX)), |
- effect, graph()->start()); |
+ Node* global = graph()->NewNode(machine()->Load(kMachAnyTagged), context, |
+ jsgraph()->IntPtrConstant(Context::SlotOffset( |
+ Context::GLOBAL_OBJECT_INDEX)), |
+ effect, graph()->start()); |
node->InsertInput(zone(), 0, global); |
node->InsertInput(zone(), 1, jsgraph()->HeapConstant(p.name())); |
DCHECK(p.feedback().index() != -1); |
@@ -436,6 +426,15 @@ |
static_cast<int>(access.index())))); |
NodeProperties::ChangeOp(node, machine()->Store(StoreRepresentation( |
kMachAnyTagged, kFullWriteBarrier))); |
+} |
+ |
+ |
+void JSGenericLowering::LowerJSLoadNativeContext(Node* node) { |
+ node->ReplaceInput( |
+ 1, jsgraph()->IntPtrConstant(JSGlobalObject::kNativeContextOffset - |
+ kHeapObjectTag)); |
+ node->AppendInput(zone(), graph()->start()); |
+ NodeProperties::ChangeOp(node, machine()->Load(kMachAnyTagged)); |
} |