| 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 if (op->kind() == InstructionOperand::STACK_POINTER) { |
| 98 return StandardFrame::sp_register(); |
| 99 } |
| 100 if (op->kind() == InstructionOperand::FRAME_POINTER) { |
| 101 return StandardFrame::fp_register(); |
| 102 } |
| 97 return Register::FromAllocationIndex(RegisterOperand::cast(op)->index()); | 103 return Register::FromAllocationIndex(RegisterOperand::cast(op)->index()); |
| 98 } | 104 } |
| 99 | 105 |
| 100 DoubleRegister ToDoubleRegister(InstructionOperand* op) { | 106 DoubleRegister ToDoubleRegister(InstructionOperand* op) { |
| 101 return DoubleRegister::FromAllocationIndex( | 107 return DoubleRegister::FromAllocationIndex( |
| 102 DoubleRegisterOperand::cast(op)->index()); | 108 DoubleRegisterOperand::cast(op)->index()); |
| 103 } | 109 } |
| 104 | 110 |
| 105 Constant ToConstant(InstructionOperand* op) { | 111 Constant ToConstant(InstructionOperand* op) { |
| 106 if (op->IsImmediate()) { | 112 if (op->IsImmediate()) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 | 165 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 |
| 160 masm->ud2(); | 166 masm->ud2(); |
| 161 #endif | 167 #endif |
| 162 } | 168 } |
| 163 | 169 |
| 164 } // namespace compiler | 170 } // namespace compiler |
| 165 } // namespace internal | 171 } // namespace internal |
| 166 } // namespace v8 | 172 } // namespace v8 |
| 167 | 173 |
| 168 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H | 174 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H |
| OLD | NEW |