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

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

Issue 1343383003: VM: Store edge counters in one per-function array. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: clean up comments, save space in IL Instruction class. Created 5 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
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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 entry_patch_pc_offset_; 730 intptr_t entry_patch_pc_offset_;
731 intptr_t patch_code_pc_offset_; 731 intptr_t patch_code_pc_offset_;
732 intptr_t lazy_deopt_pc_offset_; 732 intptr_t lazy_deopt_pc_offset_;
733 733
734 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_; 734 ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_;
735 735
736 Array& edge_counters_array_;
737
736 Array& inlined_code_intervals_; 738 Array& inlined_code_intervals_;
737 const GrowableArray<const Function*>& inline_id_to_function_; 739 const GrowableArray<const Function*>& inline_id_to_function_;
738 const GrowableArray<intptr_t>& caller_inline_id_; 740 const GrowableArray<intptr_t>& caller_inline_id_;
739 741
740 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); 742 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler);
741 }; 743 };
742 744
743 } // namespace dart 745 } // namespace dart
744 746
745 #endif // VM_FLOW_GRAPH_COMPILER_H_ 747 #endif // VM_FLOW_GRAPH_COMPILER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698