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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 } | 50 } |
51 | 51 |
52 uint8_t InputInt5(size_t index) { | 52 uint8_t InputInt5(size_t index) { |
53 return static_cast<uint8_t>(InputInt32(index) & 0x1F); | 53 return static_cast<uint8_t>(InputInt32(index) & 0x1F); |
54 } | 54 } |
55 | 55 |
56 uint8_t InputInt6(size_t index) { | 56 uint8_t InputInt6(size_t index) { |
57 return static_cast<uint8_t>(InputInt32(index) & 0x3F); | 57 return static_cast<uint8_t>(InputInt32(index) & 0x3F); |
58 } | 58 } |
59 | 59 |
| 60 ExternalReference InputExternalReference(size_t index) { |
| 61 return ToExternalReference(instr_->InputAt(index)); |
| 62 } |
| 63 |
60 Handle<HeapObject> InputHeapObject(size_t index) { | 64 Handle<HeapObject> InputHeapObject(size_t index) { |
61 return ToHeapObject(instr_->InputAt(index)); | 65 return ToHeapObject(instr_->InputAt(index)); |
62 } | 66 } |
63 | 67 |
64 Label* InputLabel(size_t index) { return ToLabel(instr_->InputAt(index)); } | 68 Label* InputLabel(size_t index) { return ToLabel(instr_->InputAt(index)); } |
65 | 69 |
66 RpoNumber InputRpo(size_t index) { | 70 RpoNumber InputRpo(size_t index) { |
67 return ToRpoNumber(instr_->InputAt(index)); | 71 return ToRpoNumber(instr_->InputAt(index)); |
68 } | 72 } |
69 | 73 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 Constant ToConstant(InstructionOperand* op) { | 105 Constant ToConstant(InstructionOperand* op) { |
102 if (op->IsImmediate()) { | 106 if (op->IsImmediate()) { |
103 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); | 107 return gen_->code()->GetImmediate(ImmediateOperand::cast(op)); |
104 } | 108 } |
105 return gen_->code()->GetConstant( | 109 return gen_->code()->GetConstant( |
106 ConstantOperand::cast(op)->virtual_register()); | 110 ConstantOperand::cast(op)->virtual_register()); |
107 } | 111 } |
108 | 112 |
109 double ToDouble(InstructionOperand* op) { return ToConstant(op).ToFloat64(); } | 113 double ToDouble(InstructionOperand* op) { return ToConstant(op).ToFloat64(); } |
110 | 114 |
| 115 ExternalReference ToExternalReference(InstructionOperand* op) { |
| 116 return ToConstant(op).ToExternalReference(); |
| 117 } |
| 118 |
111 Handle<HeapObject> ToHeapObject(InstructionOperand* op) { | 119 Handle<HeapObject> ToHeapObject(InstructionOperand* op) { |
112 return ToConstant(op).ToHeapObject(); | 120 return ToConstant(op).ToHeapObject(); |
113 } | 121 } |
114 | 122 |
115 Frame* frame() const { return gen_->frame(); } | 123 Frame* frame() const { return gen_->frame(); } |
116 Isolate* isolate() const { return gen_->isolate(); } | 124 Isolate* isolate() const { return gen_->isolate(); } |
117 Linkage* linkage() const { return gen_->linkage(); } | 125 Linkage* linkage() const { return gen_->linkage(); } |
118 | 126 |
119 protected: | 127 protected: |
120 CodeGenerator* gen_; | 128 CodeGenerator* gen_; |
(...skipping 30 matching lines...) Expand all Loading... |
151 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 | 159 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 |
152 masm->ud2(); | 160 masm->ud2(); |
153 #endif | 161 #endif |
154 } | 162 } |
155 | 163 |
156 } // namespace compiler | 164 } // namespace compiler |
157 } // namespace internal | 165 } // namespace internal |
158 } // namespace v8 | 166 } // namespace v8 |
159 | 167 |
160 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H | 168 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H |
OLD | NEW |