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

Unified Diff: src/compiler/typer.cc

Issue 2066223002: [turbofan] Introduce CheckHole and CheckHoleNaN operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Blacklist test Created 4 years, 6 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/simplified-operator.cc ('k') | src/compiler/verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index c0d7ae664002304fc409eed80bdd8a77744648d0..165779bad5285375c97847c2b24bc91d7b439b01 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -248,7 +248,6 @@ class Typer::Visitor : public Reducer {
static Type* NumberTrunc(Type*, Typer*);
static Type* NumberToInt32(Type*, Typer*);
static Type* NumberToUint32(Type*, Typer*);
- static Type* NumberConvertHoleNaN(Type*, Typer*);
static Type* ObjectIsCallable(Type*, Typer*);
static Type* ObjectIsNumber(Type*, Typer*);
@@ -557,10 +556,6 @@ Type* Typer::Visitor::NumberToUint32(Type* type, Typer* t) {
return Type::Unsigned32();
}
-Type* Typer::Visitor::NumberConvertHoleNaN(Type* type, Typer* t) {
- return Type::Union(type, Type::Undefined(), t->zone());
-}
-
// Type checks.
Type* Typer::Visitor::ObjectIsCallable(Type* type, Typer* t) {
@@ -1818,14 +1813,6 @@ Type* Typer::Visitor::TypeNumberToUint32(Node* node) {
}
-Type* Typer::Visitor::TypeNumberIsHoleNaN(Node* node) {
- return Type::Boolean();
-}
-
-Type* Typer::Visitor::TypeNumberConvertHoleNaN(Node* node) {
- return TypeUnaryOp(node, NumberConvertHoleNaN);
-}
-
// static
Type* Typer::Visitor::ReferenceEqualTyper(Type* lhs, Type* rhs, Typer* t) {
if (lhs->IsConstant() && rhs->Is(lhs)) {
@@ -1974,6 +1961,29 @@ Type* Typer::Visitor::TypeCheckedTaggedToFloat64(Node* node) {
return Type::Number();
}
+Type* Typer::Visitor::TypeCheckFloat64Hole(Node* node) {
+ Type* type = Operand(node, 0);
+ return type;
+}
+
+Type* Typer::Visitor::TypeCheckTaggedHole(Node* node) {
+ CheckTaggedHoleMode mode = CheckTaggedHoleModeOf(node->op());
+ Type* type = Operand(node, 0);
+ type = Type::Intersect(type, Type::NonInternal(), zone());
+ switch (mode) {
+ case CheckTaggedHoleMode::kConvertHoleToUndefined: {
+ // The hole is turned into undefined.
+ type = Type::Union(type, Type::Undefined(), zone());
+ break;
+ }
+ case CheckTaggedHoleMode::kNeverReturnHole: {
+ // We deoptimize in case of the hole.
+ break;
+ }
+ }
+ return type;
+}
+
Type* Typer::Visitor::TypeCheckIf(Node* node) {
UNREACHABLE();
return nullptr;
« no previous file with comments | « src/compiler/simplified-operator.cc ('k') | src/compiler/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698