Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Dec 5, 2024
2 parents e17d16e + 5ac8f6a commit 1d5d9bc
Show file tree
Hide file tree
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.
2 changes: 1 addition & 1 deletion Configurations/Version.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

MAJOR_VERSION = 621;
MINOR_VERSION = 1;
TINY_VERSION = 7;
TINY_VERSION = 8;
MICRO_VERSION = 0;
NANO_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(TINY_VERSION);
Expand Down
11 changes: 11 additions & 0 deletions JSTests/microbenchmarks/array-prototype-fill-contiguous.js
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);
}
11 changes: 11 additions & 0 deletions JSTests/microbenchmarks/array-prototype-fill-double.js
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);
}
11 changes: 11 additions & 0 deletions JSTests/microbenchmarks/array-prototype-fill-int32.js
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);
}
10 changes: 10 additions & 0 deletions JSTests/microbenchmarks/array-prototype-fill-undecided.js
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);
}
23 changes: 23 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-1.js
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);
}
27 changes: 27 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-2.js
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);
}

27 changes: 27 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-3.js
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);
}

27 changes: 27 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-4.js
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);
}
27 changes: 27 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-array-clone-big.js
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 JSTests/microbenchmarks/loop-unrolling-array-clone-small.js
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
}
}
32 changes: 32 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-constant-small.js
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
}
21 changes: 21 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-core-sha1.js
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
}
32 changes: 32 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-variable-large.js
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 JSTests/microbenchmarks/loop-unrolling-variable-medium-dep.js
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
}
32 changes: 32 additions & 0 deletions JSTests/microbenchmarks/loop-unrolling-variable-medium.js
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
}
Loading

0 comments on commit 1d5d9bc

Please sign in to comment.