OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_FLOW_GRAPH_COMPILER_X64_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_X64_H_ |
6 #define VM_FLOW_GRAPH_COMPILER_X64_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_X64_H_ |
7 | 7 |
8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ | 8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ |
9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_x64.h. | 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_x64.h. |
10 #endif | 10 #endif |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 intptr_t deopt_id, | 184 intptr_t deopt_id, |
185 intptr_t token_pos, | 185 intptr_t token_pos, |
186 intptr_t try_index); | 186 intptr_t try_index); |
187 Label* AddDeoptStub(intptr_t deopt_id, | 187 Label* AddDeoptStub(intptr_t deopt_id, |
188 intptr_t try_index_, | 188 intptr_t try_index_, |
189 DeoptReasonId reason, | 189 DeoptReasonId reason, |
190 Register reg1 = kNoRegister, | 190 Register reg1 = kNoRegister, |
191 Register reg2 = kNoRegister, | 191 Register reg2 = kNoRegister, |
192 Register reg3 = kNoRegister); | 192 Register reg3 = kNoRegister); |
193 | 193 |
| 194 void AddSlowPathCode(SlowPathCode* slow_path); |
| 195 |
194 void FinalizeExceptionHandlers(const Code& code); | 196 void FinalizeExceptionHandlers(const Code& code); |
195 void FinalizePcDescriptors(const Code& code); | 197 void FinalizePcDescriptors(const Code& code); |
196 void FinalizeDeoptInfo(const Code& code); | 198 void FinalizeDeoptInfo(const Code& code); |
197 void FinalizeStackmaps(const Code& code); | 199 void FinalizeStackmaps(const Code& code); |
198 void FinalizeVarDescriptors(const Code& code); | 200 void FinalizeVarDescriptors(const Code& code); |
199 void FinalizeComments(const Code& code); | 201 void FinalizeComments(const Code& code); |
200 | 202 |
201 const Bool& bool_true() const { return bool_true_; } | 203 const Bool& bool_true() const { return bool_true_; } |
202 const Bool& bool_false() const { return bool_false_; } | 204 const Bool& bool_false() const { return bool_false_; } |
203 const Class& double_class() const { return double_class_; } | 205 const Class& double_class() const { return double_class_; } |
204 | 206 |
205 FrameRegisterAllocator* frame_register_allocator() { | 207 FrameRegisterAllocator* frame_register_allocator() { |
206 return &frame_register_allocator_; | 208 return &frame_register_allocator_; |
207 } | 209 } |
208 | 210 |
209 // Returns true if the compiled function has a finally clause. | 211 // Returns true if the compiled function has a finally clause. |
210 bool HasFinally() const; | 212 bool HasFinally() const; |
211 | 213 |
212 static const int kLocalsOffsetFromFP = (-1 * kWordSize); | 214 static const int kLocalsOffsetFromFP = (-1 * kWordSize); |
213 | 215 |
| 216 void SaveLiveRegisters(LocationSummary* locs); |
| 217 void RestoreLiveRegisters(LocationSummary* locs); |
| 218 |
214 private: | 219 private: |
215 friend class DeoptimizationStub; | 220 friend class DeoptimizationStub; |
216 | 221 |
217 void GenerateDeferredCode(); | 222 void GenerateDeferredCode(); |
218 | 223 |
219 void EmitInstructionPrologue(Instruction* instr); | 224 void EmitInstructionPrologue(Instruction* instr); |
220 | 225 |
221 // Emit code to load a Value into register 'dst'. | 226 // Emit code to load a Value into register 'dst'. |
222 void LoadValue(Register dst, Value* value); | 227 void LoadValue(Register dst, Value* value); |
223 | 228 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 303 |
299 // Compiler specific per-block state. Indexed by postorder block number | 304 // Compiler specific per-block state. Indexed by postorder block number |
300 // for convenience. This is not the block's index in the block order, | 305 // for convenience. This is not the block's index in the block order, |
301 // which is reverse postorder. | 306 // which is reverse postorder. |
302 BlockEntryInstr* current_block_; | 307 BlockEntryInstr* current_block_; |
303 ExceptionHandlerList* exception_handlers_list_; | 308 ExceptionHandlerList* exception_handlers_list_; |
304 DescriptorList* pc_descriptors_list_; | 309 DescriptorList* pc_descriptors_list_; |
305 StackmapTableBuilder* stackmap_table_builder_; | 310 StackmapTableBuilder* stackmap_table_builder_; |
306 GrowableArray<BlockInfo*> block_info_; | 311 GrowableArray<BlockInfo*> block_info_; |
307 GrowableArray<DeoptimizationStub*> deopt_stubs_; | 312 GrowableArray<DeoptimizationStub*> deopt_stubs_; |
| 313 GrowableArray<SlowPathCode*> slow_path_code_; |
308 const GrowableObjectArray& object_table_; | 314 const GrowableObjectArray& object_table_; |
309 const bool is_optimizing_; | 315 const bool is_optimizing_; |
310 const bool is_ssa_; | 316 const bool is_ssa_; |
311 const bool is_dart_leaf_; | 317 const bool is_dart_leaf_; |
312 | 318 |
313 const Bool& bool_true_; | 319 const Bool& bool_true_; |
314 const Bool& bool_false_; | 320 const Bool& bool_false_; |
315 const Class& double_class_; | 321 const Class& double_class_; |
316 | 322 |
317 FrameRegisterAllocator frame_register_allocator_; | 323 FrameRegisterAllocator frame_register_allocator_; |
318 ParallelMoveResolver parallel_move_resolver_; | 324 ParallelMoveResolver parallel_move_resolver_; |
319 | 325 |
320 // Currently instructions generate deopt stubs internally by | 326 // Currently instructions generate deopt stubs internally by |
321 // calling AddDeoptStub. To communicate deoptimization environment | 327 // calling AddDeoptStub. To communicate deoptimization environment |
322 // that should be used when deoptimizing we store it in this variable. | 328 // that should be used when deoptimizing we store it in this variable. |
323 // In future AddDeoptStub should be moved out of the instruction template. | 329 // In future AddDeoptStub should be moved out of the instruction template. |
324 Environment* pending_deoptimization_env_; | 330 Environment* pending_deoptimization_env_; |
325 | 331 |
326 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 332 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
327 }; | 333 }; |
328 | 334 |
329 } // namespace dart | 335 } // namespace dart |
330 | 336 |
331 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ | 337 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ |
OLD | NEW |