Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index 05338259675cff5f9976f3fa0f5147896248892c..84dde45e0f7314d39fcd26bc63837f26d1f66105 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -106,6 +106,7 @@ class LChunkBuilder; |
| // HGlobalObject |
| // HGlobalReceiver |
| // HLeaveInlined |
| +// HLoadContextSlot |
| // HLoadGlobal |
| // HMaterializedLiteral |
| // HArrayLiteral |
| @@ -215,6 +216,7 @@ class LChunkBuilder; |
| V(HasCachedArrayIndex) \ |
| V(ClassOfTest) \ |
| V(LeaveInlined) \ |
| + V(LoadContextSlot) \ |
| V(LoadElements) \ |
| V(LoadGlobal) \ |
| V(LoadKeyedFastElement) \ |
| @@ -2517,6 +2519,39 @@ class HStoreGlobal: public HUnaryOperation { |
| }; |
| +class HLoadContextSlot: public HInstruction { |
| + public: |
| + HLoadContextSlot(int context_chain_length , int slot_index) |
| + : context_chain_length_(context_chain_length), slot_index_(slot_index) { |
| + set_representation(Representation::Tagged()); |
| + SetFlag(kUseGVN); |
| + SetFlag(kDependsOnCalls); |
|
fschneider
2010/12/17 13:36:22
The flags are ok now since we don't compile stores
antonm
2010/12/17 14:52:23
Thanks a lot for pointing this out.
|
| + } |
| + |
| + int context_chain_length() const { return context_chain_length_; } |
| + int slot_index() const { return slot_index_; } |
| + |
| + virtual void PrintDataTo(StringStream* stream) const; |
| + |
| + virtual intptr_t Hashcode() const { |
| + return context_chain_length() * 29 + slot_index(); |
| + } |
| + |
| + DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot") |
| + |
| + protected: |
| + virtual bool DataEquals(HValue* other) const { |
| + HLoadContextSlot* b = HLoadContextSlot::cast(other); |
| + return (context_chain_length() == b->context_chain_length()) |
| + && (slot_index() == b->slot_index()); |
| + } |
| + |
| + private: |
| + int context_chain_length_; |
| + int slot_index_; |
| +}; |
| + |
| + |
| class HLoadNamedField: public HUnaryOperation { |
| public: |
| HLoadNamedField(HValue* object, bool is_in_object, int offset) |