| Index: runtime/vm/intermediate_language.h
|
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
|
| index 07491af2ef982fbef7f61269672084cc4676966c..8245b46edf4d2d5b1c37c44e6733f749cccde7cc 100644
|
| --- a/runtime/vm/intermediate_language.h
|
| +++ b/runtime/vm/intermediate_language.h
|
| @@ -2216,6 +2216,7 @@ class JoinEntryInstr : public BlockEntryInstr {
|
| virtual void PrepareEntry(FlowGraphCompiler* compiler);
|
|
|
| void InsertPhi(intptr_t var_index, intptr_t var_count);
|
| + void RemoveDeadPhis();
|
|
|
| intptr_t phi_count() const { return phi_count_; }
|
|
|
| @@ -2362,7 +2363,8 @@ class BindInstr : public Definition {
|
|
|
| class PhiInstr : public Definition {
|
| public:
|
| - explicit PhiInstr(intptr_t num_inputs) : inputs_(num_inputs) {
|
| + explicit PhiInstr(intptr_t num_inputs)
|
| + : inputs_(num_inputs), is_alive_(false) {
|
| for (intptr_t i = 0; i < num_inputs; ++i) {
|
| inputs_.Add(NULL);
|
| }
|
| @@ -2381,10 +2383,15 @@ class PhiInstr : public Definition {
|
|
|
| virtual bool CanDeoptimize() const { return false; }
|
|
|
| + // Phi is alive if it reaches a non-environment use.
|
| + bool is_alive() const { return is_alive_; }
|
| + void mark_alive() { is_alive_ = true; }
|
| +
|
| DECLARE_INSTRUCTION(Phi)
|
|
|
| private:
|
| GrowableArray<Value*> inputs_;
|
| + bool is_alive_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(PhiInstr);
|
| };
|
| @@ -2690,6 +2697,10 @@ class Environment : public ZoneAllocated {
|
| return values_;
|
| }
|
|
|
| + GrowableArray<Value*>* values_ptr() {
|
| + return &values_;
|
| + }
|
| +
|
| void InitializeLocations() {
|
| location_count_ = values_.length();
|
| if (location_count_ > 0) {
|
|
|