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

Unified Diff: src/compiler/typer.cc

Issue 2411703002: [turbofan] Optimize typeof operator without storing strings in Type (Closed)
Patch Set: 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 | « src/compiler/js-typed-lowering.cc ('k') | 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 0d2bde2db809ef416b9f092d24e2b5fefbbbb1c2..fe6507fb162e07cb8ed71dfcf01ad2275037a6ae 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -290,7 +290,6 @@ class Typer::Visitor : public Reducer {
JS_SIMPLE_BINOP_LIST(DECLARE_METHOD)
#undef DECLARE_METHOD
- static Type* JSTypeOfTyper(Type*, Typer*);
static Type* JSCallFunctionTyper(Type*, Typer*);
static Type* ReferenceEqualTyper(Type*, Type*, Typer*);
@@ -1013,36 +1012,8 @@ Type* Typer::Visitor::JSModulusTyper(Type* lhs, Type* rhs, Typer* t) {
// JS unary operators.
-Type* Typer::Visitor::JSTypeOfTyper(Type* type, Typer* t) {
- Factory* const f = t->isolate()->factory();
- if (type->Is(Type::Boolean())) {
- return Type::HeapConstant(f->boolean_string(), t->zone());
- } else if (type->Is(Type::Number())) {
- return Type::HeapConstant(f->number_string(), t->zone());
- } else if (type->Is(Type::String())) {
- return Type::HeapConstant(f->string_string(), t->zone());
- } else if (type->Is(Type::Symbol())) {
- return Type::HeapConstant(f->symbol_string(), t->zone());
- } else if (type->Is(Type::Union(Type::Undefined(), Type::OtherUndetectable(),
- t->zone()))) {
- return Type::HeapConstant(f->undefined_string(), t->zone());
- } else if (type->Is(Type::Null())) {
- return Type::HeapConstant(f->object_string(), t->zone());
- } else if (type->Is(Type::Function())) {
- return Type::HeapConstant(f->function_string(), t->zone());
- } else if (type->IsHeapConstant()) {
- return Type::HeapConstant(
- Object::TypeOf(t->isolate(), type->AsHeapConstant()->Value()),
- t->zone());
- } else if (type->IsOtherNumberConstant()) {
- return Type::HeapConstant(f->number_string(), t->zone());
- }
- return Type::InternalizedString();
-}
-
-
Type* Typer::Visitor::TypeJSTypeOf(Node* node) {
- return TypeUnaryOp(node, JSTypeOfTyper);
+ return Type::InternalizedString();
}
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698