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

Unified Diff: src/hydrogen-instructions.h

Issue 10103035: Share optimized code for closures. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: rebased on r11394 Created 8 years, 8 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
Index: src/hydrogen-instructions.h
===================================================================
--- src/hydrogen-instructions.h (revision 11394)
+++ src/hydrogen-instructions.h (working copy)
@@ -1460,7 +1460,7 @@
class HThisFunction: public HTemplateInstruction<0> {
public:
- explicit HThisFunction(Handle<JSFunction> closure) : closure_(closure) {
+ HThisFunction() {
set_representation(Representation::Tagged());
SetFlag(kUseGVN);
}
@@ -1469,18 +1469,10 @@
return Representation::None();
}
- Handle<JSFunction> closure() const { return closure_; }
-
DECLARE_CONCRETE_INSTRUCTION(ThisFunction)
protected:
- virtual bool DataEquals(HValue* other) {
- HThisFunction* b = HThisFunction::cast(other);
- return *closure() == *b->closure();
- }
-
- private:
- Handle<JSFunction> closure_;
+ virtual bool DataEquals(HValue* other) { return true; }
};
@@ -4569,10 +4561,12 @@
Handle<HeapObject> boilerplate_object,
int length,
int literal_index,
- int depth)
+ int depth,
+ Handle<FixedArray> constant_elements)
: HMaterializedLiteral<1>(literal_index, depth),
length_(length),
- boilerplate_object_(boilerplate_object) {
+ boilerplate_object_(boilerplate_object),
+ constant_elements_(constant_elements) {
SetOperandAt(0, context);
SetGVNFlag(kChangesNewSpacePromotion);
}
@@ -4585,6 +4579,7 @@
return Handle<JSObject>::cast(boilerplate_object_)->GetElementsKind();
}
Handle<HeapObject> boilerplate_object() const { return boilerplate_object_; }
+ Handle<FixedArray> constant_elements() const { return constant_elements_; }
int length() const { return length_; }
bool IsCopyOnWrite() const;
@@ -4599,6 +4594,7 @@
private:
int length_;
Handle<HeapObject> boilerplate_object_;
+ Handle<FixedArray> constant_elements_;
};

Powered by Google App Engine
This is Rietveld 408576698