OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_CODE_GENERATOR_IMPL_H_ | 5 #ifndef V8_COMPILER_CODE_GENERATOR_IMPL_H_ |
6 #define V8_COMPILER_CODE_GENERATOR_IMPL_H_ | 6 #define V8_COMPILER_CODE_GENERATOR_IMPL_H_ |
7 | 7 |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compiler/code-generator.h" | 9 #include "src/compiler/code-generator.h" |
10 #include "src/compiler/instruction.h" | 10 #include "src/compiler/instruction.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 Label* ToLabel(InstructionOperand* op) { | 88 Label* ToLabel(InstructionOperand* op) { |
89 return gen_->GetLabel(ToRpoNumber(op)); | 89 return gen_->GetLabel(ToRpoNumber(op)); |
90 } | 90 } |
91 | 91 |
92 RpoNumber ToRpoNumber(InstructionOperand* op) { | 92 RpoNumber ToRpoNumber(InstructionOperand* op) { |
93 return ToConstant(op).ToRpoNumber(); | 93 return ToConstant(op).ToRpoNumber(); |
94 } | 94 } |
95 | 95 |
96 Register ToRegister(InstructionOperand* op) { | 96 Register ToRegister(InstructionOperand* op) { |
97 return RegisterOperand::cast(op)->GetRegister(); | 97 return Register::FromAllocationIndex(RegisterOperand::cast(op)->index()); |
98 } | 98 } |
99 | 99 |
100 DoubleRegister ToDoubleRegister(InstructionOperand* op) { | 100 DoubleRegister ToDoubleRegister(InstructionOperand* op) { |
101 return DoubleRegisterOperand::cast(op)->GetDoubleRegister(); | 101 return DoubleRegister::FromAllocationIndex( |
| 102 DoubleRegisterOperand::cast(op)->index()); |
102 } | 103 } |
103 | 104 |
104 Constant ToConstant(InstructionOperand* op) { | 105 Constant ToConstant(InstructionOperand* op) { |
105 if (op->IsImmediate()) { | 106 if (op->IsImmediate()) { |
106 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); | 107 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); |
107 } | 108 } |
108 return gen_->code()->GetConstant( | 109 return gen_->code()->GetConstant( |
109 ConstantOperand::cast(op)->virtual_register()); | 110 ConstantOperand::cast(op)->virtual_register()); |
110 } | 111 } |
111 | 112 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 | 159 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 |
159 masm->ud2(); | 160 masm->ud2(); |
160 #endif | 161 #endif |
161 } | 162 } |
162 | 163 |
163 } // namespace compiler | 164 } // namespace compiler |
164 } // namespace internal | 165 } // namespace internal |
165 } // namespace v8 | 166 } // namespace v8 |
166 | 167 |
167 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H | 168 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H |
OLD | NEW |