Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 1478303002: Revert of [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698