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

Side by Side Diff: src/v8natives.js

Issue 1314493005: Remove unnecessary checks and runtime calls from ToLength (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add NaN check 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
« src/runtime.js ('K') | « 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 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 function NumberIsNaN(number) { 1534 function NumberIsNaN(number) {
1535 return IS_NUMBER(number) && NUMBER_IS_NAN(number); 1535 return IS_NUMBER(number) && NUMBER_IS_NAN(number);
1536 } 1536 }
1537 1537
1538 1538
1539 // Harmony isSafeInteger 1539 // Harmony isSafeInteger
1540 function NumberIsSafeInteger(number) { 1540 function NumberIsSafeInteger(number) {
1541 if (NumberIsFinite(number)) { 1541 if (NumberIsFinite(number)) {
1542 var integral = TO_INTEGER(number); 1542 var integral = TO_INTEGER(number);
1543 if (integral == number) { 1543 if (integral == number) {
1544 return MathAbs(integral) <= GlobalNumber.MAX_SAFE_INTEGER; 1544 return MathAbs(integral) <= kMaxSafeInteger;
1545 } 1545 }
1546 } 1546 }
1547 return false; 1547 return false;
1548 } 1548 }
1549 1549
1550 1550
1551 // ---------------------------------------------------------------------------- 1551 // ----------------------------------------------------------------------------
1552 1552
1553 %SetCode(GlobalNumber, NumberConstructor); 1553 %SetCode(GlobalNumber, NumberConstructor);
1554 %FunctionSetPrototype(GlobalNumber, new GlobalNumber(0)); 1554 %FunctionSetPrototype(GlobalNumber, new GlobalNumber(0));
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 }); 1810 });
1811 1811
1812 utils.ExportToRuntime(function(to) { 1812 utils.ExportToRuntime(function(to) {
1813 to["global_eval_fun"] = GlobalEval; 1813 to["global_eval_fun"] = GlobalEval;
1814 to["object_define_own_property"] = DefineOwnPropertyFromAPI; 1814 to["object_define_own_property"] = DefineOwnPropertyFromAPI;
1815 to["object_get_own_property_descriptor"] = ObjectGetOwnPropertyDescriptor; 1815 to["object_get_own_property_descriptor"] = ObjectGetOwnPropertyDescriptor;
1816 to["to_complete_property_descriptor"] = ToCompletePropertyDescriptor; 1816 to["to_complete_property_descriptor"] = ToCompletePropertyDescriptor;
1817 }); 1817 });
1818 1818
1819 }) 1819 })
OLDNEW
« src/runtime.js ('K') | « src/runtime.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698