Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 struct BlockInfo : public ZoneAllocated { | 21 struct BlockInfo : public ZoneAllocated { |
| 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_leaf); | |
| 32 | 33 |
| 33 ~FlowGraphCompiler(); | 34 ~FlowGraphCompiler(); |
| 34 | 35 |
| 35 // Accessors. | 36 // Accessors. |
| 36 Assembler* assembler() const { return assembler_; } | 37 Assembler* assembler() const { return assembler_; } |
| 37 const ParsedFunction& parsed_function() const { return parsed_function_; } | 38 const ParsedFunction& parsed_function() const { return parsed_function_; } |
| 38 const GrowableArray<BlockEntryInstr*>& block_order() const { | 39 const GrowableArray<BlockEntryInstr*>& block_order() const { |
| 39 return block_order_; | 40 return block_order_; |
| 40 } | 41 } |
| 41 DescriptorList* pc_descriptors_list() const { | 42 DescriptorList* pc_descriptors_list() const { |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 255 void GenerateInlinedGetter(intptr_t offset); | 256 void GenerateInlinedGetter(intptr_t offset); |
| 256 void GenerateInlinedSetter(intptr_t offset); | 257 void GenerateInlinedSetter(intptr_t offset); |
| 257 | 258 |
| 258 // Map a block number in a forward iteration into the block number in the | 259 // Map a block number in a forward iteration into the block number in the |
| 259 // corresponding reverse iteration. Used to obtain an index into | 260 // corresponding reverse iteration. Used to obtain an index into |
| 260 // block_order for reverse iterations. | 261 // block_order for reverse iterations. |
| 261 intptr_t reverse_index(intptr_t index) const { | 262 intptr_t reverse_index(intptr_t index) const { |
| 262 return block_order_.length() - index - 1; | 263 return block_order_.length() - index - 1; |
| 263 } | 264 } |
| 264 | 265 |
| 266 // Returns true if the generated code does not call other Dart code. | |
|
regis
2012/06/25 23:46:09
ditto
srdjan
2012/06/25 23:50:22
Done.
| |
| 267 // Only deoptimization is allowed to occur. Closures are not leaf. | |
| 268 bool IsLeaf() const; | |
| 269 | |
| 265 class Assembler* assembler_; | 270 class Assembler* assembler_; |
| 266 const ParsedFunction& parsed_function_; | 271 const ParsedFunction& parsed_function_; |
| 267 const GrowableArray<BlockEntryInstr*>& block_order_; | 272 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 268 | 273 |
| 269 // Compiler specific per-block state. Indexed by postorder block number | 274 // Compiler specific per-block state. Indexed by postorder block number |
| 270 // for convenience. This is not the block's index in the block order, | 275 // for convenience. This is not the block's index in the block order, |
| 271 // which is reverse postorder. | 276 // which is reverse postorder. |
| 272 BlockEntryInstr* current_block_; | 277 BlockEntryInstr* current_block_; |
| 273 ExceptionHandlerList* exception_handlers_list_; | 278 ExceptionHandlerList* exception_handlers_list_; |
| 274 DescriptorList* pc_descriptors_list_; | 279 DescriptorList* pc_descriptors_list_; |
| 275 StackmapBuilder* stackmap_builder_; | 280 StackmapBuilder* stackmap_builder_; |
| 276 GrowableArray<BlockInfo*> block_info_; | 281 GrowableArray<BlockInfo*> block_info_; |
| 277 GrowableArray<DeoptimizationStub*> deopt_stubs_; | 282 GrowableArray<DeoptimizationStub*> deopt_stubs_; |
| 278 const bool is_optimizing_; | 283 const bool is_optimizing_; |
| 284 const bool is_dart_leaf_; | |
| 279 | 285 |
| 280 const Bool& bool_true_; | 286 const Bool& bool_true_; |
| 281 const Bool& bool_false_; | 287 const Bool& bool_false_; |
| 282 const Class& double_class_; | 288 const Class& double_class_; |
| 283 | 289 |
| 284 FrameRegisterAllocator frame_register_allocator_; | 290 FrameRegisterAllocator frame_register_allocator_; |
| 285 | 291 |
| 286 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 292 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
| 287 }; | 293 }; |
| 288 | 294 |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 313 const DeoptReasonId reason_; | 319 const DeoptReasonId reason_; |
| 314 GrowableArray<Register> registers_; | 320 GrowableArray<Register> registers_; |
| 315 Label entry_label_; | 321 Label entry_label_; |
| 316 | 322 |
| 317 DISALLOW_COPY_AND_ASSIGN(DeoptimizationStub); | 323 DISALLOW_COPY_AND_ASSIGN(DeoptimizationStub); |
| 318 }; | 324 }; |
| 319 | 325 |
| 320 } // namespace dart | 326 } // namespace dart |
| 321 | 327 |
| 322 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ | 328 #endif // VM_FLOW_GRAPH_COMPILER_X64_H_ |
| OLD | NEW |