Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 307ed80415b324c476a0b1fc31806ac488db2b8a..29dbf8304fc2abeaa9a268c8b09b3feb8e280c92 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -3390,6 +3390,13 @@ class HConstant: public HTemplateInstruction<0> { |
unique_id_ == other; |
} |
+ bool SameConstantObject(HConstant* other) { |
Michael Starzinger
2013/08/16 15:02:20
nit: Let's rename this to just "SameConstant", it
Jakob Kummerow
2013/08/20 08:46:56
This seems to cover a subset of the functionality
danno
2013/10/01 10:43:18
Actually, I use DataEquals now. Makes it even simp
|
+ if (HasSmiValue() && other->HasSmiValue()) { |
Michael Starzinger
2013/08/16 15:02:20
Shouldn't this be HasInteger32Value in these check
danno
2013/10/01 10:43:18
See above.
|
+ return int32_value_ == other->int32_value_; |
+ } |
+ return UniqueValueIdsMatch(other->unique_id_); |
+ } |
+ |
#ifdef DEBUG |
virtual void Verify() { } |
#endif |
@@ -4011,6 +4018,12 @@ class HCompareObjectEqAndBranch: public HTemplateControlInstruction<2, 2> { |
// control flow instructions. |
HCompareObjectEqAndBranch(HValue* left, |
HValue* right) { |
+ ASSERT(!left->IsConstant() || |
+ (!HConstant::cast(left)->HasInteger32Value() || |
+ HConstant::cast(left)->HasSmiValue())); |
+ ASSERT(!right->IsConstant() || |
+ (!HConstant::cast(right)->HasInteger32Value() || |
+ HConstant::cast(right)->HasSmiValue())); |
SetOperandAt(0, left); |
SetOperandAt(1, right); |
} |