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

Side by Side Diff: src/v8natives.js

Issue 1353953002: Use a kMaxSafeInteger instead of Number.MAX_SAFE_INTEGER (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Zap unneccessary GlobalNumber in runtime.js Created 5 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/runtime.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ---------------------------------------------------------------------------- 9 // ----------------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 function NumberIsNaN(number) { 1537 function NumberIsNaN(number) {
1538 return IS_NUMBER(number) && NUMBER_IS_NAN(number); 1538 return IS_NUMBER(number) && NUMBER_IS_NAN(number);
1539 } 1539 }
1540 1540
1541 1541
1542 // Harmony isSafeInteger 1542 // Harmony isSafeInteger
1543 function NumberIsSafeInteger(number) { 1543 function NumberIsSafeInteger(number) {
1544 if (NumberIsFinite(number)) { 1544 if (NumberIsFinite(number)) {
1545 var integral = TO_INTEGER(number); 1545 var integral = TO_INTEGER(number);
1546 if (integral == number) { 1546 if (integral == number) {
1547 return MathAbs(integral) <= GlobalNumber.MAX_SAFE_INTEGER; 1547 return MathAbs(integral) <= kMaxSafeInteger;
1548 } 1548 }
1549 } 1549 }
1550 return false; 1550 return false;
1551 } 1551 }
1552 1552
1553 1553
1554 // ---------------------------------------------------------------------------- 1554 // ----------------------------------------------------------------------------
1555 1555
1556 %SetCode(GlobalNumber, NumberConstructor); 1556 %SetCode(GlobalNumber, NumberConstructor);
1557 %FunctionSetPrototype(GlobalNumber, new GlobalNumber(0)); 1557 %FunctionSetPrototype(GlobalNumber, new GlobalNumber(0));
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 }); 1813 });
1814 1814
1815 %InstallToContext([ 1815 %InstallToContext([
1816 "global_eval_fun", GlobalEval, 1816 "global_eval_fun", GlobalEval,
1817 "object_define_own_property", DefineOwnPropertyFromAPI, 1817 "object_define_own_property", DefineOwnPropertyFromAPI,
1818 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, 1818 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor,
1819 "to_complete_property_descriptor", ToCompletePropertyDescriptor, 1819 "to_complete_property_descriptor", ToCompletePropertyDescriptor,
1820 ]); 1820 ]);
1821 1821
1822 }) 1822 })
OLDNEW
« no previous file with comments | « src/runtime.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698