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

Unified Diff: runtime/vm/locations.cc

Issue 296003013: - Reduce the number of Isolate::Current() calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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.cc
===================================================================
--- runtime/vm/locations.cc (revision 36483)
+++ runtime/vm/locations.cc (working copy)
@@ -23,12 +23,13 @@
}
-LocationSummary::LocationSummary(intptr_t input_count,
+LocationSummary::LocationSummary(Isolate* isolate,
+ intptr_t input_count,
intptr_t temp_count,
LocationSummary::ContainsCall contains_call)
- : input_locations_(input_count),
- temp_locations_(temp_count),
- output_locations_(1),
+ : input_locations_(isolate, input_count),
+ temp_locations_(isolate, temp_count),
+ output_locations_(isolate, 1),
stack_bitmap_(NULL),
contains_call_(contains_call),
live_registers_() {
@@ -40,19 +41,17 @@
}
output_locations_.Add(Location());
ASSERT(output_locations_.length() == 1);
- if (contains_call_ != kNoCall) {
- stack_bitmap_ = new BitmapBuilder();
- }
}
-LocationSummary::LocationSummary(intptr_t input_count,
- intptr_t temp_count,
- intptr_t output_count,
- LocationSummary::ContainsCall contains_call)
- : input_locations_(input_count),
- temp_locations_(temp_count),
- output_locations_(output_count),
+LocationSummary::LocationSummary(Isolate* isolate,
+ intptr_t input_count,
+ intptr_t temp_count,
+ intptr_t output_count,
+ LocationSummary::ContainsCall contains_call)
+ : input_locations_(isolate, input_count),
+ temp_locations_(isolate, temp_count),
+ output_locations_(isolate, output_count),
stack_bitmap_(NULL),
contains_call_(contains_call),
live_registers_() {
@@ -68,9 +67,6 @@
for (intptr_t i = 0; i < output_count; i++) {
output_locations_.Add(Location());
}
- if (contains_call_ != kNoCall) {
- stack_bitmap_ = new BitmapBuilder();
- }
}
@@ -78,7 +74,8 @@
intptr_t input_count,
Location out,
LocationSummary::ContainsCall contains_call) {
- LocationSummary* summary = new LocationSummary(input_count, 0, contains_call);
+ LocationSummary* summary = new LocationSummary(
+ Isolate::Current(), input_count, 0, contains_call);
for (intptr_t i = 0; i < input_count; i++) {
summary->set_in(i, Location::RequiresRegister());
}

Powered by Google App Engine
This is Rietveld 408576698