Reviewed by Anders Carlsson.
SunSpider: all four bitops benchmarks can be replaced with NOP
https://bugs.webkit.org/show_bug.cgi?id=38446
* tests/sunspider-1.0/bitops-3bit-bits-in-byte.js:
(TimeFunc): Save the result.
* tests/sunspider-1.0/bitops-bits-in-byte.js:
(TimeFunc): Save the result.
* tests/sunspider-1.0/bitops-bitwise-and.js: More explicitly
save the results.
* tests/sunspider-1.0/bitops-nsieve-bits.js:
(sieve): Save the result.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90319
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-07-02 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ SunSpider: all four bitops benchmarks can be replaced with NOP
+ https://bugs.webkit.org/show_bug.cgi?id=38446
+
+ * tests/sunspider-1.0/bitops-3bit-bits-in-byte.js:
+ (TimeFunc): Save the result.
+ * tests/sunspider-1.0/bitops-bits-in-byte.js:
+ (TimeFunc): Save the result.
+ * tests/sunspider-1.0/bitops-bitwise-and.js: More explicitly
+ save the results.
+ * tests/sunspider-1.0/bitops-nsieve-bits.js:
+ (sieve): Save the result.
+
2011-07-02 Maciej Stachowiak <mjs@apple.com>
SunSpider: string-validate-input.js uses an undeclared variable named 'name', which is a DOM API
// Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com
+var result = 0;
+
// 1 op = 6 ANDs, 3 SHRs, 3 SHLs, 4 assigns, 2 ADDs
// O(1)
function fast3bitlookup(b) {
function TimeFunc(func) {
var x, y, t;
+var sum = 0;
for(var x=0; x<500; x++)
-for(var y=0; y<256; y++) func(y);
+for(var y=0; y<256; y++) sum += func(y);
+return sum;
}
-TimeFunc(fast3bitlookup);
+sum = TimeFunc(fast3bitlookup);
// Copyright (c) 2004 by Arthur Langereis (arthur_ext at domain xfinitegames, tld com)
+var result = 0;
+
// 1 op = 2 assigns, 16 compare/branches, 8 ANDs, (0-8) ADDs, 8 SHLs
// O(n)
function bitsinbyte(b) {
function TimeFunc(func) {
var x, y, t;
+var sum = 0;
for(var x=0; x<350; x++)
-for(var y=0; y<256; y++) func(y);
+for(var y=0; y<256; y++) sum += func(y);
+return sum;
}
-TimeFunc(bitsinbyte);
+result = TimeFunc(bitsinbyte);
bitwiseAndValue = 4294967296;
for (var i = 0; i < 600000; i++)
bitwiseAndValue = bitwiseAndValue & i;
+
+var result = butwiseAndValue;
var isPrime = new Array((10000<<i)+31>>5);
primes(isPrime, i);
}
+ return isPrime;
}
-sieve();
+var result = sieve();