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

Unified Diff: src/js/math.js

Issue 1641083003: [builtins] Make Math.max and Math.min fast by default. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: SKIP unrelated ignition failures. Created 4 years, 11 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
Index: src/js/math.js
diff --git a/src/js/math.js b/src/js/math.js
index 990a7e993c4f450bdd0879af036820099aa39ec2..8a84fdfd69f7ad32cfeaa0f1fb7a758b567fd09d 100644
--- a/src/js/math.js
+++ b/src/js/math.js
@@ -75,60 +75,6 @@ function MathLog(x) {
return %_MathLogRT(TO_NUMBER(x));
}
-// ECMA 262 - 15.8.2.11
-function MathMax(arg1, arg2) { // length == 2
- var length = %_ArgumentsLength();
- if (length == 2) {
- arg1 = TO_NUMBER(arg1);
- arg2 = TO_NUMBER(arg2);
- if (arg2 > arg1) return arg2;
- if (arg1 > arg2) return arg1;
- if (arg1 == arg2) {
- // Make sure -0 is considered less than +0.
- return (arg1 === 0 && %_IsMinusZero(arg1)) ? arg2 : arg1;
- }
- // All comparisons failed, one of the arguments must be NaN.
- return NaN;
- }
- var r = -INFINITY;
- for (var i = 0; i < length; i++) {
- var n = %_Arguments(i);
- n = TO_NUMBER(n);
- // Make sure +0 is considered greater than -0.
- if (NUMBER_IS_NAN(n) || n > r || (r === 0 && n === 0 && %_IsMinusZero(r))) {
- r = n;
- }
- }
- return r;
-}
-
-// ECMA 262 - 15.8.2.12
-function MathMin(arg1, arg2) { // length == 2
- var length = %_ArgumentsLength();
- if (length == 2) {
- arg1 = TO_NUMBER(arg1);
- arg2 = TO_NUMBER(arg2);
- if (arg2 > arg1) return arg1;
- if (arg1 > arg2) return arg2;
- if (arg1 == arg2) {
- // Make sure -0 is considered less than +0.
- return (arg1 === 0 && %_IsMinusZero(arg1)) ? arg1 : arg2;
- }
- // All comparisons failed, one of the arguments must be NaN.
- return NaN;
- }
- var r = INFINITY;
- for (var i = 0; i < length; i++) {
- var n = %_Arguments(i);
- n = TO_NUMBER(n);
- // Make sure -0 is considered less than +0.
- if (NUMBER_IS_NAN(n) || n < r || (r === 0 && n === 0 && %_IsMinusZero(n))) {
- r = n;
- }
- }
- return r;
-}
-
// ECMA 262 - 15.8.2.13
function MathPowJS(x, y) {
return %_MathPow(TO_NUMBER(x), TO_NUMBER(y));
@@ -314,8 +260,6 @@ utils.InstallFunctions(GlobalMath, DONT_ENUM, [
"sqrt", MathSqrtJS,
"atan2", MathAtan2JS,
"pow", MathPowJS,
- "max", MathMax,
- "min", MathMin,
"imul", MathImul,
"sign", MathSign,
"trunc", MathTrunc,
@@ -349,8 +293,6 @@ utils.Export(function(to) {
to.MathExp = MathExp;
to.MathFloor = MathFloorJS;
to.IntRandom = MathRandomRaw;
- to.MathMax = MathMax;
- to.MathMin = MathMin;
});
})
« src/arm64/builtins-arm64.cc ('K') | « src/ia32/builtins-ia32.cc ('k') | src/js/prologue.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698