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

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

Issue 2395373002: [builtins] Migrate Number.parseFloat to a TurboFan builtin. (Closed)
Patch Set: Fix the -0 corner case. 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 unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-number.cc ('k') | src/js/v8natives.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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 case kDateGetSeconds: 1355 case kDateGetSeconds:
1356 return t->cache_.kJSDateSecondType; 1356 return t->cache_.kJSDateSecondType;
1357 case kDateGetTime: 1357 case kDateGetTime:
1358 return t->cache_.kJSDateValueType; 1358 return t->cache_.kJSDateValueType;
1359 // Number functions. 1359 // Number functions.
1360 case kNumberIsFinite: 1360 case kNumberIsFinite:
1361 case kNumberIsInteger: 1361 case kNumberIsInteger:
1362 case kNumberIsNaN: 1362 case kNumberIsNaN:
1363 case kNumberIsSafeInteger: 1363 case kNumberIsSafeInteger:
1364 return Type::Boolean(); 1364 return Type::Boolean();
1365 case kNumberParseFloat:
1366 return Type::Number();
1365 case kNumberParseInt: 1367 case kNumberParseInt:
1366 return t->cache_.kIntegerOrMinusZeroOrNaN; 1368 return t->cache_.kIntegerOrMinusZeroOrNaN;
1367 case kNumberToString: 1369 case kNumberToString:
1368 return Type::String(); 1370 return Type::String();
1369 // String functions. 1371 // String functions.
1370 case kStringCharCodeAt: 1372 case kStringCharCodeAt:
1371 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(), 1373 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(),
1372 t->zone()); 1374 t->zone());
1373 case kStringCharAt: 1375 case kStringCharAt:
1374 case kStringConcat: 1376 case kStringConcat:
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1749 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { 1751 Type* Typer::Visitor::TypeConstant(Handle<Object> value) {
1750 if (Type::IsInteger(*value)) { 1752 if (Type::IsInteger(*value)) {
1751 return Type::Range(value->Number(), value->Number(), zone()); 1753 return Type::Range(value->Number(), value->Number(), zone());
1752 } 1754 }
1753 return Type::NewConstant(value, zone()); 1755 return Type::NewConstant(value, zone());
1754 } 1756 }
1755 1757
1756 } // namespace compiler 1758 } // namespace compiler
1757 } // namespace internal 1759 } // namespace internal
1758 } // namespace v8 1760 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-number.cc ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698