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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 1480003002: [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: Add patch from Orion for interpreter cementation test. Disable obsolete/invalid tests. Created 5 years 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 unified diff | Download patch
« no previous file with comments | « src/compiler.h ('k') | src/compiler/bytecode-graph-builder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/ast-loop-assignment-analyzer.h" 9 #include "src/compiler/ast-loop-assignment-analyzer.h"
10 #include "src/compiler/control-builders.h" 10 #include "src/compiler/control-builders.h"
(...skipping 3631 matching lines...) Expand 10 before | Expand all | Expand 10 after
3642 3642
3643 3643
3644 Node* AstGraphBuilder::BuildLoadImmutableObjectField(Node* object, int offset) { 3644 Node* AstGraphBuilder::BuildLoadImmutableObjectField(Node* object, int offset) {
3645 return graph()->NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, 3645 return graph()->NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object,
3646 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), 3646 jsgraph()->IntPtrConstant(offset - kHeapObjectTag),
3647 graph()->start(), graph()->start()); 3647 graph()->start(), graph()->start());
3648 } 3648 }
3649 3649
3650 3650
3651 Node* AstGraphBuilder::BuildLoadGlobalObject() { 3651 Node* AstGraphBuilder::BuildLoadGlobalObject() {
3652 const Operator* load_op = 3652 return BuildLoadNativeContextField(Context::EXTENSION_INDEX);
3653 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true);
3654 return NewNode(load_op, GetFunctionContext());
3655 } 3653 }
3656 3654
3657 3655
3658 Node* AstGraphBuilder::BuildLoadNativeContextField(int index) { 3656 Node* AstGraphBuilder::BuildLoadNativeContextField(int index) {
3659 Node* global = BuildLoadGlobalObject(); 3657 const Operator* op =
3660 Node* native_context = NewNode(javascript()->LoadNativeContext(), global); 3658 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true);
3659 Node* native_context = NewNode(op, current_context());
3661 return NewNode(javascript()->LoadContext(0, index, true), native_context); 3660 return NewNode(javascript()->LoadContext(0, index, true), native_context);
3662 } 3661 }
3663 3662
3664 3663
3665 Node* AstGraphBuilder::BuildLoadFeedbackVector() { 3664 Node* AstGraphBuilder::BuildLoadFeedbackVector() {
3666 if (!feedback_vector_.is_set()) { 3665 if (!feedback_vector_.is_set()) {
3667 Node* closure = GetFunctionClosure(); 3666 Node* closure = GetFunctionClosure();
3668 Node* shared = BuildLoadImmutableObjectField( 3667 Node* shared = BuildLoadImmutableObjectField(
3669 closure, JSFunction::kSharedFunctionInfoOffset); 3668 closure, JSFunction::kSharedFunctionInfoOffset);
3670 Node* vector = BuildLoadImmutableObjectField( 3669 Node* vector = BuildLoadImmutableObjectField(
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
4305 // Phi does not exist yet, introduce one. 4304 // Phi does not exist yet, introduce one.
4306 value = NewPhi(inputs, value, control); 4305 value = NewPhi(inputs, value, control);
4307 value->ReplaceInput(inputs - 1, other); 4306 value->ReplaceInput(inputs - 1, other);
4308 } 4307 }
4309 return value; 4308 return value;
4310 } 4309 }
4311 4310
4312 } // namespace compiler 4311 } // namespace compiler
4313 } // namespace internal 4312 } // namespace internal
4314 } // namespace v8 4313 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/compiler/bytecode-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698