| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 return ImmediateOperand::Create(index, zone()); | 130 return ImmediateOperand::Create(index, zone()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 InstructionOperand* TempLocation(LinkageLocation location, MachineType type) { | 133 InstructionOperand* TempLocation(LinkageLocation location, MachineType type) { |
| 134 UnallocatedOperand* op = ToUnallocatedOperand(location, type); | 134 UnallocatedOperand* op = ToUnallocatedOperand(location, type); |
| 135 op->set_virtual_register(sequence()->NextVirtualRegister()); | 135 op->set_virtual_register(sequence()->NextVirtualRegister()); |
| 136 return op; | 136 return op; |
| 137 } | 137 } |
| 138 | 138 |
| 139 InstructionOperand* Label(BasicBlock* block) { | 139 InstructionOperand* Label(BasicBlock* block) { |
| 140 // TODO(bmeurer): We misuse ImmediateOperand here. | 140 int index = sequence()->AddImmediate(Constant(block->GetRpoNumber())); |
| 141 return TempImmediate(block->rpo_number()); | 141 return ImmediateOperand::Create(index, zone()); |
| 142 } | 142 } |
| 143 | 143 |
| 144 protected: | 144 protected: |
| 145 InstructionSelector* selector() const { return selector_; } | 145 InstructionSelector* selector() const { return selector_; } |
| 146 InstructionSequence* sequence() const { return selector()->sequence(); } | 146 InstructionSequence* sequence() const { return selector()->sequence(); } |
| 147 Isolate* isolate() const { return zone()->isolate(); } | 147 Isolate* isolate() const { return zone()->isolate(); } |
| 148 Zone* zone() const { return selector()->instruction_zone(); } | 148 Zone* zone() const { return selector()->instruction_zone(); } |
| 149 | 149 |
| 150 private: | 150 private: |
| 151 static Constant ToConstant(const Node* node) { | 151 static Constant ToConstant(const Node* node) { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 : (frame_state_descriptor->GetTotalSize() + | 359 : (frame_state_descriptor->GetTotalSize() + |
| 360 1); // Include deopt id. | 360 1); // Include deopt id. |
| 361 } | 361 } |
| 362 }; | 362 }; |
| 363 | 363 |
| 364 } // namespace compiler | 364 } // namespace compiler |
| 365 } // namespace internal | 365 } // namespace internal |
| 366 } // namespace v8 | 366 } // namespace v8 |
| 367 | 367 |
| 368 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 368 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
| OLD | NEW |