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

Side by Side Diff: src/compiler/typer.cc

Issue 2934893002: [builtins] Properly optimize Object.prototype.isPrototypeOf. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/typer.h" 5 #include "src/compiler/typer.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/flags.h" 9 #include "src/base/flags.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 } 1267 }
1268 1268
1269 Type* Typer::Visitor::TypeJSDeleteProperty(Node* node) { 1269 Type* Typer::Visitor::TypeJSDeleteProperty(Node* node) {
1270 return Type::Boolean(); 1270 return Type::Boolean();
1271 } 1271 }
1272 1272
1273 Type* Typer::Visitor::TypeJSHasProperty(Node* node) { return Type::Boolean(); } 1273 Type* Typer::Visitor::TypeJSHasProperty(Node* node) { return Type::Boolean(); }
1274 1274
1275 // JS instanceof operator. 1275 // JS instanceof operator.
1276 1276
1277 Type* Typer::Visitor::JSHasInPrototypeChainTyper(Type* lhs, Type* rhs,
1278 Typer* t) {
1279 return Type::Boolean();
1280 }
1281
1277 Type* Typer::Visitor::JSInstanceOfTyper(Type* lhs, Type* rhs, Typer* t) { 1282 Type* Typer::Visitor::JSInstanceOfTyper(Type* lhs, Type* rhs, Typer* t) {
1278 return Type::Boolean(); 1283 return Type::Boolean();
1279 } 1284 }
1280 1285
1281 Type* Typer::Visitor::JSOrdinaryHasInstanceTyper(Type* lhs, Type* rhs, 1286 Type* Typer::Visitor::JSOrdinaryHasInstanceTyper(Type* lhs, Type* rhs,
1282 Typer* t) { 1287 Typer* t) {
1283 return Type::Boolean(); 1288 return Type::Boolean();
1284 } 1289 }
1285 1290
1286 Type* Typer::Visitor::TypeJSGetSuperConstructor(Node* node) { 1291 Type* Typer::Visitor::TypeJSGetSuperConstructor(Node* node) {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 return Type::Receiver(); 1513 return Type::Receiver();
1509 case kArrayUnshift: 1514 case kArrayUnshift:
1510 return t->cache_.kPositiveSafeInteger; 1515 return t->cache_.kPositiveSafeInteger;
1511 1516
1512 // Object functions. 1517 // Object functions.
1513 case kObjectAssign: 1518 case kObjectAssign:
1514 return Type::Receiver(); 1519 return Type::Receiver();
1515 case kObjectCreate: 1520 case kObjectCreate:
1516 return Type::OtherObject(); 1521 return Type::OtherObject();
1517 case kObjectHasOwnProperty: 1522 case kObjectHasOwnProperty:
1523 case kObjectIsPrototypeOf:
1518 return Type::Boolean(); 1524 return Type::Boolean();
1519 case kObjectToString: 1525 case kObjectToString:
1520 return Type::String(); 1526 return Type::String();
1521 1527
1522 // RegExp functions. 1528 // RegExp functions.
1523 case kRegExpCompile: 1529 case kRegExpCompile:
1524 return Type::OtherObject(); 1530 return Type::OtherObject();
1525 case kRegExpExec: 1531 case kRegExpExec:
1526 return Type::Union(Type::Array(), Type::Null(), t->zone()); 1532 return Type::Union(Type::Array(), Type::Null(), t->zone());
1527 case kRegExpTest: 1533 case kRegExpTest:
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { 2010 Type* Typer::Visitor::TypeConstant(Handle<Object> value) {
2005 if (Type::IsInteger(*value)) { 2011 if (Type::IsInteger(*value)) {
2006 return Type::Range(value->Number(), value->Number(), zone()); 2012 return Type::Range(value->Number(), value->Number(), zone());
2007 } 2013 }
2008 return Type::NewConstant(value, zone()); 2014 return Type::NewConstant(value, zone());
2009 } 2015 }
2010 2016
2011 } // namespace compiler 2017 } // namespace compiler
2012 } // namespace internal 2018 } // namespace internal
2013 } // namespace v8 2019 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698