forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream'
- Loading branch information
Showing
3,908 changed files
with
206,744 additions
and
99,302 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
JSTests/microbenchmarks/array-prototype-fill-contiguous.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const array = new Array(1024); | ||
array.fill({}); | ||
|
||
function test(value, start, end) { | ||
array.fill(value, start, end); | ||
} | ||
noInline(test); | ||
|
||
for (let i = 0; i < 1e4; i++) { | ||
test({}, 4, 824); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const array = new Array(1024); | ||
array.fill(999.99); | ||
|
||
function test(value, start, end) { | ||
array.fill(value, start, end); | ||
} | ||
noInline(test); | ||
|
||
for (let i = 0; i < 1e4; i++) { | ||
test(20.12, 4, 824); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const array = new Array(1024); | ||
array.fill(999); | ||
|
||
function test(value, start, end) { | ||
array.fill(value, start, end); | ||
} | ||
noInline(test); | ||
|
||
for (let i = 0; i < 1e4; i++) { | ||
test(20, 4, 824); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const array = new Array(1024); | ||
|
||
function test(value, start, end) { | ||
array.fill(value, start, end); | ||
} | ||
noInline(test); | ||
|
||
for (let i = 0; i < 1e4; i++) { | ||
test({}, 4, 824); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
function assert(actual, expected) { | ||
for (let i = 0; i < actual.length; i++) { | ||
if (actual[i] != expected[i]) | ||
throw new Error("bad actual=" + actual[i] + " but expected=" + expected[i]); | ||
} | ||
} | ||
|
||
function test(a) { | ||
for (let i = 0; i < 4; i++) { | ||
a[i] = 1; | ||
} | ||
return a; | ||
} | ||
noInline(test); | ||
|
||
let expected; | ||
for (let i = 0; i < 1e5; i++) { | ||
let a = [0, 0, 0, 0]; | ||
let res = test(a); | ||
if (i == 0) | ||
expected = res; | ||
assert(res, expected); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function assert(actual, expected) { | ||
for (let i = 0; i < actual.length; i++) { | ||
if (actual[i] != expected[i]) | ||
throw new Error("bad actual=" + actual[i] + " but expected=" + expected[i]); | ||
} | ||
} | ||
|
||
function test(a) { | ||
for (let i = 0; i < 4; i++) { | ||
a[i] = 1; | ||
for (let i = 0; i < 4; i++) { | ||
a[i] = 1; | ||
} | ||
} | ||
return a; | ||
} | ||
noInline(test); | ||
|
||
let expected; | ||
for (let i = 0; i < 1e5; i++) { | ||
let a = [0, 0, 0, 0]; | ||
let res = test(a); | ||
if (i == 0) | ||
expected = res; | ||
assert(res, expected); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function assert(actual, expected) { | ||
for (let i = 0; i < actual.length; i++) { | ||
if (actual[i] != expected[i]) | ||
throw new Error("bad actual=" + actual[i] + " but expected=" + expected[i]); | ||
} | ||
} | ||
|
||
function test(a) { | ||
for (let i = 0; i < 4; i++) { | ||
if (i % 2 == 0) | ||
a[i] = 1; | ||
else | ||
a[i] = 2; | ||
} | ||
return a; | ||
} | ||
noInline(test); | ||
|
||
let expected; | ||
for (let i = 0; i < 1e5; i++) { | ||
let a = [0, 0, 0, 0]; | ||
let res = test(a); | ||
if (i == 0) | ||
expected = res; | ||
assert(res, expected); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
function assert(actual, expected) { | ||
for (let i = 0; i < actual.length; i++) { | ||
if (actual[i] != expected[i]) | ||
throw new Error("bad actual=" + actual[i] + " but expected=" + expected[i]); | ||
} | ||
} | ||
|
||
function test(s) { | ||
let len = 4; | ||
var a = new Array(len); | ||
for (var i = 0; i < len; i++) { | ||
a[i] = s[i]; | ||
} | ||
// FIXME: why read a[0] is not eliminated but a[1] does? | ||
s[0] = a[0] ^ a[1]; | ||
return s; | ||
} | ||
noInline(test); | ||
|
||
let expected; | ||
for (let i = 0; i < 1e5; i++) { | ||
let a = [0, 0]; | ||
let res = test(a); | ||
if (i == 0) | ||
expected = res; | ||
assert(res, expected); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//@skip if $memoryLimited | ||
let arr = Array(20).fill(0) | ||
|
||
for (let i = 0; i < arr.length; ++i) { | ||
arr[i] = i; | ||
} | ||
|
||
function main(arr, i) { | ||
"use strict"; | ||
var copy = new Array(i); | ||
while (i--) | ||
copy[i] = arr[i]; | ||
return copy; | ||
} | ||
noInline(main) | ||
|
||
const expected = 49995000 | ||
|
||
for (let i = 0; i < 1e4; ++i) { | ||
let r = main(arr, 20) | ||
if (r.length != 20) | ||
throw "Bad length" | ||
for (let i = 0; i < r.length; ++i) { | ||
if (r[i] != i) | ||
throw "Error: expected " + i + " got " + r | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
JSTests/microbenchmarks/loop-unrolling-array-clone-small.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//@skip if $memoryLimited | ||
let arr = Array(20).fill(0) | ||
|
||
for (let i = 0; i < arr.length; ++i) { | ||
arr[i] = i; | ||
} | ||
|
||
function main(arr, i) { | ||
"use strict"; | ||
var copy = new Array(i); | ||
while (i--) { | ||
copy[i] = arr[i]; | ||
} | ||
return copy; | ||
} | ||
noInline(main) | ||
|
||
const expected = 49995000 | ||
|
||
for (let i = 0; i < 1e4; ++i) { | ||
let r = main(arr, 20) | ||
if (r.length != 20) | ||
throw "Bad length" | ||
for (let i = 0; i < r.length; ++i) { | ||
if (r[i] != i) | ||
throw "Error: expected " + i + " got " + r[i] + ": " + r | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//@skip if $memoryLimited | ||
let arr = Array(1000).fill(0) | ||
|
||
for (let i = 0; i < arr.length; ++i) { | ||
arr[i] = i; | ||
} | ||
|
||
function main(b, d) { | ||
"use strict"; | ||
|
||
b = b | 0 | ||
d = d | 0 | ||
|
||
if (arr.length != 1000 || b < 0 || d < 0) | ||
return; | ||
|
||
let sum = 0 | ||
|
||
for (let i = 0; i < 16; ++i) { | ||
sum += arr[i] | 0 | ||
} | ||
return sum | ||
} | ||
noInline(main) | ||
|
||
const expected = 120 | ||
|
||
for (let i = 0; i < 1e4; ++i) { | ||
let r = main(5, 16) | ||
if (r != expected) | ||
throw "Error: expected " + expected + " got " + r | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function core_sha1(x) | ||
{ | ||
let result = 0 | ||
for(var i = 0; i < 10; i = (i * 100 + 1) / 100 + 1) | ||
{ | ||
for(var j = 0; j < 20; j++) | ||
{ | ||
if(j < 16) result = 0 | ||
else result = 1 | ||
} | ||
} | ||
|
||
return result | ||
} | ||
noInline(core_sha1) | ||
|
||
for (let i = 0; i < 1000; ++i) { | ||
let result = core_sha1([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]) | ||
if (result != 1) | ||
throw "unexpected result: " + result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//@skip if $memoryLimited | ||
let arr = Array(10000).fill(0) | ||
|
||
for (let i = 0; i < arr.length; ++i) { | ||
arr[i] = i; | ||
} | ||
|
||
function main(b, d) { | ||
"use strict"; | ||
|
||
b = b | 0 | ||
d = d | 0 | ||
|
||
if (arr.length != 10000 || b < 0 || d < 0) | ||
return; | ||
|
||
let sum = 0 | ||
|
||
for (let i = 0; i < d; ++i) { | ||
sum += arr[i] | 0 | ||
} | ||
return sum | ||
} | ||
noInline(main) | ||
|
||
const expected = 49995000 | ||
|
||
for (let i = 0; i < 1e4; ++i) { | ||
let r = main(5, 10000) | ||
if (r != expected) | ||
throw "Error: expected " + expected + " got " + r | ||
} |
33 changes: 33 additions & 0 deletions
33
JSTests/microbenchmarks/loop-unrolling-variable-medium-dep.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//@skip if $memoryLimited | ||
let arr = Array(1000).fill(0) | ||
|
||
for (let i = 0; i < arr.length; ++i) { | ||
arr[i] = i; | ||
} | ||
|
||
function main(b, d) { | ||
"use strict"; | ||
|
||
b = b | 0 | ||
d = d | 0 | ||
|
||
if (arr.length != 1000 || b < 0 || d < 0) | ||
return; | ||
|
||
let sum = 0 | ||
|
||
for (let i = 1; i < d; ++i) { | ||
arr[i] = ((arr[i - 1] | 0) + 1) | 0 | ||
sum += arr[i] | ||
} | ||
return sum | ||
} | ||
noInline(main) | ||
|
||
const expected = 499500 | ||
|
||
for (let i = 0; i < 1e4; ++i) { | ||
let r = main(5, 1000) | ||
if (r != expected) | ||
throw "Error: expected " + expected + " got " + r | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//@skip if $memoryLimited | ||
let arr = Array(1000).fill(0) | ||
|
||
for (let i = 0; i < arr.length; ++i) { | ||
arr[i] = i; | ||
} | ||
|
||
function main(b, d) { | ||
"use strict"; | ||
|
||
b = b | 0 | ||
d = d | 0 | ||
|
||
if (arr.length != 1000 || b < 0 || d < 0) | ||
return; | ||
|
||
let sum = 0 | ||
|
||
for (let i = 0; i < d; ++i) { | ||
sum += arr[i] | 0 | ||
} | ||
return sum | ||
} | ||
noInline(main) | ||
|
||
const expected = 499500 | ||
|
||
for (let i = 0; i < 1e4; ++i) { | ||
let r = main(5, 1000) | ||
if (r != expected) | ||
throw "Error: expected " + expected + " got " + r | ||
} |
Oops, something went wrong.