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

Unified Diff: src/js/v8natives.js

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/typedarray.js ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/v8natives.js
diff --git a/src/js/v8natives.js b/src/js/v8natives.js
index 0c0a7925b9e16350907e3287a388b37b3ec2f9bf..93636a036b0722dd4a83f7fe5a8380d777e4b98a 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -18,20 +18,6 @@ var ObjectToString = utils.ImportNow("object_to_string");
// ----------------------------------------------------------------------------
-// ES6 18.2.3 isNaN(number)
-function GlobalIsNaN(number) {
- number = TO_NUMBER(number);
- return NUMBER_IS_NAN(number);
-}
-
-
-// ES6 18.2.2 isFinite(number)
-function GlobalIsFinite(number) {
- number = TO_NUMBER(number);
- return NUMBER_IS_FINITE(number);
-}
-
-
// ES6 18.2.5 parseInt(string, radix)
function GlobalParseInt(string, radix) {
if (IS_UNDEFINED(radix) || radix === 10 || radix === 0) {
@@ -91,8 +77,6 @@ utils.InstallConstants(global, [
// Set up non-enumerable function on the global object.
utils.InstallFunctions(global, DONT_ENUM, [
- "isNaN", GlobalIsNaN,
- "isFinite", GlobalIsFinite,
"parseInt", GlobalParseInt,
"parseFloat", GlobalParseFloat,
]);
@@ -207,38 +191,6 @@ utils.InstallFunctions(GlobalObject, DONT_ENUM, [
// ----------------------------------------------------------------------------
// Number
-// Harmony isFinite.
-function NumberIsFinite(number) {
- return IS_NUMBER(number) && NUMBER_IS_FINITE(number);
-}
-
-
-// Harmony isInteger
-function NumberIsInteger(number) {
- return NumberIsFinite(number) && TO_INTEGER(number) == number;
-}
-
-
-// Harmony isNaN.
-function NumberIsNaN(number) {
- return IS_NUMBER(number) && NUMBER_IS_NAN(number);
-}
-
-
-// Harmony isSafeInteger
-function NumberIsSafeInteger(number) {
- if (NumberIsFinite(number)) {
- var integral = TO_INTEGER(number);
- if (integral == number) {
- return -kMaxSafeInteger <= integral && integral <= kMaxSafeInteger;
- }
- }
- return false;
-}
-
-
-// ----------------------------------------------------------------------------
-
utils.InstallConstants(GlobalNumber, [
// ECMA-262 section 15.7.3.1.
"MAX_VALUE", 1.7976931348623157e+308,
@@ -260,15 +212,10 @@ utils.InstallConstants(GlobalNumber, [
// Harmony Number constructor additions
utils.InstallFunctions(GlobalNumber, DONT_ENUM, [
- "isFinite", NumberIsFinite,
- "isInteger", NumberIsInteger,
- "isNaN", NumberIsNaN,
- "isSafeInteger", NumberIsSafeInteger,
"parseInt", GlobalParseInt,
"parseFloat", GlobalParseFloat
]);
-%SetForceInlineFlag(NumberIsNaN);
// ----------------------------------------------------------------------------
@@ -295,9 +242,6 @@ function GetIterator(obj, method) {
utils.Export(function(to) {
to.GetIterator = GetIterator;
to.GetMethod = GetMethod;
- to.IsNaN = GlobalIsNaN;
- to.NumberIsNaN = NumberIsNaN;
- to.NumberIsInteger = NumberIsInteger;
to.ObjectHasOwnProperty = GlobalObject.prototype.hasOwnProperty;
});
« no previous file with comments | « src/js/typedarray.js ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698