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 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
7 | 7 |
8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
9 #include "src/compiler/instruction-selector.h" | 9 #include "src/compiler/instruction-selector.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 125 matching lines...) Loading... |
136 Graph* graph() const { return selector()->graph(); } | 136 Graph* graph() const { return selector()->graph(); } |
137 InstructionSelector* selector() const { return selector_; } | 137 InstructionSelector* selector() const { return selector_; } |
138 InstructionSequence* sequence() const { return selector()->sequence(); } | 138 InstructionSequence* sequence() const { return selector()->sequence(); } |
139 Isolate* isolate() const { return zone()->isolate(); } | 139 Isolate* isolate() const { return zone()->isolate(); } |
140 Zone* zone() const { return selector()->instruction_zone(); } | 140 Zone* zone() const { return selector()->instruction_zone(); } |
141 | 141 |
142 private: | 142 private: |
143 static Constant ToConstant(const Node* node) { | 143 static Constant ToConstant(const Node* node) { |
144 switch (node->opcode()) { | 144 switch (node->opcode()) { |
145 case IrOpcode::kInt32Constant: | 145 case IrOpcode::kInt32Constant: |
146 return Constant(ValueOf<int32_t>(node->op())); | 146 return Constant(OpParameter<int32_t>(node)); |
147 case IrOpcode::kInt64Constant: | 147 case IrOpcode::kInt64Constant: |
148 return Constant(ValueOf<int64_t>(node->op())); | 148 return Constant(OpParameter<int64_t>(node)); |
149 case IrOpcode::kNumberConstant: | 149 case IrOpcode::kNumberConstant: |
150 case IrOpcode::kFloat64Constant: | 150 case IrOpcode::kFloat64Constant: |
151 return Constant(ValueOf<double>(node->op())); | 151 return Constant(OpParameter<double>(node)); |
152 case IrOpcode::kExternalConstant: | 152 case IrOpcode::kExternalConstant: |
153 return Constant(ValueOf<ExternalReference>(node->op())); | 153 return Constant(OpParameter<ExternalReference>(node)); |
154 case IrOpcode::kHeapConstant: | 154 case IrOpcode::kHeapConstant: |
155 return Constant(ValueOf<Handle<HeapObject> >(node->op())); | 155 return Constant(OpParameter<Unique<HeapObject> >(node).handle()); |
156 default: | 156 default: |
157 break; | 157 break; |
158 } | 158 } |
159 UNREACHABLE(); | 159 UNREACHABLE(); |
160 return Constant(static_cast<int32_t>(0)); | 160 return Constant(static_cast<int32_t>(0)); |
161 } | 161 } |
162 | 162 |
163 UnallocatedOperand* Define(Node* node, UnallocatedOperand* operand) { | 163 UnallocatedOperand* Define(Node* node, UnallocatedOperand* operand) { |
164 DCHECK_NOT_NULL(node); | 164 DCHECK_NOT_NULL(node); |
165 DCHECK_NOT_NULL(operand); | 165 DCHECK_NOT_NULL(operand); |
(...skipping 185 matching lines...) Loading... |
351 : (frame_state_descriptor->total_size() + | 351 : (frame_state_descriptor->total_size() + |
352 1); // Include deopt id. | 352 1); // Include deopt id. |
353 } | 353 } |
354 }; | 354 }; |
355 | 355 |
356 } // namespace compiler | 356 } // namespace compiler |
357 } // namespace internal | 357 } // namespace internal |
358 } // namespace v8 | 358 } // namespace v8 |
359 | 359 |
360 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 360 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
OLD | NEW |