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

Unified Diff: src/compiler/operation-typer.cc

Issue 2814013003: [turbofan] Properly represent the float64 hole. (Closed)
Patch Set: Make sure the_hole has the correct hole NaN bit pattern on Win32. Created 3 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
Index: src/compiler/operation-typer.cc
diff --git a/src/compiler/operation-typer.cc b/src/compiler/operation-typer.cc
index 4576c8840d18ab15307d659ec3383e9dfa246ecb..a3948d73abee7fe38481bc9452a215ce91259bb7 100644
--- a/src/compiler/operation-typer.cc
+++ b/src/compiler/operation-typer.cc
@@ -1026,6 +1026,19 @@ Type* OperationTyper::FalsifyUndefined(ComparisonOutcome outcome) {
return singleton_true();
}
+Type* OperationTyper::CheckFloat64Hole(Type* type) {
+ if (type->Maybe(Type::Hole())) {
+ // Turn "the hole" into undefined.
+ type = Type::Intersect(type, Type::Number(), zone());
+ type = Type::Union(type, Type::Undefined(), zone());
+ }
+ return type;
+}
+
+Type* OperationTyper::CheckNumber(Type* type) {
+ return Type::Intersect(type, Type::Number(), zone());
+}
+
Type* OperationTyper::TypeTypeGuard(const Operator* sigma_op, Type* input) {
return Type::Intersect(input, TypeGuardTypeOf(sigma_op), zone());
}

Powered by Google App Engine
This is Rietveld 408576698