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_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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 void GenerateStringTypeCheck(Register kClassIdReg, | 380 void GenerateStringTypeCheck(Register kClassIdReg, |
381 Label* is_instance_lbl, | 381 Label* is_instance_lbl, |
382 Label* is_not_instance_lbl); | 382 Label* is_not_instance_lbl); |
383 void GenerateListTypeCheck(Register kClassIdReg, | 383 void GenerateListTypeCheck(Register kClassIdReg, |
384 Label* is_instance_lbl); | 384 Label* is_instance_lbl); |
385 | 385 |
386 void EmitComment(Instruction* instr); | 386 void EmitComment(Instruction* instr); |
387 | 387 |
388 bool NeedsEdgeCounter(TargetEntryInstr* block); | 388 bool NeedsEdgeCounter(TargetEntryInstr* block); |
389 | 389 |
390 void EmitEdgeCounter(); | 390 void EmitEdgeCounter(intptr_t edge_id); |
391 | |
392 #if !defined(TARGET_ARCH_ARM64) && !defined(TARGET_ARCH_MIPS) | |
393 static int32_t EdgeCounterIncrementSizeInBytes(); | |
394 #endif // !TARGET_ARCH_ARM64 && !TARGET_ARCH_MIPS | |
395 | 391 |
396 void EmitOptimizedInstanceCall(const StubEntry& stub_entry, | 392 void EmitOptimizedInstanceCall(const StubEntry& stub_entry, |
397 const ICData& ic_data, | 393 const ICData& ic_data, |
398 intptr_t argument_count, | 394 intptr_t argument_count, |
399 intptr_t deopt_id, | 395 intptr_t deopt_id, |
400 intptr_t token_pos, | 396 intptr_t token_pos, |
401 LocationSummary* locs); | 397 LocationSummary* locs); |
402 | 398 |
403 void EmitInstanceCall(const StubEntry& stub_entry, | 399 void EmitInstanceCall(const StubEntry& stub_entry, |
404 const ICData& ic_data, | 400 const ICData& ic_data, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 | 526 |
531 Isolate* isolate() const { return isolate_; } | 527 Isolate* isolate() const { return isolate_; } |
532 Zone* zone() const { return zone_; } | 528 Zone* zone() const { return zone_; } |
533 | 529 |
534 void AddStubCallTarget(const Code& code); | 530 void AddStubCallTarget(const Code& code); |
535 | 531 |
536 const Array& inlined_code_intervals() const { | 532 const Array& inlined_code_intervals() const { |
537 return inlined_code_intervals_; | 533 return inlined_code_intervals_; |
538 } | 534 } |
539 | 535 |
| 536 RawArray* edge_counters_array() const { |
| 537 return edge_counters_array_.raw(); |
| 538 } |
| 539 |
540 RawArray* InliningIdToFunction() const; | 540 RawArray* InliningIdToFunction() const; |
541 | 541 |
542 RawArray* CallerInliningIdMap() const; | 542 RawArray* CallerInliningIdMap() const; |
543 | 543 |
544 private: | 544 private: |
545 friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_. | 545 friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_. |
546 | 546 |
547 void EmitFrameEntry(); | 547 void EmitFrameEntry(); |
548 | 548 |
549 void AddStaticCallTarget(const Function& function); | 549 void AddStaticCallTarget(const Function& function); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 // Currently instructions generate deopt stubs internally by | 724 // Currently instructions generate deopt stubs internally by |
725 // calling AddDeoptStub. To communicate deoptimization environment | 725 // calling AddDeoptStub. To communicate deoptimization environment |
726 // that should be used when deoptimizing we store it in this variable. | 726 // that should be used when deoptimizing we store it in this variable. |
727 // In future AddDeoptStub should be moved out of the instruction template. | 727 // In future AddDeoptStub should be moved out of the instruction template. |
728 Environment* pending_deoptimization_env_; | 728 Environment* pending_deoptimization_env_; |
729 | 729 |
730 intptr_t lazy_deopt_pc_offset_; | 730 intptr_t lazy_deopt_pc_offset_; |
731 | 731 |
732 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_; | 732 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_; |
733 | 733 |
| 734 Array& edge_counters_array_; |
| 735 |
734 Array& inlined_code_intervals_; | 736 Array& inlined_code_intervals_; |
735 const GrowableArray<const Function*>& inline_id_to_function_; | 737 const GrowableArray<const Function*>& inline_id_to_function_; |
736 const GrowableArray<intptr_t>& caller_inline_id_; | 738 const GrowableArray<intptr_t>& caller_inline_id_; |
737 | 739 |
738 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 740 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
739 }; | 741 }; |
740 | 742 |
741 } // namespace dart | 743 } // namespace dart |
742 | 744 |
743 #endif // VM_FLOW_GRAPH_COMPILER_H_ | 745 #endif // VM_FLOW_GRAPH_COMPILER_H_ |
OLD | NEW |