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

Unified Diff: runtime/vm/locations.h

Issue 207063002: Refactor to support multiple outputs in location summary (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/locations.h
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h
index 89e6702abb27c3cf73b2e3923c40eb8926beea43..5032783f12d097cb3f90da694e30027f8ed28ca0 100644
--- a/runtime/vm/locations.h
+++ b/runtime/vm/locations.h
@@ -396,7 +396,8 @@ class LocationSummary : public ZoneAllocated {
LocationSummary(intptr_t input_count,
intptr_t temp_count,
- LocationSummary::ContainsCall contains_call);
+ LocationSummary::ContainsCall contains_call,
+ intptr_t output_count = 1);
srdjan 2014/03/20 23:04:23 The count is kind of our of order. Instead of the
Cutch 2014/03/21 14:36:46 Done.
intptr_t input_count() const {
return input_locations_.length();
@@ -437,17 +438,21 @@ class LocationSummary : public ZoneAllocated {
temp_locations_.Add(loc);
}
- Location out() const {
- return output_location_;
+ intptr_t output_count() const {
+ return output_locations_.length();
}
- Location* out_slot() {
- return &output_location_;
+ Location out(intptr_t index) const {
+ return output_locations_[index];
}
- void set_out(Location loc) {
+ Location* out_slot(intptr_t index) {
+ return &output_locations_[index];
+ }
+
+ void set_out(intptr_t index, Location loc) {
ASSERT(!always_calls() || (loc.IsMachineRegister() || loc.IsInvalid()));
- output_location_ = loc;
+ output_locations_[index] = loc;
}
BitmapBuilder* stack_bitmap() const { return stack_bitmap_; }
@@ -471,10 +476,10 @@ class LocationSummary : public ZoneAllocated {
}
private:
- // TODO(vegorov): replace with ZoneArray.
- GrowableArray<Location> input_locations_;
- GrowableArray<Location> temp_locations_;
- Location output_location_;
+ ZoneGrowableArray<Location> input_locations_;
Florian Schneider 2014/03/21 10:47:07 I wonder how often we actually want to add/remove
Cutch 2014/03/21 14:36:46 Good point but I would prefer to do that change in
+ ZoneGrowableArray<Location> temp_locations_;
+ ZoneGrowableArray<Location> output_locations_;
+
BitmapBuilder* stack_bitmap_;
const ContainsCall contains_call_;

Powered by Google App Engine
This is Rietveld 408576698