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

Unified Diff: src/compiler/typer.cc

Issue 1898653003: [turbofan] Optimize typeof in abstract/strict equality comparison. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/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 2ac137641d54cab8605cb1ef47b713c46acc4257..946c6064a0979dbacb89b8f663eb140a969ba30a 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -247,6 +247,7 @@ class Typer::Visitor : public Reducer {
static Type* NumberToInt32(Type*, Typer*);
static Type* NumberToUint32(Type*, Typer*);
+ static Type* ObjectIsCallable(Type*, Typer*);
static Type* ObjectIsNumber(Type*, Typer*);
static Type* ObjectIsReceiver(Type*, Typer*);
static Type* ObjectIsSmi(Type*, Typer*);
@@ -557,6 +558,11 @@ Type* Typer::Visitor::NumberToUint32(Type* type, Typer* t) {
// Type checks.
+Type* Typer::Visitor::ObjectIsCallable(Type* type, Typer* t) {
+ if (type->Is(Type::Function())) return t->singleton_true_;
+ if (type->Is(Type::Primitive())) return t->singleton_false_;
+ return Type::Boolean();
+}
Type* Typer::Visitor::ObjectIsNumber(Type* type, Typer* t) {
if (type->Is(Type::Number())) return t->singleton_true_;
@@ -1988,6 +1994,9 @@ Type* Typer::Visitor::TypeStoreElement(Node* node) {
return nullptr;
}
+Type* Typer::Visitor::TypeObjectIsCallable(Node* node) {
+ return TypeUnaryOp(node, ObjectIsCallable);
+}
Type* Typer::Visitor::TypeObjectIsNumber(Node* node) {
return TypeUnaryOp(node, ObjectIsNumber);
« 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