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 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 int index = Linkage::kJSCallClosureParamIndex; | 149 int index = Linkage::kJSCallClosureParamIndex; |
150 const Operator* op = common()->Parameter(index, "%closure"); | 150 const Operator* op = common()->Parameter(index, "%closure"); |
151 Node* node = NewNode(op, graph()->start()); | 151 Node* node = NewNode(op, graph()->start()); |
152 function_closure_.set(node); | 152 function_closure_.set(node); |
153 } | 153 } |
154 return function_closure_.get(); | 154 return function_closure_.get(); |
155 } | 155 } |
156 | 156 |
157 | 157 |
158 Node* BytecodeGraphBuilder::BuildLoadObjectField(Node* object, int offset) { | 158 Node* BytecodeGraphBuilder::BuildLoadObjectField(Node* object, int offset) { |
159 return NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, | 159 return NewNode(jsgraph()->machine()->Load(MachineType::AnyTagged()), object, |
160 jsgraph()->IntPtrConstant(offset - kHeapObjectTag)); | 160 jsgraph()->IntPtrConstant(offset - kHeapObjectTag)); |
161 } | 161 } |
162 | 162 |
163 | 163 |
164 Node* BytecodeGraphBuilder::BuildLoadImmutableObjectField(Node* object, | 164 Node* BytecodeGraphBuilder::BuildLoadImmutableObjectField(Node* object, |
165 int offset) { | 165 int offset) { |
166 return graph()->NewNode(jsgraph()->machine()->Load(kMachAnyTagged), object, | 166 return graph()->NewNode(jsgraph()->machine()->Load(MachineType::AnyTagged()), |
| 167 object, |
167 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), | 168 jsgraph()->IntPtrConstant(offset - kHeapObjectTag), |
168 graph()->start(), graph()->start()); | 169 graph()->start(), graph()->start()); |
169 } | 170 } |
170 | 171 |
171 | 172 |
172 Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) { | 173 Node* BytecodeGraphBuilder::BuildLoadNativeContextField(int index) { |
173 const Operator* op = | 174 const Operator* op = |
174 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); | 175 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); |
175 Node* native_context = NewNode(op, environment()->Context()); | 176 Node* native_context = NewNode(op, environment()->Context()); |
176 return NewNode(javascript()->LoadContext(0, index, true), native_context); | 177 return NewNode(javascript()->LoadContext(0, index, true), native_context); |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 | 1028 |
1028 AddEmptyFrameStateInputs(node); | 1029 AddEmptyFrameStateInputs(node); |
1029 environment()->BindAccumulator(node); | 1030 environment()->BindAccumulator(node); |
1030 } | 1031 } |
1031 | 1032 |
1032 | 1033 |
1033 void BytecodeGraphBuilder::VisitLogicalNot( | 1034 void BytecodeGraphBuilder::VisitLogicalNot( |
1034 const interpreter::BytecodeArrayIterator& iterator) { | 1035 const interpreter::BytecodeArrayIterator& iterator) { |
1035 Node* value = NewNode(javascript()->ToBoolean(ToBooleanHint::kAny), | 1036 Node* value = NewNode(javascript()->ToBoolean(ToBooleanHint::kAny), |
1036 environment()->LookupAccumulator()); | 1037 environment()->LookupAccumulator()); |
1037 Node* node = NewNode(common()->Select(kMachAnyTagged), value, | 1038 Node* node = NewNode(common()->Select(MachineRepresentation::kTagged), value, |
1038 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); | 1039 jsgraph()->FalseConstant(), jsgraph()->TrueConstant()); |
1039 environment()->BindAccumulator(node); | 1040 environment()->BindAccumulator(node); |
1040 } | 1041 } |
1041 | 1042 |
1042 | 1043 |
1043 void BytecodeGraphBuilder::VisitTypeOf( | 1044 void BytecodeGraphBuilder::VisitTypeOf( |
1044 const interpreter::BytecodeArrayIterator& iterator) { | 1045 const interpreter::BytecodeArrayIterator& iterator) { |
1045 Node* node = | 1046 Node* node = |
1046 NewNode(javascript()->TypeOf(), environment()->LookupAccumulator()); | 1047 NewNode(javascript()->TypeOf(), environment()->LookupAccumulator()); |
1047 environment()->BindAccumulator(node); | 1048 environment()->BindAccumulator(node); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1377 | 1378 |
1378 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { | 1379 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { |
1379 if (environment()->IsMarkedAsUnreachable()) return; | 1380 if (environment()->IsMarkedAsUnreachable()) return; |
1380 environment()->MarkAsUnreachable(); | 1381 environment()->MarkAsUnreachable(); |
1381 exit_controls_.push_back(exit); | 1382 exit_controls_.push_back(exit); |
1382 } | 1383 } |
1383 | 1384 |
1384 } // namespace compiler | 1385 } // namespace compiler |
1385 } // namespace internal | 1386 } // namespace internal |
1386 } // namespace v8 | 1387 } // namespace v8 |
OLD | NEW |