mirror of
https://github.com/tc39/test262.git
synced 2025-05-03 14:30:27 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
58 lines
1.5 KiB
JavaScript
58 lines
1.5 KiB
JavaScript
function assertEq(a, b) {
|
|
if (a !== b)
|
|
throw new Error("values not the same: " + a + " and " + b);
|
|
}
|
|
|
|
function withArrayArgInt32(i, array) {
|
|
let result = array[i];
|
|
assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithInt32");
|
|
}
|
|
noInline(withArrayArgInt32);
|
|
|
|
function withArrayLiteralInt32(i) {
|
|
let array = [0,1,2];
|
|
let result = array[i];
|
|
assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithInt32");
|
|
}
|
|
noInline(withArrayLiteralInt32);
|
|
|
|
|
|
function withArrayArgDouble(i, array) {
|
|
let result = array[i];
|
|
assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithDouble");
|
|
}
|
|
noInline(withArrayArgDouble);
|
|
|
|
function withArrayLiteralDouble(i) {
|
|
let array = [0,1.3145,2];
|
|
let result = array[i];
|
|
assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithDouble");
|
|
}
|
|
noInline(withArrayLiteralDouble);
|
|
|
|
function withArrayArgContiguous(i, array) {
|
|
let result = array[i];
|
|
assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithContiguous");
|
|
}
|
|
noInline(withArrayArgContiguous);
|
|
|
|
function withArrayLiteralContiguous(i) {
|
|
let array = [0,"string",2];
|
|
let result = array[i];
|
|
assertEq($vm.indexingMode(array), "CopyOnWriteArrayWithContiguous");
|
|
}
|
|
noInline(withArrayLiteralContiguous);
|
|
|
|
function test() {
|
|
withArrayArgInt32(0, [0,1,2]);
|
|
withArrayArgDouble(0, [0,1.3145,2]);
|
|
withArrayArgContiguous(0, [0,"string",2]);
|
|
|
|
withArrayLiteralInt32(0);
|
|
withArrayLiteralDouble(0);
|
|
withArrayLiteralContiguous(0);
|
|
}
|
|
|
|
for (let i = 0; i < 10000; i++)
|
|
test();
|