| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 Label* ToLabel(InstructionOperand* op) { | 94 Label* ToLabel(InstructionOperand* op) { |
| 95 return gen_->GetLabel(ToRpoNumber(op)); | 95 return gen_->GetLabel(ToRpoNumber(op)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 RpoNumber ToRpoNumber(InstructionOperand* op) { | 98 RpoNumber ToRpoNumber(InstructionOperand* op) { |
| 99 return ToConstant(op).ToRpoNumber(); | 99 return ToConstant(op).ToRpoNumber(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 Register ToRegister(InstructionOperand* op) { | 102 Register ToRegister(InstructionOperand* op) { |
| 103 return RegisterOperand::cast(op)->GetRegister(); | 103 return LocationOperand::cast(op)->GetRegister(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 DoubleRegister ToDoubleRegister(InstructionOperand* op) { | 106 DoubleRegister ToDoubleRegister(InstructionOperand* op) { |
| 107 return DoubleRegisterOperand::cast(op)->GetDoubleRegister(); | 107 return LocationOperand::cast(op)->GetDoubleRegister(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 Constant ToConstant(InstructionOperand* op) { | 110 Constant ToConstant(InstructionOperand* op) { |
| 111 if (op->IsImmediate()) { | 111 if (op->IsImmediate()) { |
| 112 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); | 112 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); |
| 113 } | 113 } |
| 114 return gen_->code()->GetConstant( | 114 return gen_->code()->GetConstant( |
| 115 ConstantOperand::cast(op)->virtual_register()); | 115 ConstantOperand::cast(op)->virtual_register()); |
| 116 } | 116 } |
| 117 | 117 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 | 166 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 |
| 167 masm->ud2(); | 167 masm->ud2(); |
| 168 #endif | 168 #endif |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace compiler | 171 } // namespace compiler |
| 172 } // namespace internal | 172 } // namespace internal |
| 173 } // namespace v8 | 173 } // namespace v8 |
| 174 | 174 |
| 175 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H | 175 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H |
| OLD | NEW |