Reviewed by Darin Adler.
SunSpider: The main function of math-cordic is dead code
https://bugs.webkit.org/show_bug.cgi?id=63863
Try to prevent math-cordic from being eliminated as dead code or
compiled down to a constant.
* tests/sunspider-1.0/math-cordic.js:
(cordicsincos):
(cordic):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90317
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-07-02 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Darin Adler.
+
+ SunSpider: The main function of math-cordic is dead code
+ https://bugs.webkit.org/show_bug.cgi?id=63863
+
+ Try to prevent math-cordic from being eliminated as dead code or
+ compiled down to a constant.
+
+ * tests/sunspider-1.0/math-cordic.js:
+ (cordicsincos):
+ (cordic):
+
2011-06-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adam Barth.
FIXED(0.027977)
];
+var Target = 28.027;
-function cordicsincos() {
+function cordicsincos(Target) {
var X;
var Y;
var TargetAngle;
X = FIXED(AG_CONST); /* AG_CONST * cos(0) */
Y = 0; /* AG_CONST * sin(0) */
- TargetAngle = FIXED(28.027);
+ TargetAngle = FIXED(Target);
CurrAngle = 0;
for (Step = 0; Step < 12; Step++) {
var NewX;
CurrAngle -= Angles[Step];
}
}
+
+ return FLOAT(X) * FLOAT(Y);
}
///// End CORDIC
+var total = 0;
+
function cordic( runs ) {
var start = new Date();
for ( var i = 0 ; i < runs ; i++ ) {
- cordicsincos();
+ total += cordicsincos(Target);
}
var end = new Date();