Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index 34316319aa3ebc61db008d7e663e27b2461fe0ed..ea9db6c158d76d2ee723082f31b92ef35051e344 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -106,6 +106,7 @@ class LChunkBuilder; |
| // HGlobalObject |
| // HGlobalReceiver |
| // HLeaveInlined |
| +// HLoadContextSlot |
| // HLoadGlobal |
| // HMaterializedLiteral |
| // HArrayLiteral |
| @@ -213,6 +214,7 @@ class LChunkBuilder; |
| V(HasCachedArrayIndex) \ |
| V(ClassOfTest) \ |
| V(LeaveInlined) \ |
| + V(LoadContextSlot) \ |
| V(LoadElements) \ |
| V(LoadGlobal) \ |
| V(LoadKeyedFastElement) \ |
| @@ -2503,6 +2505,42 @@ class HStoreGlobal: public HUnaryOperation { |
| }; |
| +class HLoadContextSlot: public HInstruction { |
| + public: |
| + HLoadContextSlot(Handle<Context> context, int index) |
| + : context_(context), index_(index) { |
| + set_representation(Representation::Tagged()); |
| + SetFlag(kUseGVN); |
| + SetFlag(kDependsOnCalls); |
| + } |
| + |
| + Handle<Context> context() const { return context_; } |
| + int index() const { return index_; } |
| + |
| + virtual Representation RequiredInputRepresentation(int index) const { |
|
fschneider
2010/12/13 19:00:18
Since HLoadContextSlot does not have any input ope
antonm
2010/12/13 22:41:04
Done
|
| + return Representation::Tagged(); |
| + } |
| + virtual void PrintDataTo(StringStream* stream) const; |
| + |
| + virtual intptr_t Hashcode() const { |
| + ASSERT(!Heap::allow_allocation(false)); |
| + return reinterpret_cast<intptr_t>(*context_) * 7 + index_; |
| + } |
| + |
| + DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load_context_slot") |
| + |
| + protected: |
| + virtual bool DataEquals(HValue* other) const { |
| + HLoadContextSlot* b = HLoadContextSlot::cast(other); |
| + return context_.is_identical_to(b->context()) && index_ == b->index(); |
| + } |
| + |
| + private: |
| + Handle<Context> context_; |
| + int index_; |
| +}; |
| + |
| + |
| class HLoadNamedField: public HUnaryOperation { |
| public: |
| HLoadNamedField(HValue* object, bool is_in_object, int offset) |