Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: runtime/vm/flow_graph_compiler.h

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed latest comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_H_ 5 #ifndef VM_FLOW_GRAPH_COMPILER_H_
6 #define VM_FLOW_GRAPH_COMPILER_H_ 6 #define VM_FLOW_GRAPH_COMPILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 ~FlowGraphCompiler(); 267 ~FlowGraphCompiler();
268 268
269 static bool SupportsUnboxedDoubles(); 269 static bool SupportsUnboxedDoubles();
270 static bool SupportsUnboxedMints(); 270 static bool SupportsUnboxedMints();
271 static bool SupportsSinCos(); 271 static bool SupportsSinCos();
272 static bool SupportsUnboxedSimd128(); 272 static bool SupportsUnboxedSimd128();
273 273
274 // Accessors. 274 // Accessors.
275 Assembler* assembler() const { return assembler_; } 275 Assembler* assembler() const { return assembler_; }
276 const ParsedFunction& parsed_function() const { return parsed_function_; } 276 ParsedFunction& parsed_function() const { return parsed_function_; }
277 const GrowableArray<BlockEntryInstr*>& block_order() const { 277 const GrowableArray<BlockEntryInstr*>& block_order() const {
278 return block_order_; 278 return block_order_;
279 } 279 }
280 280
281 const FlowGraph& flow_graph() const { return flow_graph_; } 281 const FlowGraph& flow_graph() const { return flow_graph_; }
282 282
283 DescriptorList* pc_descriptors_list() const { 283 DescriptorList* pc_descriptors_list() const {
284 return pc_descriptors_list_; 284 return pc_descriptors_list_;
285 } 285 }
286 BlockEntryInstr* current_block() const { return current_block_; } 286 BlockEntryInstr* current_block() const { return current_block_; }
287 void set_current_block(BlockEntryInstr* value) { 287 void set_current_block(BlockEntryInstr* value) {
288 current_block_ = value; 288 current_block_ = value;
289 } 289 }
290 static bool CanOptimize(); 290 static bool CanOptimize();
291 bool CanOptimizeFunction() const; 291 bool CanOptimizeFunction() const;
292 bool CanOSRFunction() const; 292 bool CanOSRFunction() const;
293 bool is_optimizing() const { return is_optimizing_; } 293 bool is_optimizing() const { return is_optimizing_; }
294 294
295 void EnterIntrinsicMode();
296 void ExitIntrinsicMode();
297 bool intrinsic_mode() const { return intrinsic_mode_; }
298
295 bool ForceSlowPathForStackOverflow() const; 299 bool ForceSlowPathForStackOverflow() const;
296 300
297 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; } 301 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; }
298 ParallelMoveResolver* parallel_move_resolver() { 302 ParallelMoveResolver* parallel_move_resolver() {
299 return &parallel_move_resolver_; 303 return &parallel_move_resolver_;
300 } 304 }
301 305
302 // Constructor is lighweight, major initialization work should occur here. 306 // Constructor is lighweight, major initialization work should occur here.
303 // This makes it easier to measure time spent in the compiler. 307 // This makes it easier to measure time spent in the compiler.
304 void InitCompiler(); 308 void InitCompiler();
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 bool IsListClass(const Class& cls) const { 598 bool IsListClass(const Class& cls) const {
595 return cls.raw() == list_class_.raw(); 599 return cls.raw() == list_class_.raw();
596 } 600 }
597 601
598 void EmitSourceLine(Instruction* instr); 602 void EmitSourceLine(Instruction* instr);
599 603
600 intptr_t GetOptimizationThreshold() const; 604 intptr_t GetOptimizationThreshold() const;
601 605
602 Isolate* isolate_; 606 Isolate* isolate_;
603 Assembler* assembler_; 607 Assembler* assembler_;
604 const ParsedFunction& parsed_function_; 608 ParsedFunction& parsed_function_;
605 const FlowGraph& flow_graph_; 609 const FlowGraph& flow_graph_;
606 const GrowableArray<BlockEntryInstr*>& block_order_; 610 const GrowableArray<BlockEntryInstr*>& block_order_;
607 611
608 // Compiler specific per-block state. Indexed by postorder block number 612 // Compiler specific per-block state. Indexed by postorder block number
609 // for convenience. This is not the block's index in the block order, 613 // for convenience. This is not the block's index in the block order,
610 // which is reverse postorder. 614 // which is reverse postorder.
611 BlockEntryInstr* current_block_; 615 BlockEntryInstr* current_block_;
612 ExceptionHandlerList* exception_handlers_list_; 616 ExceptionHandlerList* exception_handlers_list_;
613 DescriptorList* pc_descriptors_list_; 617 DescriptorList* pc_descriptors_list_;
614 StackmapTableBuilder* stackmap_table_builder_; 618 StackmapTableBuilder* stackmap_table_builder_;
615 GrowableArray<BlockInfo*> block_info_; 619 GrowableArray<BlockInfo*> block_info_;
616 GrowableArray<CompilerDeoptInfo*> deopt_infos_; 620 GrowableArray<CompilerDeoptInfo*> deopt_infos_;
617 GrowableArray<SlowPathCode*> slow_path_code_; 621 GrowableArray<SlowPathCode*> slow_path_code_;
618 // Stores: [code offset, function, null(code)]. 622 // Stores: [code offset, function, null(code)].
619 const GrowableObjectArray& static_calls_target_table_; 623 const GrowableObjectArray& static_calls_target_table_;
620 const bool is_optimizing_; 624 const bool is_optimizing_;
621 // Set to true if optimized code has IC calls. 625 // Set to true if optimized code has IC calls.
622 bool may_reoptimize_; 626 bool may_reoptimize_;
627 // True while emitting intrinsic code.
628 bool intrinsic_mode_;
629 Label intrinsic_deopt_label_;
623 630
624 const Class& double_class_; 631 const Class& double_class_;
625 const Class& mint_class_; 632 const Class& mint_class_;
626 const Class& float32x4_class_; 633 const Class& float32x4_class_;
627 const Class& float64x2_class_; 634 const Class& float64x2_class_;
628 const Class& int32x4_class_; 635 const Class& int32x4_class_;
629 const Class& list_class_; 636 const Class& list_class_;
630 637
631 ParallelMoveResolver parallel_move_resolver_; 638 ParallelMoveResolver parallel_move_resolver_;
632 639
633 // Currently instructions generate deopt stubs internally by 640 // Currently instructions generate deopt stubs internally by
634 // calling AddDeoptStub. To communicate deoptimization environment 641 // calling AddDeoptStub. To communicate deoptimization environment
635 // that should be used when deoptimizing we store it in this variable. 642 // that should be used when deoptimizing we store it in this variable.
636 // In future AddDeoptStub should be moved out of the instruction template. 643 // In future AddDeoptStub should be moved out of the instruction template.
637 Environment* pending_deoptimization_env_; 644 Environment* pending_deoptimization_env_;
638 645
639 intptr_t entry_patch_pc_offset_; 646 intptr_t entry_patch_pc_offset_;
640 intptr_t patch_code_pc_offset_; 647 intptr_t patch_code_pc_offset_;
641 intptr_t lazy_deopt_pc_offset_; 648 intptr_t lazy_deopt_pc_offset_;
642 649
643 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_; 650 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_;
644 651
645 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); 652 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler);
646 }; 653 };
647 654
648 } // namespace dart 655 } // namespace dart
649 656
650 #endif // VM_FLOW_GRAPH_COMPILER_H_ 657 #endif // VM_FLOW_GRAPH_COMPILER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698