| 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);
|
|
|