Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: src/hydrogen-instructions.h

Issue 5753005: Make closures optimizable by Crankshaft compiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor fix in hash function Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | test/mjsunit/closures.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698