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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 float ToFloat32(InstructionOperand* op) { return ToConstant(op).ToFloat32(); } | 120 float ToFloat32(InstructionOperand* op) { return ToConstant(op).ToFloat32(); } |
121 | 121 |
122 ExternalReference ToExternalReference(InstructionOperand* op) { | 122 ExternalReference ToExternalReference(InstructionOperand* op) { |
123 return ToConstant(op).ToExternalReference(); | 123 return ToConstant(op).ToExternalReference(); |
124 } | 124 } |
125 | 125 |
126 Handle<HeapObject> ToHeapObject(InstructionOperand* op) { | 126 Handle<HeapObject> ToHeapObject(InstructionOperand* op) { |
127 return ToConstant(op).ToHeapObject(); | 127 return ToConstant(op).ToHeapObject(); |
128 } | 128 } |
129 | 129 |
130 Frame* frame() const { return gen_->frame(); } | 130 const Frame* frame() const { return gen_->frame(); } |
131 FrameAccessState* frame_access_state() const { | 131 FrameAccessState* frame_access_state() const { |
132 return gen_->frame_access_state(); | 132 return gen_->frame_access_state(); |
133 } | 133 } |
134 Isolate* isolate() const { return gen_->isolate(); } | 134 Isolate* isolate() const { return gen_->isolate(); } |
135 Linkage* linkage() const { return gen_->linkage(); } | 135 Linkage* linkage() const { return gen_->linkage(); } |
136 | 136 |
137 protected: | 137 protected: |
138 CodeGenerator* gen_; | 138 CodeGenerator* gen_; |
139 Instruction* instr_; | 139 Instruction* instr_; |
140 }; | 140 }; |
(...skipping 15 matching lines...) Expand all Loading... |
156 // Generator for out-of-line code that is emitted after the main code is done. | 156 // Generator for out-of-line code that is emitted after the main code is done. |
157 class OutOfLineCode : public ZoneObject { | 157 class OutOfLineCode : public ZoneObject { |
158 public: | 158 public: |
159 explicit OutOfLineCode(CodeGenerator* gen); | 159 explicit OutOfLineCode(CodeGenerator* gen); |
160 virtual ~OutOfLineCode(); | 160 virtual ~OutOfLineCode(); |
161 | 161 |
162 virtual void Generate() = 0; | 162 virtual void Generate() = 0; |
163 | 163 |
164 Label* entry() { return &entry_; } | 164 Label* entry() { return &entry_; } |
165 Label* exit() { return &exit_; } | 165 Label* exit() { return &exit_; } |
166 Frame* frame() const { return frame_; } | 166 const Frame* frame() const { return frame_; } |
167 Isolate* isolate() const { return masm()->isolate(); } | 167 Isolate* isolate() const { return masm()->isolate(); } |
168 MacroAssembler* masm() const { return masm_; } | 168 MacroAssembler* masm() const { return masm_; } |
169 OutOfLineCode* next() const { return next_; } | 169 OutOfLineCode* next() const { return next_; } |
170 | 170 |
171 private: | 171 private: |
172 Label entry_; | 172 Label entry_; |
173 Label exit_; | 173 Label exit_; |
174 Frame* const frame_; | 174 const Frame* const frame_; |
175 MacroAssembler* const masm_; | 175 MacroAssembler* const masm_; |
176 OutOfLineCode* const next_; | 176 OutOfLineCode* const next_; |
177 }; | 177 }; |
178 | 178 |
179 | 179 |
180 // TODO(dcarney): generify this on bleeding_edge and replace this call | 180 // TODO(dcarney): generify this on bleeding_edge and replace this call |
181 // when merged. | 181 // when merged. |
182 static inline void FinishCode(MacroAssembler* masm) { | 182 static inline void FinishCode(MacroAssembler* masm) { |
183 #if V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_ARM | 183 #if V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_ARM |
184 masm->CheckConstPool(true, false); | 184 masm->CheckConstPool(true, false); |
185 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 | 185 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 |
186 masm->ud2(); | 186 masm->ud2(); |
187 #endif | 187 #endif |
188 } | 188 } |
189 | 189 |
190 } // namespace compiler | 190 } // namespace compiler |
191 } // namespace internal | 191 } // namespace internal |
192 } // namespace v8 | 192 } // namespace v8 |
193 | 193 |
194 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H | 194 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H |
OLD | NEW |