OLD | NEW |
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/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3730 } | 3730 } |
3731 | 3731 |
3732 | 3732 |
3733 Node* AstGraphBuilder::BuildLoadImmutableObjectField(Node* object, int offset) { | 3733 Node* AstGraphBuilder::BuildLoadImmutableObjectField(Node* object, int offset) { |
3734 return graph()->NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, | 3734 return graph()->NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, |
3735 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), | 3735 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), |
3736 graph()->start(), graph()->start()); | 3736 graph()->start(), graph()->start()); |
3737 } | 3737 } |
3738 | 3738 |
3739 | 3739 |
3740 Node* AstGraphBuilder::BuildLoadBuiltinsObject() { | |
3741 Node* global = BuildLoadGlobalObject(); | |
3742 Node* builtins = | |
3743 BuildLoadObjectField(global, JSGlobalObject::kBuiltinsOffset); | |
3744 return builtins; | |
3745 } | |
3746 | |
3747 | |
3748 Node* AstGraphBuilder::BuildLoadGlobalObject() { | 3740 Node* AstGraphBuilder::BuildLoadGlobalObject() { |
3749 const Operator* load_op = | 3741 const Operator* load_op = |
3750 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true); | 3742 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true); |
3751 return NewNode(load_op, GetFunctionContext()); | 3743 return NewNode(load_op, GetFunctionContext()); |
3752 } | 3744 } |
3753 | 3745 |
3754 | 3746 |
3755 Node* AstGraphBuilder::BuildLoadNativeContextField(int index) { | 3747 Node* AstGraphBuilder::BuildLoadNativeContextField(int index) { |
3756 Node* global = BuildLoadGlobalObject(); | 3748 Node* global = BuildLoadGlobalObject(); |
3757 Node* native_context = | 3749 Node* native_context = |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4302 // Phi does not exist yet, introduce one. | 4294 // Phi does not exist yet, introduce one. |
4303 value = NewPhi(inputs, value, control); | 4295 value = NewPhi(inputs, value, control); |
4304 value->ReplaceInput(inputs - 1, other); | 4296 value->ReplaceInput(inputs - 1, other); |
4305 } | 4297 } |
4306 return value; | 4298 return value; |
4307 } | 4299 } |
4308 | 4300 |
4309 } // namespace compiler | 4301 } // namespace compiler |
4310 } // namespace internal | 4302 } // namespace internal |
4311 } // namespace v8 | 4303 } // namespace v8 |
OLD | NEW |