| 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/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
| 9 #include "src/compiler/instruction.h" | 9 #include "src/compiler/instruction.h" |
| 10 #include "src/compiler/instruction-selector.h" | 10 #include "src/compiler/instruction-selector.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 InstructionOperand* TempRegister(Register reg) { | 121 InstructionOperand* TempRegister(Register reg) { |
| 122 return new (zone()) UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER, | 122 return new (zone()) UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER, |
| 123 Register::ToAllocationIndex(reg)); | 123 Register::ToAllocationIndex(reg)); |
| 124 } | 124 } |
| 125 | 125 |
| 126 InstructionOperand* TempImmediate(int32_t imm) { | 126 InstructionOperand* TempImmediate(int32_t imm) { |
| 127 int index = sequence()->AddImmediate(Constant(imm)); | 127 int index = sequence()->AddImmediate(Constant(imm)); |
| 128 return ImmediateOperand::Create(index, zone()); | 128 return ImmediateOperand::Create(index, zone()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 InstructionOperand* TempLocation(LinkageLocation location, MachineType type) { |
| 132 UnallocatedOperand* op = ToUnallocatedOperand(location, type); |
| 133 op->set_virtual_register(sequence()->NextVirtualRegister()); |
| 134 return op; |
| 135 } |
| 136 |
| 131 InstructionOperand* Label(BasicBlock* block) { | 137 InstructionOperand* Label(BasicBlock* block) { |
| 132 // TODO(bmeurer): We misuse ImmediateOperand here. | 138 // TODO(bmeurer): We misuse ImmediateOperand here. |
| 133 return TempImmediate(block->rpo_number()); | 139 return TempImmediate(block->rpo_number()); |
| 134 } | 140 } |
| 135 | 141 |
| 136 protected: | 142 protected: |
| 137 InstructionSelector* selector() const { return selector_; } | 143 InstructionSelector* selector() const { return selector_; } |
| 138 InstructionSequence* sequence() const { return selector()->sequence(); } | 144 InstructionSequence* sequence() const { return selector()->sequence(); } |
| 139 Isolate* isolate() const { return zone()->isolate(); } | 145 Isolate* isolate() const { return zone()->isolate(); } |
| 140 Zone* zone() const { return selector()->instruction_zone(); } | 146 Zone* zone() const { return selector()->instruction_zone(); } |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 : (frame_state_descriptor->GetTotalSize() + | 361 : (frame_state_descriptor->GetTotalSize() + |
| 356 1); // Include deopt id. | 362 1); // Include deopt id. |
| 357 } | 363 } |
| 358 }; | 364 }; |
| 359 | 365 |
| 360 } // namespace compiler | 366 } // namespace compiler |
| 361 } // namespace internal | 367 } // namespace internal |
| 362 } // namespace v8 | 368 } // namespace v8 |
| 363 | 369 |
| 364 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 370 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
| OLD | NEW |