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 19 matching lines...) Expand all Loading... |
30 Register InputRegister(size_t index) { | 30 Register InputRegister(size_t index) { |
31 return ToRegister(instr_->InputAt(index)); | 31 return ToRegister(instr_->InputAt(index)); |
32 } | 32 } |
33 | 33 |
34 DoubleRegister InputDoubleRegister(size_t index) { | 34 DoubleRegister InputDoubleRegister(size_t index) { |
35 return ToDoubleRegister(instr_->InputAt(index)); | 35 return ToDoubleRegister(instr_->InputAt(index)); |
36 } | 36 } |
37 | 37 |
38 double InputDouble(size_t index) { return ToDouble(instr_->InputAt(index)); } | 38 double InputDouble(size_t index) { return ToDouble(instr_->InputAt(index)); } |
39 | 39 |
| 40 float InputFloat32(size_t index) { return ToFloat32(instr_->InputAt(index)); } |
| 41 |
40 int32_t InputInt32(size_t index) { | 42 int32_t InputInt32(size_t index) { |
41 return ToConstant(instr_->InputAt(index)).ToInt32(); | 43 return ToConstant(instr_->InputAt(index)).ToInt32(); |
42 } | 44 } |
43 | 45 |
44 int8_t InputInt8(size_t index) { | 46 int8_t InputInt8(size_t index) { |
45 return static_cast<int8_t>(InputInt32(index)); | 47 return static_cast<int8_t>(InputInt32(index)); |
46 } | 48 } |
47 | 49 |
48 int16_t InputInt16(size_t index) { | 50 int16_t InputInt16(size_t index) { |
49 return static_cast<int16_t>(InputInt32(index)); | 51 return static_cast<int16_t>(InputInt32(index)); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 Constant ToConstant(InstructionOperand* op) { | 107 Constant ToConstant(InstructionOperand* op) { |
106 if (op->IsImmediate()) { | 108 if (op->IsImmediate()) { |
107 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); | 109 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); |
108 } | 110 } |
109 return gen_->code()->GetConstant( | 111 return gen_->code()->GetConstant( |
110 ConstantOperand::cast(op)->virtual_register()); | 112 ConstantOperand::cast(op)->virtual_register()); |
111 } | 113 } |
112 | 114 |
113 double ToDouble(InstructionOperand* op) { return ToConstant(op).ToFloat64(); } | 115 double ToDouble(InstructionOperand* op) { return ToConstant(op).ToFloat64(); } |
114 | 116 |
| 117 float ToFloat32(InstructionOperand* op) { return ToConstant(op).ToFloat32(); } |
| 118 |
115 ExternalReference ToExternalReference(InstructionOperand* op) { | 119 ExternalReference ToExternalReference(InstructionOperand* op) { |
116 return ToConstant(op).ToExternalReference(); | 120 return ToConstant(op).ToExternalReference(); |
117 } | 121 } |
118 | 122 |
119 Handle<HeapObject> ToHeapObject(InstructionOperand* op) { | 123 Handle<HeapObject> ToHeapObject(InstructionOperand* op) { |
120 return ToConstant(op).ToHeapObject(); | 124 return ToConstant(op).ToHeapObject(); |
121 } | 125 } |
122 | 126 |
123 Frame* frame() const { return gen_->frame(); } | 127 Frame* frame() const { return gen_->frame(); } |
124 Isolate* isolate() const { return gen_->isolate(); } | 128 Isolate* isolate() const { return gen_->isolate(); } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 | 163 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 |
160 masm->ud2(); | 164 masm->ud2(); |
161 #endif | 165 #endif |
162 } | 166 } |
163 | 167 |
164 } // namespace compiler | 168 } // namespace compiler |
165 } // namespace internal | 169 } // namespace internal |
166 } // namespace v8 | 170 } // namespace v8 |
167 | 171 |
168 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H | 172 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H |
OLD | NEW |