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

Unified Diff: src/hydrogen-instructions.h

Issue 11414201: Make HJSArrayLength more likely to have identical GVNs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 1 month 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 47a9da3b45deb917e7b4a5c213b4db57a3625d1d..d07c1d5135a60222b53a4c46339149c7ae24a696 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -1929,19 +1929,10 @@ class HCallRuntime: public HCall<1> {
class HJSArrayLength: public HTemplateInstruction<2> {
public:
- HJSArrayLength(HValue* value, HValue* typecheck,
- HType type = HType::Tagged()) {
- set_type(type);
- // The length of an array is stored as a tagged value in the array
- // object. It is guaranteed to be 32 bit integer, but it can be
- // represented as either a smi or heap number.
- SetOperandAt(0, value);
- SetOperandAt(1, typecheck);
- set_representation(Representation::Tagged());
- SetFlag(kUseGVN);
- SetGVNFlag(kDependsOnArrayLengths);
- SetGVNFlag(kDependsOnMaps);
- }
+ static HJSArrayLength* Create(HGraph* graph,
+ HValue* value,
+ HValue* typecheck,
+ HType type = HType::Tagged());
virtual Representation RequiredInputRepresentation(int index) {
return Representation::Tagged();
@@ -1949,6 +1940,7 @@ class HJSArrayLength: public HTemplateInstruction<2> {
virtual void PrintDataTo(StringStream* stream);
+ const HValue* value() const { return OperandAt(0); }
HValue* value() { return OperandAt(0); }
HValue* typecheck() { return OperandAt(1); }
@@ -1959,6 +1951,20 @@ class HJSArrayLength: public HTemplateInstruction<2> {
private:
virtual bool IsDeletable() const { return true; }
+
+ HJSArrayLength(HValue* value, HValue* typecheck,
+ HType type = HType::Tagged()) {
+ set_type(type);
+ // The length of an array is stored as a tagged value in the array
+ // object. It is guaranteed to be 32 bit integer, but it can be
+ // represented as either a smi or heap number.
+ SetOperandAt(0, value);
+ SetOperandAt(1, typecheck);
+ set_representation(Representation::Tagged());
+ SetFlag(kUseGVN);
+ SetGVNFlag(kDependsOnArrayLengths);
+ SetGVNFlag(kDependsOnMaps);
+ }
};
@@ -2261,6 +2267,7 @@ class HCheckMaps: public HTemplateInstruction<2> {
HValue* value() { return OperandAt(0); }
SmallMapList* map_set() { return &map_set_; }
+ bool has_dependency() { return OperandAt(1) != OperandAt(0); }
DECLARE_CONCRETE_INSTRUCTION(CheckMaps)
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698