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

Unified Diff: src/compiler/typer.cc

Issue 2381523002: [Turbofan] Introduce OtherNumberConstant. (Closed)
Patch Set: More comments. Created 4 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 | src/compiler/types.h » ('j') | src/compiler/types.h » ('J')
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 e33b7764567881f149e760262b26a9a58f2b1f87..c8db81250208d170eb791c5716d6609c794b8db8 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -592,13 +592,9 @@ Type* Typer::Visitor::TypeFloat64Constant(Node* node) {
Type* Typer::Visitor::TypeNumberConstant(Node* node) {
Factory* f = isolate()->factory();
double number = OpParameter<double>(node);
- if (Type::IsInteger(number)) {
- return Type::Range(number, number, zone());
- }
- return Type::Constant(f->NewNumber(number), zone());
+ return Type::NewConstant(f->NewNumber(number), zone());
Jarin 2016/10/04 13:14:55 How about having a factory from a double value?
mvstanton 2016/10/05 13:51:10 Done.
Jarin 2016/10/05 14:06:53 How about using it, then?
mvstanton 2016/10/05 14:14:44 My apologies. This time I have used it.
}
-
Type* Typer::Visitor::TypeHeapConstant(Node* node) {
return TypeConstant(OpParameter<Handle<HeapObject>>(node));
}
@@ -1024,6 +1020,8 @@ Type* Typer::Visitor::JSTypeOfTyper(Type* type, Typer* t) {
} else if (type->IsConstant()) {
return Type::Constant(
Object::TypeOf(t->isolate(), type->AsConstant()->Value()), t->zone());
+ } else if (type->IsOtherNumberConstant()) {
+ return Type::Constant(f->number_string(), t->zone());
}
return Type::InternalizedString();
}
@@ -1717,7 +1715,7 @@ Type* Typer::Visitor::TypeConstant(Handle<Object> value) {
if (Type::IsInteger(*value)) {
return Type::Range(value->Number(), value->Number(), zone());
}
- return Type::Constant(value, zone());
+ return Type::NewConstant(value, zone());
}
} // namespace compiler
« no previous file with comments | « no previous file | src/compiler/types.h » ('j') | src/compiler/types.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698