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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 Register::ToAllocationIndex(reg)); | 138 Register::ToAllocationIndex(reg)); |
139 } | 139 } |
140 | 140 |
141 InstructionOperand* TempImmediate(int32_t imm) { | 141 InstructionOperand* TempImmediate(int32_t imm) { |
142 int index = sequence()->AddImmediate(Constant(imm)); | 142 int index = sequence()->AddImmediate(Constant(imm)); |
143 return ImmediateOperand::Create(index, zone()); | 143 return ImmediateOperand::Create(index, zone()); |
144 } | 144 } |
145 | 145 |
146 InstructionOperand* Label(BasicBlock* block) { | 146 InstructionOperand* Label(BasicBlock* block) { |
147 // TODO(bmeurer): We misuse ImmediateOperand here. | 147 // TODO(bmeurer): We misuse ImmediateOperand here. |
148 return TempImmediate(block->id()); | 148 return ImmediateOperand::Create(block->id(), zone()); |
149 } | 149 } |
150 | 150 |
151 protected: | 151 protected: |
152 Graph* graph() const { return selector()->graph(); } | 152 Graph* graph() const { return selector()->graph(); } |
153 InstructionSelector* selector() const { return selector_; } | 153 InstructionSelector* selector() const { return selector_; } |
154 InstructionSequence* sequence() const { return selector()->sequence(); } | 154 InstructionSequence* sequence() const { return selector()->sequence(); } |
155 Isolate* isolate() const { return zone()->isolate(); } | 155 Isolate* isolate() const { return zone()->isolate(); } |
156 Zone* zone() const { return selector()->instruction_zone(); } | 156 Zone* zone() const { return selector()->instruction_zone(); } |
157 | 157 |
158 private: | 158 private: |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 int control_count() { return descriptor->CanLazilyDeoptimize() ? 2 : 0; } | 362 int control_count() { return descriptor->CanLazilyDeoptimize() ? 2 : 0; } |
363 | 363 |
364 int fixed_and_control_count() { return fixed_count + control_count(); } | 364 int fixed_and_control_count() { return fixed_count + control_count(); } |
365 }; | 365 }; |
366 | 366 |
367 } // namespace compiler | 367 } // namespace compiler |
368 } // namespace internal | 368 } // namespace internal |
369 } // namespace v8 | 369 } // namespace v8 |
370 | 370 |
371 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ | 371 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ |
OLD | NEW |