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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10831179: Allocate the environment's location backing store during register allocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 9eb0767f1938faba685537f430b2724d10b9900e..9159873c91bb61130262e4de1693ff7491a7ee8a 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -2678,13 +2678,10 @@ class BranchInstr : public InstructionWithInputs {
class Environment : public ZoneAllocated {
public:
// Construct an environment by copying from an array of values.
- // TODO(vegorov): it's absolutely crucial that locations_ backing store
- // is preallocated and never reallocated. We use pointers into it
- // during register allocation.
explicit Environment(const GrowableArray<Value*>& values,
intptr_t fixed_parameter_count)
: values_(values.length()),
- locations_(values.length()),
+ locations_(NULL),
fixed_parameter_count_(fixed_parameter_count) {
values_.AddArray(values);
}
@@ -2693,8 +2690,9 @@ class Environment : public ZoneAllocated {
return values_;
}
- void AddLocation(Location value) {
- locations_.Add(value);
+ void InitializeLocations() {
+ locations_ =
+ Isolate::Current()->current_zone()->Alloc<Location>(values_.length());
}
Location LocationAt(intptr_t ix) const {
@@ -2702,7 +2700,7 @@ class Environment : public ZoneAllocated {
}
Location* LocationSlotAt(intptr_t ix) const {
- return & locations_[ix];
+ return &locations_[ix];
}
intptr_t fixed_parameter_count() const {
@@ -2713,7 +2711,7 @@ class Environment : public ZoneAllocated {
private:
GrowableArray<Value*> values_;
- GrowableArray<Location> locations_;
+ Location* locations_;
const intptr_t fixed_parameter_count_;
DISALLOW_COPY_AND_ASSIGN(Environment);
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698