| 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 |
| 151 Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) { | 158 Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) { |
| 152 const Operator* op = | 159 Node* global = BuildLoadGlobalObject(); |
| 153 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); | 160 Node* native_context = |
| 154 Node* native_context = NewNode(op, environment()->Context()); | 161 BuildLoadObjectField(global, JSGlobalObject::kNativeContextOffset); |
| 155 return NewNode(javascript()->LoadContext(0, index, true), native_context); | 162 return NewNode(javascript()->LoadContext(0, index, true), native_context); |
| 156 } | 163 } |
| 157 | 164 |
| 158 | 165 |
| 159 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { | 166 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { |
| 160 if (!feedback_vector_.is_set()) { | 167 if (!feedback_vector_.is_set()) { |
| 161 Node* closure = GetFunctionClosure(); | 168 Node* closure = GetFunctionClosure(); |
| 162 Node* shared = BuildLoadImmutableObjectField( | 169 Node* shared = BuildLoadImmutableObjectField( |
| 163 closure, JSFunction::kSharedFunctionInfoOffset); | 170 closure, JSFunction::kSharedFunctionInfoOffset); |
| 164 Node* vector = BuildLoadImmutableObjectField( | 171 Node* vector = BuildLoadImmutableObjectField( |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 | 1252 |
| 1246 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1253 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
| 1247 if (environment()->IsMarkedAsUnreachable()) return; | 1254 if (environment()->IsMarkedAsUnreachable()) return; |
| 1248 environment()->MarkAsUnreachable(); | 1255 environment()->MarkAsUnreachable(); |
| 1249 exit_controls_.push_back(exit); | 1256 exit_controls_.push_back(exit); |
| 1250 } | 1257 } |
| 1251 | 1258 |
| 1252 } // namespace compiler | 1259 } // namespace compiler |
| 1253 } // namespace internal | 1260 } // namespace internal |
| 1254 } // namespace v8 | 1261 } // namespace v8 |
| OLD | NEW |