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 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 BlockInfo() : label() { } | 23 BlockInfo() : label() { } |
24 Label label; | 24 Label label; |
25 }; | 25 }; |
26 | 26 |
27 public: | 27 public: |
28 FlowGraphCompiler(Assembler* assembler, | 28 FlowGraphCompiler(Assembler* assembler, |
29 const ParsedFunction& parsed_function, | 29 const ParsedFunction& parsed_function, |
30 const GrowableArray<BlockEntryInstr*>& block_order, | 30 const GrowableArray<BlockEntryInstr*>& block_order, |
31 bool is_optimizing, | 31 bool is_optimizing, |
| 32 bool is_ssa, |
32 bool is_leaf); | 33 bool is_leaf); |
33 | 34 |
34 ~FlowGraphCompiler(); | 35 ~FlowGraphCompiler(); |
35 | 36 |
36 // Accessors. | 37 // Accessors. |
37 Assembler* assembler() const { return assembler_; } | 38 Assembler* assembler() const { return assembler_; } |
38 const ParsedFunction& parsed_function() const { return parsed_function_; } | 39 const ParsedFunction& parsed_function() const { return parsed_function_; } |
39 const GrowableArray<BlockEntryInstr*>& block_order() const { | 40 const GrowableArray<BlockEntryInstr*>& block_order() const { |
40 return block_order_; | 41 return block_order_; |
41 } | 42 } |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // Compiler specific per-block state. Indexed by postorder block number | 276 // Compiler specific per-block state. Indexed by postorder block number |
276 // for convenience. This is not the block's index in the block order, | 277 // for convenience. This is not the block's index in the block order, |
277 // which is reverse postorder. | 278 // which is reverse postorder. |
278 BlockEntryInstr* current_block_; | 279 BlockEntryInstr* current_block_; |
279 ExceptionHandlerList* exception_handlers_list_; | 280 ExceptionHandlerList* exception_handlers_list_; |
280 DescriptorList* pc_descriptors_list_; | 281 DescriptorList* pc_descriptors_list_; |
281 StackmapBuilder* stackmap_builder_; | 282 StackmapBuilder* stackmap_builder_; |
282 GrowableArray<BlockInfo*> block_info_; | 283 GrowableArray<BlockInfo*> block_info_; |
283 GrowableArray<DeoptimizationStub*> deopt_stubs_; | 284 GrowableArray<DeoptimizationStub*> deopt_stubs_; |
284 const bool is_optimizing_; | 285 const bool is_optimizing_; |
| 286 const bool is_ssa_; |
285 const bool is_dart_leaf_; | 287 const bool is_dart_leaf_; |
286 | 288 |
287 const Bool& bool_true_; | 289 const Bool& bool_true_; |
288 const Bool& bool_false_; | 290 const Bool& bool_false_; |
289 const Class& double_class_; | 291 const Class& double_class_; |
290 | 292 |
291 FrameRegisterAllocator frame_register_allocator_; | 293 FrameRegisterAllocator frame_register_allocator_; |
| 294 ParallelMoveResolver parallel_move_resolver_; |
| 295 |
| 296 // Currently instructions generate deopt stubs internally by |
| 297 // calling AddDeoptStub. To communicate deoptimization environment |
| 298 // that should be used when deoptimizing we store it in this variable. |
| 299 // In future AddDeoptStub should be moved out of the instruction template. |
| 300 Environment* pending_deoptimization_env_; |
292 | 301 |
293 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 302 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
294 }; | 303 }; |
295 | 304 |
296 | |
297 class DeoptimizationStub : public ZoneAllocated { | |
298 public: | |
299 DeoptimizationStub(intptr_t deopt_id, | |
300 intptr_t deopt_token_pos, | |
301 intptr_t try_index, | |
302 DeoptReasonId reason) | |
303 : deopt_id_(deopt_id), | |
304 deopt_token_pos_(deopt_token_pos), | |
305 try_index_(try_index), | |
306 reason_(reason), | |
307 registers_(2), | |
308 entry_label_() {} | |
309 | |
310 void Push(Register reg) { registers_.Add(reg); } | |
311 Label* entry_label() { return &entry_label_; } | |
312 | |
313 // Implementation is in architecture specific file. | |
314 void GenerateCode(FlowGraphCompiler* compiler); | |
315 | |
316 private: | |
317 const intptr_t deopt_id_; | |
318 const intptr_t deopt_token_pos_; | |
319 const intptr_t try_index_; | |
320 const DeoptReasonId reason_; | |
321 GrowableArray<Register> registers_; | |
322 Label entry_label_; | |
323 | |
324 DISALLOW_COPY_AND_ASSIGN(DeoptimizationStub); | |
325 }; | |
326 | |
327 } // namespace dart | 305 } // namespace dart |
328 | 306 |
329 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ | 307 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ |
OLD | NEW |