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

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

Issue 2529233002: [turbofan] Add more typing rules for Array.prototype builtins. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 case kArrayEntries: 1426 case kArrayEntries:
1427 case kArrayKeys: 1427 case kArrayKeys:
1428 case kArrayValues: 1428 case kArrayValues:
1429 case kTypedArrayEntries: 1429 case kTypedArrayEntries:
1430 case kTypedArrayKeys: 1430 case kTypedArrayKeys:
1431 case kTypedArrayValues: 1431 case kTypedArrayValues:
1432 case kArrayIteratorNext: 1432 case kArrayIteratorNext:
1433 return Type::OtherObject(); 1433 return Type::OtherObject();
1434 1434
1435 // Array functions. 1435 // Array functions.
1436 case kArrayConcat:
1437 return Type::Receiver();
1438 case kArrayEvery:
1439 return Type::Boolean();
1440 case kArrayFill:
1441 case kArrayFilter:
1442 return Type::Receiver();
1443 case kArrayFindIndex:
1444 return Type::Range(-1, kMaxSafeInteger, t->zone());
1445 case kArrayForEach:
1446 return Type::Undefined();
1447 case kArrayIncludes:
1448 return Type::Boolean();
1436 case kArrayIndexOf: 1449 case kArrayIndexOf:
1450 return Type::Range(-1, kMaxSafeInteger, t->zone());
1451 case kArrayJoin:
1452 return Type::String();
1437 case kArrayLastIndexOf: 1453 case kArrayLastIndexOf:
1438 return Type::Range(-1, kMaxSafeInteger, t->zone()); 1454 return Type::Range(-1, kMaxSafeInteger, t->zone());
1455 case kArrayMap:
1456 return Type::Receiver();
1439 case kArrayPush: 1457 case kArrayPush:
1440 return t->cache_.kPositiveSafeInteger; 1458 return t->cache_.kPositiveSafeInteger;
1459 case kArrayReverse:
1460 case kArraySlice:
1461 return Type::Receiver();
1462 case kArraySome:
1463 return Type::Boolean();
1464 case kArraySplice:
1465 return Type::Receiver();
1466 case kArrayUnshift:
1467 return t->cache_.kPositiveSafeInteger;
1441 1468
1442 // Object functions. 1469 // Object functions.
1443 case kObjectHasOwnProperty: 1470 case kObjectHasOwnProperty:
1444 return Type::Boolean(); 1471 return Type::Boolean();
1445 1472
1446 // RegExp functions. 1473 // RegExp functions.
1447 case kRegExpCompile: 1474 case kRegExpCompile:
1448 return Type::OtherObject(); 1475 return Type::OtherObject();
1449 case kRegExpExec: 1476 case kRegExpExec:
1450 return Type::Union(Type::OtherObject(), Type::Null(), t->zone()); 1477 return Type::Union(Type::OtherObject(), Type::Null(), t->zone());
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { 1830 Type* Typer::Visitor::TypeConstant(Handle<Object> value) {
1804 if (Type::IsInteger(*value)) { 1831 if (Type::IsInteger(*value)) {
1805 return Type::Range(value->Number(), value->Number(), zone()); 1832 return Type::Range(value->Number(), value->Number(), zone());
1806 } 1833 }
1807 return Type::NewConstant(value, zone()); 1834 return Type::NewConstant(value, zone());
1808 } 1835 }
1809 1836
1810 } // namespace compiler 1837 } // namespace compiler
1811 } // namespace internal 1838 } // namespace internal
1812 } // namespace v8 1839 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698