| 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...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 | 137 |
| 138 InstructionOperand* Label(BasicBlock* block) { | 138 InstructionOperand* Label(BasicBlock* block) { |
| 139 int index = sequence()->AddImmediate(Constant(block->GetRpoNumber())); | 139 int index = sequence()->AddImmediate(Constant(block->GetRpoNumber())); |
| 140 return ImmediateOperand::Create(index, zone()); | 140 return ImmediateOperand::Create(index, zone()); |
| 141 } | 141 } |
| 142 | 142 |
| 143 protected: | 143 protected: |
| 144 InstructionSelector* selector() const { return selector_; } | 144 InstructionSelector* selector() const { return selector_; } |
| 145 InstructionSequence* sequence() const { return selector()->sequence(); } | 145 InstructionSequence* sequence() const { return selector()->sequence(); } |
| 146 Isolate* isolate() const { return zone()->isolate(); } | |
| 147 Zone* zone() const { return selector()->instruction_zone(); } | 146 Zone* zone() const { return selector()->instruction_zone(); } |
| 148 | 147 |
| 149 private: | 148 private: |
| 150 static Constant ToConstant(const Node* node) { | 149 static Constant ToConstant(const Node* node) { |
| 151 switch (node->opcode()) { | 150 switch (node->opcode()) { |
| 152 case IrOpcode::kInt32Constant: | 151 case IrOpcode::kInt32Constant: |
| 153 return Constant(OpParameter<int32_t>(node)); | 152 return Constant(OpParameter<int32_t>(node)); |
| 154 case IrOpcode::kInt64Constant: | 153 case IrOpcode::kInt64Constant: |
| 155 return Constant(OpParameter<int64_t>(node)); | 154 return Constant(OpParameter<int64_t>(node)); |
| 156 case IrOpcode::kFloat32Constant: | 155 case IrOpcode::kFloat32Constant: |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 : (frame_state_descriptor->GetTotalSize() + | 354 : (frame_state_descriptor->GetTotalSize() + |
| 356 1); // Include deopt id. | 355 1); // Include deopt id. |
| 357 } | 356 } |
| 358 }; | 357 }; |
| 359 | 358 |
| 360 } // namespace compiler | 359 } // namespace compiler |
| 361 } // namespace internal | 360 } // namespace internal |
| 362 } // namespace v8 | 361 } // namespace v8 |
| 363 | 362 |
| 364 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 363 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
| OLD | NEW |