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

Unified Diff: src/js/math.js

Issue 1824993002: [builtins] Add support for JS builtins written in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 9 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/frames.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/math.js
diff --git a/src/js/math.js b/src/js/math.js
index 69afaaba823dd633ebed027b18d6962b184dd563..c17441db8064ec48c7f308a6e665060eb31acc90 100644
--- a/src/js/math.js
+++ b/src/js/math.js
@@ -91,11 +91,6 @@ function MathRound(x) {
return %RoundNumber(TO_NUMBER(x));
}
-// ECMA 262 - 15.8.2.17
-function MathSqrtJS(x) {
- return %_MathSqrt(+x);
-}
-
// ES6 draft 09-27-13, section 20.2.2.28.
function MathSign(x) {
x = +x;
@@ -119,9 +114,9 @@ function MathAsinh(x) {
x = TO_NUMBER(x);
// Idempotent for NaN, +/-0 and +/-Infinity.
if (x === 0 || !NUMBER_IS_FINITE(x)) return x;
- if (x > 0) return MathLog(x + %_MathSqrt(x * x + 1));
+ if (x > 0) return MathLog(x + %math_sqrt(x * x + 1));
// This is to prevent numerical errors caused by large negative x.
- return -MathLog(-x + %_MathSqrt(x * x + 1));
+ return -MathLog(-x + %math_sqrt(x * x + 1));
}
// ES6 draft 09-27-13, section 20.2.2.3.
@@ -130,7 +125,7 @@ function MathAcosh(x) {
if (x < 1) return NaN;
// Idempotent for NaN and +Infinity.
if (!NUMBER_IS_FINITE(x)) return x;
- return MathLog(x + %_MathSqrt(x + 1) * %_MathSqrt(x - 1));
+ return MathLog(x + %math_sqrt(x + 1) * %math_sqrt(x - 1));
}
// ES6 draft 09-27-13, section 20.2.2.7.
@@ -169,7 +164,7 @@ function MathHypot(x, y) { // Function length is 2.
compensation = (preliminary - sum) - summand;
sum = preliminary;
}
- return %_MathSqrt(sum) * max;
+ return %math_sqrt(sum) * max;
}
// ES6 draft 07-18-14, section 20.2.2.11
@@ -234,7 +229,6 @@ utils.InstallFunctions(GlobalMath, DONT_ENUM, [
"floor", MathFloorJS,
"log", MathLog,
"round", MathRound,
- "sqrt", MathSqrtJS,
"atan2", MathAtan2JS,
"pow", MathPowJS,
"sign", MathSign,
@@ -254,7 +248,6 @@ utils.InstallFunctions(GlobalMath, DONT_ENUM, [
%SetForceInlineFlag(MathFloorJS);
%SetForceInlineFlag(MathRandom);
%SetForceInlineFlag(MathSign);
-%SetForceInlineFlag(MathSqrtJS);
%SetForceInlineFlag(MathTrunc);
// -------------------------------------------------------------------
« no previous file with comments | « src/frames.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698