| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index 62c98153894c9103b51754b82d67a9a6775067ec..6642f76713315c0355cacc58e2e2851fabf30444 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -794,6 +794,7 @@ class HValue: public ZoneObject {
|
| kDeoptimizeOnUndefined,
|
| kIsArguments,
|
| kTruncatingToInt32,
|
| + // Set after an instruction is killed.
|
| kIsDead,
|
| // Instructions that are allowed to produce full range unsigned integer
|
| // values are marked with kUint32 flag. If arithmetic shift or a load from
|
| @@ -809,6 +810,8 @@ class HValue: public ZoneObject {
|
| // has processed this instruction.
|
| kIDefsProcessingDone,
|
| kHasNoObservableSideEffects,
|
| + // Indicates the instruction is live during dead code elimination.
|
| + kIsLive,
|
| kLastFlag = kIDefsProcessingDone
|
| };
|
|
|
| @@ -1071,8 +1074,9 @@ class HValue: public ZoneObject {
|
| UNREACHABLE();
|
| }
|
|
|
| - bool IsDead() const {
|
| - return HasNoUses() && !HasObservableSideEffects() && IsDeletable();
|
| + // Check if this instruction has some reason that prevents elimination.
|
| + bool CannotBeEliminated() const {
|
| + return HasObservableSideEffects() || !IsDeletable();
|
| }
|
|
|
| #ifdef DEBUG
|
| @@ -2969,7 +2973,6 @@ class HPhi: public HValue {
|
| : inputs_(2, zone),
|
| merged_index_(merged_index),
|
| phi_id_(-1),
|
| - is_live_(false),
|
| is_convertible_to_integer_(true) {
|
| for (int i = 0; i < Representation::kNumRepresentations; i++) {
|
| non_phi_uses_[i] = 0;
|
| @@ -2994,7 +2997,7 @@ class HPhi: public HValue {
|
| void AddInput(HValue* value);
|
| bool HasRealUses();
|
|
|
| - bool IsReceiver() { return merged_index_ == 0; }
|
| + bool IsReceiver() const { return merged_index_ == 0; }
|
|
|
| int merged_index() const { return merged_index_; }
|
|
|
| @@ -3029,8 +3032,6 @@ class HPhi: public HValue {
|
| return indirect_uses_[Representation::kDouble];
|
| }
|
| int phi_id() { return phi_id_; }
|
| - bool is_live() { return is_live_; }
|
| - void set_is_live(bool b) { is_live_ = b; }
|
|
|
| static HPhi* cast(HValue* value) {
|
| ASSERT(value->IsPhi());
|
| @@ -3062,6 +3063,9 @@ class HPhi: public HValue {
|
|
|
| void SimplifyConstantInputs();
|
|
|
| + // TODO(titzer): we can't eliminate the receiver for generating backtraces
|
| + virtual bool IsDeletable() const { return !IsReceiver(); }
|
| +
|
| protected:
|
| virtual void DeleteFromGraph();
|
| virtual void InternalSetOperandAt(int index, HValue* value) {
|
| @@ -3080,7 +3084,6 @@ class HPhi: public HValue {
|
| int non_phi_uses_[Representation::kNumRepresentations];
|
| int indirect_uses_[Representation::kNumRepresentations];
|
| int phi_id_;
|
| - bool is_live_;
|
| bool is_convertible_to_integer_;
|
| };
|
|
|
|
|