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
7,473 changed files
with
277,110 additions
and
231,349 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
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
23 changes: 23 additions & 0 deletions
23
JSTests/microbenchmarks/array-prototype-concat-copy-double-and-int32.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,23 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
function test(array1) { | ||
return array1.concat(); | ||
} | ||
noInline(test); | ||
|
||
var array1 = [2.1, 2.2, 2.3, 2.4, 4, 5, 6, 7]; | ||
for (var i = 0; i < 1e4; ++i) { | ||
var result = test(array1); | ||
shouldBe(result[0], 2.1); | ||
shouldBe(result[1], 2.2); | ||
shouldBe(result[2], 2.3); | ||
shouldBe(result[3], 2.4); | ||
shouldBe(result[4], 4); | ||
shouldBe(result[5], 5); | ||
shouldBe(result[6], 6); | ||
shouldBe(result[7], 7); | ||
shouldBe(result.length, 8); | ||
} |
19 changes: 19 additions & 0 deletions
19
JSTests/microbenchmarks/array-prototype-concat-copy-double.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,19 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
function test(array1) { | ||
return array1.concat(); | ||
} | ||
noInline(test); | ||
|
||
var array1 = [2.1, 2.2, 2.3, 2.4]; | ||
for (var i = 0; i < 1e4; ++i) { | ||
var result = test(array1); | ||
shouldBe(result[0], 2.1); | ||
shouldBe(result[1], 2.2); | ||
shouldBe(result[2], 2.3); | ||
shouldBe(result[3], 2.4); | ||
shouldBe(result.length, 4); | ||
} |
19 changes: 19 additions & 0 deletions
19
JSTests/microbenchmarks/array-prototype-concat-copy-int32.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,19 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
function test(array1) { | ||
return array1.concat(); | ||
} | ||
noInline(test); | ||
|
||
var array1 = [2, 3, 4, 5]; | ||
for (var i = 0; i < 1e4; ++i) { | ||
var result = test(array1); | ||
shouldBe(result[0], 2); | ||
shouldBe(result[1], 3); | ||
shouldBe(result[2], 4); | ||
shouldBe(result[3], 5); | ||
shouldBe(result.length, 4); | ||
} |
20 changes: 20 additions & 0 deletions
20
JSTests/microbenchmarks/array-prototype-concat-copy-obj.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,20 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
function test(array1) { | ||
return array1.concat(); | ||
} | ||
noInline(test); | ||
|
||
var obj1 = {}, obj2 = {}, obj3 = {}, obj4 = {}; | ||
var array1 = [obj1, obj2, obj3, obj4]; | ||
for (var i = 0; i < 1e4; ++i) { | ||
var result = test(array1); | ||
shouldBe(result[0], obj1); | ||
shouldBe(result[1], obj2); | ||
shouldBe(result[2], obj3); | ||
shouldBe(result[3], obj4); | ||
shouldBe(result.length, 4); | ||
} |
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,22 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
function test(array1, index, value) { | ||
return array1.with(index, value); | ||
} | ||
|
||
noInline(test); | ||
|
||
const array = new Array(1024); | ||
array.fill(99); | ||
|
||
const index = 512; | ||
const newValue = 300; | ||
|
||
for (let i = 0; i < 1e2; i++) { | ||
const result = test(array, index, newValue); | ||
shouldBe(result[index], newValue); | ||
shouldBe(result.length, array.length); | ||
} |
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,12 @@ | ||
function test(map, i) | ||
{ | ||
return map.get(i); | ||
} | ||
noInline(test); | ||
|
||
let map = new Map(); | ||
for (var i = 0; i < 1e6; ++i) { | ||
test(map, i * 0.253); | ||
test(map, i * 20.253); | ||
test(map, i * 3.2); | ||
} |
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,8 @@ | ||
var map = new Set(); | ||
|
||
for (var i = 0; i < 1000; i++) { | ||
for (var j = 0; j < 1000; j++) { | ||
map.delete(j); | ||
map.add(j); | ||
} | ||
} |
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,12 @@ | ||
//@ skip if $model == "Apple Watch Series 3" # added by mark-jsc-stress-test.py | ||
//@ skip | ||
|
||
(function () { | ||
for (var i = 0; i < 100; ++i) { | ||
var array = []; | ||
for (var j = 0; j < 1000; ++j) | ||
array.push(j); | ||
while (array.length > 10) | ||
array.splice(array.length / 2, 5, 1, 2, 3); | ||
} | ||
}()); |
10 changes: 10 additions & 0 deletions
10
JSTests/microbenchmarks/string-replace-one-char-long-string-string-string.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,10 @@ | ||
|
||
function test(str) { | ||
return str.replace('h', "abc"); | ||
} | ||
noInline(test); | ||
|
||
let str = (-1).toLocaleString().padEnd(315241, "hello "); | ||
for (let i = 0; i < 1e2; i++) { | ||
test(str); | ||
} |
10 changes: 10 additions & 0 deletions
10
JSTests/microbenchmarks/string-replace-one-char-short-string-string-string.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,10 @@ | ||
|
||
function test(str) { | ||
return str.replace('h', "abc"); | ||
} | ||
noInline(test); | ||
|
||
let str = (-1).toLocaleString().padEnd(296, "hello "); | ||
for (let i = 0; i < 1e4; i++) { | ||
test(str); | ||
} |
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
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,109 @@ | ||
function shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
{ | ||
let source = new Array(0); | ||
let result = source.concat(); | ||
shouldBe(result.length, 0); | ||
} | ||
|
||
{ | ||
let source = new Array(2); | ||
source[0] = 42; | ||
source[1] = 43; | ||
let result = source.concat(); | ||
shouldBe(result.length, 2); | ||
shouldBe(result[0], 42); | ||
shouldBe(result[1], 43); | ||
} | ||
|
||
{ | ||
let source = new Array(2); | ||
source[0] = 42.195; | ||
source[1] = 43.195; | ||
let result = source.concat(); | ||
shouldBe(result.length, 2); | ||
shouldBe(result[0], 42.195); | ||
shouldBe(result[1], 43.195); | ||
} | ||
|
||
{ | ||
let source = new Array(6); | ||
let result = source.concat(); | ||
shouldBe(result.length, 6); | ||
for (var i = 0; i < result.length; ++i) { | ||
shouldBe(result.hasOwnProperty(i), false); | ||
shouldBe(result[i], undefined); | ||
} | ||
} | ||
|
||
{ | ||
let source = new Array(6); | ||
source[0] = 42; | ||
let result = source.concat(); | ||
shouldBe(result.length, 6); | ||
for (var i = 0; i < result.length; ++i) { | ||
if (i === 0) { | ||
shouldBe(result.hasOwnProperty(i), true); | ||
shouldBe(result[i], 42); | ||
} else { | ||
shouldBe(result.hasOwnProperty(i), false); | ||
shouldBe(result[i], undefined); | ||
} | ||
} | ||
} | ||
|
||
{ | ||
let source = new Array(6); | ||
source[0] = 42.195; | ||
let result = source.concat(); | ||
shouldBe(result.length, 6); | ||
for (var i = 0; i < result.length; ++i) { | ||
if (i === 0) { | ||
shouldBe(result.hasOwnProperty(i), true); | ||
shouldBe(result[i], 42.195); | ||
} else { | ||
shouldBe(result.hasOwnProperty(i), false); | ||
shouldBe(result[i], undefined); | ||
} | ||
} | ||
} | ||
|
||
{ | ||
let source = new Array(6); | ||
source[0] = "string"; | ||
let result = source.concat(); | ||
shouldBe(result.length, 6); | ||
for (var i = 0; i < result.length; ++i) { | ||
if (i === 0) { | ||
shouldBe(result.hasOwnProperty(i), true); | ||
shouldBe(result[i], "string"); | ||
} else { | ||
shouldBe(result.hasOwnProperty(i), false); | ||
shouldBe(result[i], undefined); | ||
} | ||
} | ||
} | ||
|
||
{ | ||
let source = new Array(6); | ||
source[0] = "string"; | ||
$vm.ensureArrayStorage(source); | ||
source[1000] = "Hello"; | ||
let result = source.concat(); | ||
shouldBe(result.length, 1001); | ||
for (var i = 0; i < result.length; ++i) { | ||
if (i === 0) { | ||
shouldBe(result.hasOwnProperty(i), true); | ||
shouldBe(result[i], "string"); | ||
} else if (i === 1000) { | ||
shouldBe(result.hasOwnProperty(i), true); | ||
shouldBe(result[i], "Hello"); | ||
} else { | ||
shouldBe(result.hasOwnProperty(i), false); | ||
shouldBe(result[i], undefined); | ||
} | ||
} | ||
} |
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 shouldBe(actual, expected) { | ||
if (actual !== expected) | ||
throw new Error('bad value: ' + actual); | ||
} | ||
|
||
let constructorCallCount = 0; | ||
function Constructor() { | ||
constructorCallCount++; | ||
return {}; | ||
} | ||
|
||
const array = [1, 2, 3]; | ||
array.constructor = { [Symbol.species]: Constructor }; | ||
|
||
const result = array.concat(); | ||
|
||
shouldBe(constructorCallCount, 1); | ||
shouldBe(Object.getPrototypeOf(result) === Array.prototype, false); | ||
shouldBe(result[0], 1); | ||
shouldBe(result[1], 2); | ||
shouldBe(result[2], 3); |
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 sameValue(a, b) { | ||
if (a !== b) | ||
throw new Error(`Expected ${b} but got ${a}`); | ||
} | ||
|
||
const arr = [0, 1, 2]; | ||
|
||
let get0Count = 0; | ||
Object.defineProperty(arr, "0", { | ||
get() { | ||
get0Count++; | ||
return 0; | ||
} | ||
}); | ||
|
||
arr.with(1, 2); | ||
sameValue(get0Count, 1); | ||
arr.with(2, 2); | ||
sameValue(get0Count, 2); | ||
arr.with(0, 2); | ||
sameValue(get0Count, 2); |
Oops, something went wrong.