Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index c9a4bf062d3a7c3c6b4c79d36d4abe4959c6d8e2..b994a4501f3e6156c8e5d92cacba7991e50fc07a 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -3447,14 +3447,24 @@ class HStoreGlobalGeneric: public HTemplateInstruction<3> { |
| class HLoadContextSlot: public HUnaryOperation { |
| public: |
| + enum Check { |
| + kEmpty, |
| + kIsHoleCheck |
|
fschneider
2011/12/12 09:55:56
Please rebase your change. It seems to conflict wi
|
| + }; |
| + |
| HLoadContextSlot(HValue* context , int slot_index) |
| - : HUnaryOperation(context), slot_index_(slot_index) { |
| + : HUnaryOperation(context), slot_index_(slot_index), check_(kEmpty) { |
| set_representation(Representation::Tagged()); |
| SetFlag(kUseGVN); |
| SetFlag(kDependsOnContextSlots); |
| } |
| + void ForceIsHoleCheck() { |
| + check_ = kIsHoleCheck; |
| + } |
| + |
| int slot_index() const { return slot_index_; } |
| + bool RequiresHoleCheck() const { return check_ == kIsHoleCheck; } |
| virtual Representation RequiredInputRepresentation(int index) { |
| return Representation::Tagged(); |
| @@ -3472,21 +3482,32 @@ class HLoadContextSlot: public HUnaryOperation { |
| private: |
| int slot_index_; |
| + Check check_; |
| }; |
| class HStoreContextSlot: public HTemplateInstruction<2> { |
| public: |
| + enum Check { |
| + kEmpty, |
| + kIsHoleCheck |
| + }; |
| + |
| HStoreContextSlot(HValue* context, int slot_index, HValue* value) |
| - : slot_index_(slot_index) { |
| + : slot_index_(slot_index), check_(kEmpty) { |
| SetOperandAt(0, context); |
| SetOperandAt(1, value); |
| SetFlag(kChangesContextSlots); |
| } |
| + void ForceIsHoleCheck() { |
| + check_ = kIsHoleCheck; |
| + } |
| + |
| HValue* context() { return OperandAt(0); } |
| HValue* value() { return OperandAt(1); } |
| int slot_index() const { return slot_index_; } |
| + bool RequiresHoleCheck() const { return check_ == kIsHoleCheck; } |
| bool NeedsWriteBarrier() { |
| return StoringValueNeedsWriteBarrier(value()); |
| @@ -3502,6 +3523,7 @@ class HStoreContextSlot: public HTemplateInstruction<2> { |
| private: |
| int slot_index_; |
| + Check check_; |
| }; |