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

Unified Diff: src/compiler/verifier.cc

Issue 1884713003: [turbofan] Change number operations to handle Undefined as well. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove TODOs for realz now Created 4 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
« no previous file with comments | « src/compiler/typer.cc ('k') | test/unittests/compiler/change-lowering-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/verifier.cc
diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc
index 63f302a154704f54c006aa216e7d25a4b27d2e1e..c3eae25cbdee6f897e79b6bcb0478a2957732cfb 100644
--- a/src/compiler/verifier.cc
+++ b/src/compiler/verifier.cc
@@ -650,17 +650,27 @@ void Verifier::Visitor::Check(Node* node) {
CheckUpperIs(node, Type::Number());
break;
case IrOpcode::kNumberEqual:
+ // (NumberOrUndefined, NumberOrUndefined) -> Boolean
+ CheckValueInputIs(node, 0, Type::NumberOrUndefined());
+ CheckValueInputIs(node, 1, Type::NumberOrUndefined());
+ CheckUpperIs(node, Type::Boolean());
+ break;
case IrOpcode::kNumberLessThan:
case IrOpcode::kNumberLessThanOrEqual:
// (Number, Number) -> Boolean
- CheckValueInputIs(node, 0, Type::Number());
- CheckValueInputIs(node, 1, Type::Number());
+ CheckValueInputIs(node, 0, Type::NumberOrUndefined());
+ CheckValueInputIs(node, 1, Type::NumberOrUndefined());
CheckUpperIs(node, Type::Boolean());
break;
case IrOpcode::kNumberAdd:
case IrOpcode::kNumberSubtract:
case IrOpcode::kNumberMultiply:
case IrOpcode::kNumberDivide:
+ // (Number, Number) -> Number
+ CheckValueInputIs(node, 0, Type::NumberOrUndefined());
+ CheckValueInputIs(node, 1, Type::NumberOrUndefined());
+ // CheckUpperIs(node, Type::Number());
+ break;
case IrOpcode::kNumberModulus:
// (Number, Number) -> Number
CheckValueInputIs(node, 0, Type::Number());
@@ -704,12 +714,12 @@ void Verifier::Visitor::Check(Node* node) {
break;
case IrOpcode::kNumberToInt32:
// Number -> Signed32
- CheckValueInputIs(node, 0, Type::Number());
+ CheckValueInputIs(node, 0, Type::NumberOrUndefined());
CheckUpperIs(node, Type::Signed32());
break;
case IrOpcode::kNumberToUint32:
// Number -> Unsigned32
- CheckValueInputIs(node, 0, Type::Number());
+ CheckValueInputIs(node, 0, Type::NumberOrUndefined());
CheckUpperIs(node, Type::Unsigned32());
break;
case IrOpcode::kNumberIsHoleNaN:
« no previous file with comments | « src/compiler/typer.cc ('k') | test/unittests/compiler/change-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698