OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/bytecode-graph-builder.h" | 5 #include "src/compiler/bytecode-graph-builder.h" |
6 | 6 |
7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/operator-properties.h" | 8 #include "src/compiler/operator-properties.h" |
9 #include "src/interpreter/bytecode-array-iterator.h" | 9 #include "src/interpreter/bytecode-array-iterator.h" |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 | 142 |
143 Node* BytecodeGraphBuilder::BuildLoadImmutableObjectField(Node* object, | 143 Node* BytecodeGraphBuilder::BuildLoadImmutableObjectField(Node* object, |
144 int offset) { | 144 int offset) { |
145 return graph()->NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, | 145 return graph()->NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, |
146 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), | 146 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), |
147 graph()->start(), graph()->start()); | 147 graph()->start(), graph()->start()); |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 Node* BytecodeGraphBuilder::BuildLoadGlobalObject() { | |
152 const Operator* load_op = | |
153 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true); | |
154 return NewNode(load_op, GetFunctionContext()); | |
155 } | |
156 | |
157 | |
158 Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) { | 151 Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) { |
159 Node* global = BuildLoadGlobalObject(); | 152 const Operator* op = |
160 Node* native_context = | 153 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); |
161 BuildLoadObjectField(global, JSGlobalObject::kNativeContextOffset); | 154 Node* native_context = NewNode(op, environment()->Context()); |
162 return NewNode(javascript()->LoadContext(0, index, true), native_context); | 155 return NewNode(javascript()->LoadContext(0, index, true), native_context); |
163 } | 156 } |
164 | 157 |
165 | 158 |
166 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { | 159 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { |
167 if (!feedback_vector_.is_set()) { | 160 if (!feedback_vector_.is_set()) { |
168 Node* closure = GetFunctionClosure(); | 161 Node* closure = GetFunctionClosure(); |
169 Node* shared = BuildLoadImmutableObjectField( | 162 Node* shared = BuildLoadImmutableObjectField( |
170 closure, JSFunction::kSharedFunctionInfoOffset); | 163 closure, JSFunction::kSharedFunctionInfoOffset); |
171 Node* vector = BuildLoadImmutableObjectField( | 164 Node* vector = BuildLoadImmutableObjectField( |
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 | 1245 |
1253 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1246 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1254 if (environment()->IsMarkedAsUnreachable()) return; | 1247 if (environment()->IsMarkedAsUnreachable()) return; |
1255 environment()->MarkAsUnreachable(); | 1248 environment()->MarkAsUnreachable(); |
1256 exit_controls_.push_back(exit); | 1249 exit_controls_.push_back(exit); |
1257 } | 1250 } |
1258 | 1251 |
1259 } // namespace compiler | 1252 } // namespace compiler |
1260 } // namespace internal | 1253 } // namespace internal |
1261 } // namespace v8 | 1254 } // namespace v8 |
OLD | NEW |