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

Unified Diff: src/compiler/typer.cc

Issue 2236443004: [turbofan] Introduce a dedicated ConvertTaggedHoleToUndefined operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix verify heap. Created 4 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/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 57643c3e1f9882591c09758e34e5643382a083ee..006029cd1a3b992d100c6c1645577a3112404fdf 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -1234,7 +1234,7 @@ Type* Typer::Visitor::WrapContextTypeForInput(Node* node) {
if (outer->Is(Type::None())) {
return Type::None();
} else {
- DCHECK(outer->Maybe(Type::Internal()));
+ DCHECK(outer->Maybe(Type::OtherInternal()));
return Type::Context(outer, zone());
}
}
@@ -1583,19 +1583,17 @@ Type* Typer::Visitor::TypeCheckFloat64Hole(Node* node) {
}
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::TypeConvertTaggedHoleToUndefined(Node* node) {
+ Type* type = Operand(node, 0);
+ if (type->Maybe(Type::Hole())) {
+ // Turn "the hole" into undefined.
+ type = Type::Intersect(type, Type::NonInternal(), zone());
+ type = Type::Union(type, Type::Undefined(), zone());
}
return type;
}
« 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