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

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: Next round Created 9 years, 11 months 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
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 5cc8432c00689865d73bc879ce0c42c09969ee0d..4a23f2a327ef4d41e19481c84c6279ee779a1907 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -107,6 +107,7 @@ class LChunkBuilder;
// HGlobalObject
// HGlobalReceiver
// HLeaveInlined
+// HLoadContextSlot
// HLoadGlobal
// HMaterializedLiteral
// HArrayLiteral
@@ -220,6 +221,7 @@ class LChunkBuilder;
V(JSArrayLength) \
V(ClassOfTest) \
V(LeaveInlined) \
+ V(LoadContextSlot) \
V(LoadElements) \
V(LoadGlobal) \
V(LoadKeyedFastElement) \
@@ -2599,6 +2601,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);
+ }
+
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698