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

Unified Diff: test/cctest/compiler/test-js-typed-lowering.cc

Issue 523633002: Fix typed lowering of JSUnaryNot to work with graph reducer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased and comments fixed. Created 6 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
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-js-typed-lowering.cc
diff --git a/test/cctest/compiler/test-js-typed-lowering.cc b/test/cctest/compiler/test-js-typed-lowering.cc
index 6e9cb30933b82be10551c2fe409b92a5de2a9a61..0bee87ac83e729d9cf0928291667f8b010f377f6 100644
--- a/test/cctest/compiler/test-js-typed-lowering.cc
+++ b/test/cctest/compiler/test-js-typed-lowering.cc
@@ -755,9 +755,18 @@ TEST(UnaryNot) {
Operator* opnot = R.javascript.UnaryNot();
for (size_t i = 0; i < arraysize(kJSTypes); i++) {
- Node* r = R.ReduceUnop(opnot, kJSTypes[i]);
+ Node* orig = R.Unop(opnot, R.Parameter(kJSTypes[i]));
+ Node* use = R.graph.NewNode(R.common.Return(), orig);
+ Node* r = R.reduce(orig);
// TODO(titzer): test will break if/when js-typed-lowering constant folds.
- CHECK_EQ(IrOpcode::kBooleanNot, r->opcode());
+ CHECK_EQ(IrOpcode::kBooleanNot, use->InputAt(0)->opcode());
+
+ if (r == orig && orig->opcode() == IrOpcode::kJSToBoolean) {
+ // The original node was turned into a ToBoolean.
+ CHECK_EQ(IrOpcode::kJSToBoolean, r->opcode());
+ } else {
+ CHECK_EQ(IrOpcode::kBooleanNot, r->opcode());
+ }
}
}
@@ -1184,16 +1193,16 @@ TEST(UnaryNotEffects) {
Node* value_use = R.graph.NewNode(R.common.Return(), orig);
Node* r = R.reduce(orig);
// TODO(titzer): test will break if/when js-typed-lowering constant folds.
- CHECK_EQ(IrOpcode::kBooleanNot, r->opcode());
-
- CHECK_EQ(r, value_use->InputAt(0));
+ CHECK_EQ(IrOpcode::kBooleanNot, value_use->InputAt(0)->opcode());
- if (r->InputAt(0) == orig && orig->opcode() == IrOpcode::kJSToBoolean) {
+ if (r == orig && orig->opcode() == IrOpcode::kJSToBoolean) {
// The original node was turned into a ToBoolean, which has an effect.
+ CHECK_EQ(IrOpcode::kJSToBoolean, r->opcode());
R.CheckEffectInput(R.start(), orig);
R.CheckEffectInput(orig, effect_use);
} else {
// effect should have been removed from this node.
+ CHECK_EQ(IrOpcode::kBooleanNot, r->opcode());
R.CheckEffectInput(R.start(), effect_use);
}
}
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698