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

Unified Diff: src/compiler/typer.cc

Issue 1412673003: [turbofan] Compute more precise type for ObjectIsSmi if possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Jaro's comment. Created 5 years, 2 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 | « no previous file | no next file » | 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 410a4f1162aefc2da84b651d06cdc2085ed8d6e1..76698a4f64ab90ef861063743f8d5bde329ed502 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -1657,7 +1657,13 @@ Type* Typer::Visitor::TypeStoreElement(Node* node) {
}
-Type* Typer::Visitor::TypeObjectIsSmi(Node* node) { return Type::Boolean(); }
+Type* Typer::Visitor::TypeObjectIsSmi(Node* node) {
+ Type* arg = Operand(node, 0);
+ if (arg->Is(Type::None())) return Type::None();
+ if (arg->Is(Type::TaggedSigned())) return typer_->singleton_true_;
+ if (arg->Is(Type::TaggedPointer())) return typer_->singleton_false_;
+ return Type::Boolean();
+}
// Machine operators.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698