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

Unified Diff: src/js/math.js

Issue 1841993002: [builtins] Make Math.ceil, Math.trunc and Math.round optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/counters.h ('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 99f5e009664e3da78884321de876ec2fea50bcc9..e59da69eece4891808d4d34976b1395e0087b680 100644
--- a/src/js/math.js
+++ b/src/js/math.js
@@ -39,11 +39,6 @@ function MathAtan2JS(y, x) {
return %MathAtan2(y, x);
}
-// ECMA 262 - 15.8.2.6
-function MathCeil(x) {
- return -%math_floor(-x);
-}
-
// ECMA 262 - 15.8.2.8
function MathExp(x) {
return %MathExpRT(TO_NUMBER(x));
@@ -81,11 +76,6 @@ function MathRandomRaw() {
return %_DoubleLo(randomNumbers[--nextRandomIndex]) & 0x3FFFFFFF;
}
-// ECMA 262 - 15.8.2.15
-function MathRound(x) {
- return %RoundNumber(TO_NUMBER(x));
-}
-
// ES6 draft 09-27-13, section 20.2.2.28.
function MathSign(x) {
x = +x;
@@ -95,15 +85,6 @@ function MathSign(x) {
return x;
}
-// ES6 draft 09-27-13, section 20.2.2.34.
-function MathTrunc(x) {
- x = +x;
- if (x > 0) return %math_floor(x);
- if (x < 0) return -%math_floor(-x);
- // -0, 0 or NaN.
- return x;
-}
-
// ES6 draft 09-27-13, section 20.2.2.5.
function MathAsinh(x) {
x = TO_NUMBER(x);
@@ -219,14 +200,11 @@ utils.InstallConstants(GlobalMath, [
utils.InstallFunctions(GlobalMath, DONT_ENUM, [
"random", MathRandom,
"abs", MathAbs,
- "ceil", MathCeil,
"exp", MathExp,
"log", MathLog,
- "round", MathRound,
"atan2", MathAtan2JS,
"pow", MathPowJS,
"sign", MathSign,
- "trunc", MathTrunc,
"asinh", MathAsinh,
"acosh", MathAcosh,
"atanh", MathAtanh,
@@ -237,11 +215,9 @@ utils.InstallFunctions(GlobalMath, DONT_ENUM, [
%SetForceInlineFlag(MathAbs);
%SetForceInlineFlag(MathAtan2JS);
-%SetForceInlineFlag(MathCeil);
%SetForceInlineFlag(MathClz32JS);
%SetForceInlineFlag(MathRandom);
%SetForceInlineFlag(MathSign);
-%SetForceInlineFlag(MathTrunc);
// -------------------------------------------------------------------
// Exports
« no previous file with comments | « src/counters.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698