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 RUNTIME_VM_FLOW_GRAPH_COMPILER_H_ | 5 #ifndef RUNTIME_VM_FLOW_GRAPH_COMPILER_H_ |
6 #define RUNTIME_VM_FLOW_GRAPH_COMPILER_H_ | 6 #define RUNTIME_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 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 | 566 |
567 intptr_t CurrentTryIndex() const { | 567 intptr_t CurrentTryIndex() const { |
568 if (current_block_ == NULL) { | 568 if (current_block_ == NULL) { |
569 return CatchClauseNode::kInvalidTryIndex; | 569 return CatchClauseNode::kInvalidTryIndex; |
570 } | 570 } |
571 return current_block_->try_index(); | 571 return current_block_->try_index(); |
572 } | 572 } |
573 | 573 |
574 bool may_reoptimize() const { return may_reoptimize_; } | 574 bool may_reoptimize() const { return may_reoptimize_; } |
575 | 575 |
576 // Returns 'sorted' array in decreasing count order. | |
577 static void SortICDataByCount(const ICData& ic_data, | |
578 GrowableArray<CidRangeTarget>* sorted, | |
579 bool drop_smi); | |
580 | |
581 // Use in unoptimized compilation to preserve/reuse ICData. | 576 // Use in unoptimized compilation to preserve/reuse ICData. |
582 const ICData* GetOrAddInstanceCallICData(intptr_t deopt_id, | 577 const ICData* GetOrAddInstanceCallICData(intptr_t deopt_id, |
583 const String& target_name, | 578 const String& target_name, |
584 const Array& arguments_descriptor, | 579 const Array& arguments_descriptor, |
585 intptr_t num_args_tested); | 580 intptr_t num_args_tested); |
586 | 581 |
587 const ICData* GetOrAddStaticCallICData(intptr_t deopt_id, | 582 const ICData* GetOrAddStaticCallICData(intptr_t deopt_id, |
588 const Function& target, | 583 const Function& target, |
589 const Array& arguments_descriptor, | 584 const Array& arguments_descriptor, |
590 intptr_t num_args_tested); | 585 intptr_t num_args_tested); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 // More helpers for EmitTestAndCall. | 662 // More helpers for EmitTestAndCall. |
668 void EmitTestAndCallLoadReceiver(intptr_t argument_count, | 663 void EmitTestAndCallLoadReceiver(intptr_t argument_count, |
669 const Array& arguments_descriptor); | 664 const Array& arguments_descriptor); |
670 | 665 |
671 void EmitTestAndCallSmiBranch(Label* label, bool jump_if_smi); | 666 void EmitTestAndCallSmiBranch(Label* label, bool jump_if_smi); |
672 | 667 |
673 void EmitTestAndCallLoadCid(); | 668 void EmitTestAndCallLoadCid(); |
674 | 669 |
675 // Returns new class-id bias. | 670 // Returns new class-id bias. |
676 int EmitTestAndCallCheckCid(Label* next_label, | 671 int EmitTestAndCallCheckCid(Label* next_label, |
677 const CidRangeTarget& target, | 672 const CidRange& range, |
678 int bias); | 673 int bias); |
679 | 674 |
680 // DBC handles type tests differently from all other architectures due | 675 // DBC handles type tests differently from all other architectures due |
681 // to its interpreted nature. | 676 // to its interpreted nature. |
682 #if !defined(TARGET_ARCH_DBC) | 677 #if !defined(TARGET_ARCH_DBC) |
683 // Type checking helper methods. | 678 // Type checking helper methods. |
684 void CheckClassIds(Register class_id_reg, | 679 void CheckClassIds(Register class_id_reg, |
685 const GrowableArray<intptr_t>& class_ids, | 680 const GrowableArray<intptr_t>& class_ids, |
686 Label* is_instance_lbl, | 681 Label* is_instance_lbl, |
687 Label* is_not_instance_lbl); | 682 Label* is_not_instance_lbl); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_; | 841 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_; |
847 | 842 |
848 Array& edge_counters_array_; | 843 Array& edge_counters_array_; |
849 | 844 |
850 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 845 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
851 }; | 846 }; |
852 | 847 |
853 } // namespace dart | 848 } // namespace dart |
854 | 849 |
855 #endif // RUNTIME_VM_FLOW_GRAPH_COMPILER_H_ | 850 #endif // RUNTIME_VM_FLOW_GRAPH_COMPILER_H_ |
OLD | NEW |