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

Unified Diff: src/hydrogen-instructions.h

Issue 22876009: Improve and simplify removal of unreachable code (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix ia32 Created 7 years, 4 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698