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

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

Issue 601103004: Keep list of uses sorted when building it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_allocator.cc » ('j') | runtime/vm/flow_graph_allocator.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_ALLOCATOR_H_ 5 #ifndef VM_FLOW_GRAPH_ALLOCATOR_H_
6 #define VM_FLOW_GRAPH_ALLOCATOR_H_ 6 #define VM_FLOW_GRAPH_ALLOCATOR_H_
7 7
8 #include "vm/flow_graph.h" 8 #include "vm/flow_graph.h"
9 #include "vm/growable_array.h" 9 #include "vm/growable_array.h"
10 #include "vm/intermediate_language.h" 10 #include "vm/intermediate_language.h"
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 first_use_interval_(NULL), 551 first_use_interval_(NULL),
552 last_use_interval_(NULL), 552 last_use_interval_(NULL),
553 first_safepoint_(NULL), 553 first_safepoint_(NULL),
554 last_safepoint_(NULL), 554 last_safepoint_(NULL),
555 next_sibling_(NULL), 555 next_sibling_(NULL),
556 has_only_any_uses_in_loops_(0), 556 has_only_any_uses_in_loops_(0),
557 is_loop_phi_(false), 557 is_loop_phi_(false),
558 finger_() { 558 finger_() {
559 } 559 }
560 560
561 static LiveRange* MakeTemp(intptr_t pos, Location* location_slot);
562
563 intptr_t vreg() const { return vreg_; } 561 intptr_t vreg() const { return vreg_; }
564 Representation representation() const { return representation_; } 562 Representation representation() const { return representation_; }
565 LiveRange* next_sibling() const { return next_sibling_; } 563 LiveRange* next_sibling() const { return next_sibling_; }
566 UsePosition* first_use() const { return uses_; } 564 UsePosition* first_use() const { return uses_; }
567 void set_first_use(UsePosition* use) { uses_ = use; } 565 void set_first_use(UsePosition* use) { uses_ = use; }
568 UseInterval* first_use_interval() const { return first_use_interval_; } 566 UseInterval* first_use_interval() const { return first_use_interval_; }
569 UseInterval* last_use_interval() const { return last_use_interval_; } 567 UseInterval* last_use_interval() const { return last_use_interval_; }
570 Location assigned_location() const { return assigned_location_; } 568 Location assigned_location() const { return assigned_location_; }
571 Location* assigned_location_slot() { return &assigned_location_; } 569 Location* assigned_location_slot() { return &assigned_location_; }
572 intptr_t Start() const { return first_use_interval()->start(); } 570 intptr_t Start() const { return first_use_interval()->start(); }
573 intptr_t End() const { return last_use_interval()->end(); } 571 intptr_t End() const { return last_use_interval()->end(); }
574 572
575 SafepointPosition* first_safepoint() const { return first_safepoint_; } 573 SafepointPosition* first_safepoint() const { return first_safepoint_; }
576 574
577 AllocationFinger* finger() { return &finger_; } 575 AllocationFinger* finger() { return &finger_; }
578 576
579 void set_assigned_location(Location location) { 577 void set_assigned_location(Location location) {
580 assigned_location_ = location; 578 assigned_location_ = location;
581 } 579 }
582 580
583 void set_spill_slot(Location spill_slot) { 581 void set_spill_slot(Location spill_slot) {
584 spill_slot_ = spill_slot; 582 spill_slot_ = spill_slot;
585 } 583 }
586 584
587 void DefineAt(intptr_t pos); 585 void DefineAt(intptr_t pos);
588 586
589 void AddSafepoint(intptr_t pos, LocationSummary* locs); 587 void AddSafepoint(intptr_t pos, LocationSummary* locs);
590 588
591 void AddUse(intptr_t pos, Location* location_slot); 589 UsePosition* AddUse(intptr_t pos, Location* location_slot);
592 void AddHintedUse(intptr_t pos, Location* location_slot, Location* hint); 590 void AddHintedUse(intptr_t pos, Location* location_slot, Location* hint);
593 591
594 void AddUseInterval(intptr_t start, intptr_t end); 592 void AddUseInterval(intptr_t start, intptr_t end);
595 593
596 void Print(); 594 void Print();
597 595
598 void AssignLocation(UseInterval* use, Location loc);
599
600 LiveRange* SplitAt(intptr_t pos); 596 LiveRange* SplitAt(intptr_t pos);
601 597
602 // A fast conservative check if the range might contain a given position 598 // A fast conservative check if the range might contain a given position
603 // -- can return true when the range does not contain the position (e.g., 599 // -- can return true when the range does not contain the position (e.g.,
604 // the position lies in a lifetime hole between range start and end). 600 // the position lies in a lifetime hole between range start and end).
605 bool CanCover(intptr_t pos) const { 601 bool CanCover(intptr_t pos) const {
606 return (Start() <= pos) && (pos < End()); 602 return (Start() <= pos) && (pos < End());
607 } 603 }
608 604
609 // True if the range contains the given position. 605 // True if the range contains the given position.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 669
674 AllocationFinger finger_; 670 AllocationFinger finger_;
675 671
676 DISALLOW_COPY_AND_ASSIGN(LiveRange); 672 DISALLOW_COPY_AND_ASSIGN(LiveRange);
677 }; 673 };
678 674
679 675
680 } // namespace dart 676 } // namespace dart
681 677
682 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_ 678 #endif // VM_FLOW_GRAPH_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_allocator.cc » ('j') | runtime/vm/flow_graph_allocator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698