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

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

Issue 2313073002: [builtins] Migrate Number predicates and make them optimizable. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | src/js/collection.js » ('j') | no next file with comments »
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 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 t->zone()); 1333 t->zone());
1334 case kDateGetMinutes: 1334 case kDateGetMinutes:
1335 return t->cache_.kJSDateMinuteType; 1335 return t->cache_.kJSDateMinuteType;
1336 case kDateGetMonth: 1336 case kDateGetMonth:
1337 return t->cache_.kJSDateMonthType; 1337 return t->cache_.kJSDateMonthType;
1338 case kDateGetSeconds: 1338 case kDateGetSeconds:
1339 return t->cache_.kJSDateSecondType; 1339 return t->cache_.kJSDateSecondType;
1340 case kDateGetTime: 1340 case kDateGetTime:
1341 return t->cache_.kJSDateValueType; 1341 return t->cache_.kJSDateValueType;
1342 // Number functions. 1342 // Number functions.
1343 case kNumberIsFinite:
1344 case kNumberIsInteger:
1345 case kNumberIsNaN:
1346 case kNumberIsSafeInteger:
1347 return Type::Boolean();
1343 case kNumberParseInt: 1348 case kNumberParseInt:
1344 return t->cache_.kIntegerOrMinusZeroOrNaN; 1349 return t->cache_.kIntegerOrMinusZeroOrNaN;
1345 case kNumberToString: 1350 case kNumberToString:
1346 return Type::String(); 1351 return Type::String();
1347 // String functions. 1352 // String functions.
1348 case kStringCharCodeAt: 1353 case kStringCharCodeAt:
1349 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(), 1354 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(),
1350 t->zone()); 1355 t->zone());
1351 case kStringCharAt: 1356 case kStringCharAt:
1352 case kStringConcat: 1357 case kStringConcat:
(...skipping 10 matching lines...) Expand all
1363 case kObjectHasOwnProperty: 1368 case kObjectHasOwnProperty:
1364 return Type::Boolean(); 1369 return Type::Boolean();
1365 // Global functions. 1370 // Global functions.
1366 case kGlobalDecodeURI: 1371 case kGlobalDecodeURI:
1367 case kGlobalDecodeURIComponent: 1372 case kGlobalDecodeURIComponent:
1368 case kGlobalEncodeURI: 1373 case kGlobalEncodeURI:
1369 case kGlobalEncodeURIComponent: 1374 case kGlobalEncodeURIComponent:
1370 case kGlobalEscape: 1375 case kGlobalEscape:
1371 case kGlobalUnescape: 1376 case kGlobalUnescape:
1372 return Type::String(); 1377 return Type::String();
1378 case kGlobalIsFinite:
1379 case kGlobalIsNaN:
1380 return Type::Boolean();
1373 default: 1381 default:
1374 break; 1382 break;
1375 } 1383 }
1376 } 1384 }
1377 } 1385 }
1378 return Type::NonInternal(); 1386 return Type::NonInternal();
1379 } 1387 }
1380 1388
1381 1389
1382 Type* Typer::Visitor::TypeJSCallFunction(Node* node) { 1390 Type* Typer::Visitor::TypeJSCallFunction(Node* node) {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { 1711 Type* Typer::Visitor::TypeConstant(Handle<Object> value) {
1704 if (Type::IsInteger(*value)) { 1712 if (Type::IsInteger(*value)) {
1705 return Type::Range(value->Number(), value->Number(), zone()); 1713 return Type::Range(value->Number(), value->Number(), zone());
1706 } 1714 }
1707 return Type::Constant(value, zone()); 1715 return Type::Constant(value, zone());
1708 } 1716 }
1709 1717
1710 } // namespace compiler 1718 } // namespace compiler
1711 } // namespace internal 1719 } // namespace internal
1712 } // namespace v8 1720 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | src/js/collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698