[javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha 344dd04163 on Thu Jan 17 2019 19:31:25 GMT+0000 (Coordinated Universal Time)

This commit is contained in:
test262-automation 2019-01-17 19:35:14 +00:00
parent 5331ca05a2
commit 7a0293f26c
40 changed files with 1059 additions and 2 deletions

View File

@ -0,0 +1,14 @@
//@ runDefault("--jitPolicyScale=0")
function compareArray(a, b) {
if (b.length !== a.length) {
return;
}
for (var i = 0; i < a.length; i++) {
b[0];
}
}
compareArray([], [0]);
compareArray([0, 'b'].copyWithin(), ['a', 0]);
compareArray([0], [1.1]);
runString('');
for (var i = 0; i < 1e6; ++i);

View File

@ -0,0 +1,21 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
for (var i = 0; i < 1e5; ++i) {
shouldThrow(() => {
new (class extends Array { static get [Symbol.species]() { return makeMasquerader(); } })(1, 2, 3).flat().constructor
}, `TypeError: Masquerader is not a constructor`);
}

View File

@ -0,0 +1,50 @@
//@ runBigIntEnabled
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
var counter = 0;
BigInt.prototype.toJSON = function () {
++counter;
return Number(String(this));
};
shouldBe(JSON.stringify(0n), `0`);
shouldBe(counter, 1);
shouldBe(JSON.stringify([0n]), `[0]`);
shouldBe(counter, 2);
shouldBe(JSON.stringify({hello:0n}), `{"hello":0}`);
shouldBe(counter, 3);
var bigIntObject = Object(0n);
shouldBe(JSON.stringify(bigIntObject), `0`);
shouldBe(counter, 4);
shouldBe(JSON.stringify([bigIntObject]), `[0]`);
shouldBe(counter, 5);
shouldBe(JSON.stringify({hello:bigIntObject}), `{"hello":0}`);
shouldBe(counter, 6);

View File

@ -0,0 +1,52 @@
//@ runBigIntEnabled
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
shouldThrow(() => {
JSON.stringify(0n);
}, `TypeError: JSON.stringify cannot serialize BigInt.`);
shouldThrow(() => {
JSON.stringify([0n]);
}, `TypeError: JSON.stringify cannot serialize BigInt.`);
shouldThrow(() => {
JSON.stringify({hello:0n});
}, `TypeError: JSON.stringify cannot serialize BigInt.`);
var bigIntObject = Object(0n);
shouldThrow(() => {
JSON.stringify(bigIntObject);
}, `TypeError: JSON.stringify cannot serialize BigInt.`);
shouldThrow(() => {
JSON.stringify([bigIntObject]);
}, `TypeError: JSON.stringify cannot serialize BigInt.`);
shouldThrow(() => {
JSON.stringify({hello:bigIntObject});
}, `TypeError: JSON.stringify cannot serialize BigInt.`);

View File

@ -0,0 +1,21 @@
//@ runBigIntEnabled
var assert = {
sameValue: function (input, expected) {
if (input !== expected)
throw new Error('Expected: ' + expected + ' but got: ' + input);
}
};
var x = {y:1n}
assert.sameValue(x.y, 1n);
x = {y:{z:1n}};
assert.sameValue(x.y.z, 1n);
x = {y:-1212n}
assert.sameValue(x.y, -1212n);
x = {y:{z:-22312n}};
assert.sameValue(x.y.z, -22312n);

View File

@ -0,0 +1,38 @@
//@ skip if not $jitTests
function assert(a, e) {
if (a !== e)
throw new Error("Expected: " + e + " but got: " + a);
}
function bitAnd(a, b) {
return a & b;
}
noInline(bitAnd);
var o = { valueOf: () => 0b1101 };
for (var i = 0; i < 10000; i++)
assert(bitAnd(0b11, o), 0b1);
assert(numberOfDFGCompiles(bitAnd) <= 1, true);
function bitOr(a, b) {
return a | b;
}
noInline(bitOr);
for (var i = 0; i < 10000; i++)
assert(bitOr(0b11, o), 0b1111);
assert(numberOfDFGCompiles(bitOr) <= 1, true);
function bitXor(a, b) {
return a ^ b;
}
noInline(bitXor);
for (var i = 0; i < 10000; i++)
assert(bitXor(0b0011, o), 0b1110);
assert(numberOfDFGCompiles(bitXor) <= 1, true);

View File

@ -0,0 +1,11 @@
//@ runDefault("--forceEagerCompilation=1", "--useConcurrentJIT=0")
function foo(x) {
x.toString();
}
var a = new String();
a.valueOf = 0
for (var i = 0; i < 5; i++) {
foo(a)
}

View File

@ -0,0 +1,49 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
function foo() {
bar = 4;
}
function get() {
return bar;
}
for (var i = 0; i < 1e6; ++i)
foo();
for (var i = 0; i < 1e6; ++i)
shouldBe(get(), 4);
shouldBe(bar, 4);
$.evalScript('const bar = 3;');
shouldBe(bar, 3);
shouldBe(get(), 3);
for (var i = 0; i < 1e6; ++i)
shouldBe(get(), 3);
shouldThrow(() => {
foo();
}, `TypeError: Attempted to assign to readonly property.`);
shouldBe(bar, 3);
shouldBe(get(), 3);
for (var i = 0; i < 1e6; ++i)
shouldBe(get(), 3);

View File

@ -0,0 +1,53 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
function foo() {
bar = 4;
}
function get() {
return bar;
}
for (var i = 0; i < 1e6; ++i)
foo();
for (var i = 0; i < 1e6; ++i)
shouldBe(get(), 4);
shouldBe(bar, 4);
shouldThrow(() => {
$.evalScript('get(); const bar = 3;');
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
shouldBe(bar, 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
shouldBe(get(), 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
$.evalScript('bar;');
}, `ReferenceError: Cannot access uninitialized variable.`);
for (var i = 0; i < 1e3; ++i) {
shouldThrow(() => {
shouldBe(get(), 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
}

View File

@ -0,0 +1,44 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
function foo() {
bar = 4;
}
function get() {
return bar;
}
foo();
shouldBe(get(), 4);
shouldBe(bar, 4);
shouldThrow(() => {
$.evalScript('get(); const bar = 3;');
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
shouldBe(bar, 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
shouldBe(get(), 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
$.evalScript('bar;');
}, `ReferenceError: Cannot access uninitialized variable.`);

View File

@ -0,0 +1,33 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
function foo() {
bar = 4;
}
foo();
shouldBe(bar, 4);
$.evalScript('const bar = 3;');
shouldBe(bar, 3);
shouldThrow(() => {
foo();
}, `TypeError: Attempted to assign to readonly property.`);
shouldBe(bar, 3);

View File

@ -0,0 +1,36 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
bar = 0;
function foo(code) {
eval(code);
return (function () {
return bar;
}());
}
shouldBe(foo(`42`), 0);
$.evalScript(`const bar = 42`);
shouldBe(foo(`42`), 42);
shouldBe(foo(`var bar = 1`), 1);
shouldBe(foo(`42`), 42);

View File

@ -0,0 +1,15 @@
var invokeCount = 0;
Object.defineProperty(Function.prototype, 'prototype', {
get: function () {
invokeCount++;
}
});
new Promise(resolve => {
for (var i = 0; i < 10000; ++i)
new resolve();
if (invokeCount != 10000)
$vm.crash();
});

View File

@ -0,0 +1,15 @@
new Promise(resolve => {
var invokeCount = 0;
Object.defineProperty(resolve, 'prototype', {
get: function () {
invokeCount++;
}
});
for (var i = 0; i < 10000; ++i)
new resolve();
if (invokeCount != 10000)
$vm.crash();
});

View File

@ -0,0 +1,19 @@
//@ runDefault("--useConcurrentJIT=0", "--usePutStackSinking=0")
function foo() {
var args1 = function () {
return arguments;
}();
var args2 = function () {
var result = arguments;
result.length = 1;
return result;
}(1);
for (var i = 0; i < 10000000; ++i) {
args1.length;
args2.length;
}
}
foo();
foo();
foo();

View File

@ -0,0 +1,12 @@
//@ runDefault("--useConcurrentJIT=0")
forEach({ length: 5 }, function() {
for (var i = 0; i < 10; i++) {
forEach([1], function() {});
}
});
function forEach(a, b) {
for (var c = 0; c < a.length; c++)
b();
}

View File

@ -0,0 +1,18 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
shouldThrow(() => {
$.evalScript(`const shouldThrow = 42`);
}, `SyntaxError: Can't create duplicate variable that shadows a global property: 'shouldThrow'`);

View File

@ -0,0 +1,18 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
shouldThrow(() => {
$.evalScript(`const NaN = 42`);
}, `SyntaxError: Can't create duplicate variable that shadows a global property: 'NaN'`);

View File

@ -0,0 +1,26 @@
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
var isUndefinedOrNull = $vm.createBuiltin(`(function (value) { return @isUndefinedOrNull(value); })`);
noInline(isUndefinedOrNull);
var masquerader = makeMasquerader();
for (var i = 0; i < 1e5; ++i) {
shouldBe(isUndefinedOrNull(null), true);
shouldBe(isUndefinedOrNull(undefined), true);
shouldBe(isUndefinedOrNull("Hello"), false);
shouldBe(isUndefinedOrNull(Symbol("Hello")), false);
shouldBe(isUndefinedOrNull(42), false);
shouldBe(isUndefinedOrNull(-42), false);
shouldBe(isUndefinedOrNull(0), false);
shouldBe(isUndefinedOrNull(-0), false);
shouldBe(isUndefinedOrNull(42.2), false);
shouldBe(isUndefinedOrNull(-42.2), false);
shouldBe(isUndefinedOrNull({}), false);
shouldBe(isUndefinedOrNull([]), false);
shouldBe(isUndefinedOrNull(true), false);
shouldBe(isUndefinedOrNull(masquerader), false);
}

View File

@ -0,0 +1,9 @@
Object.defineProperty(Function.prototype, 'prototype', {
get: function () {
throw new Error('hello');
}
});
new Promise(resolve => {
new resolve();
});

View File

@ -0,0 +1,14 @@
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
shouldBe(JSON.stringify('𝌆'), `"𝌆"`);
shouldBe(JSON.stringify('\uD834\uDF06'), `"𝌆"`);
shouldBe(JSON.stringify('\uD834'), `"\\ud834"`);
shouldBe(JSON.stringify('\uDF06'), `"\\udf06"`);
shouldBe(JSON.stringify('\uDF06\uD834'), `"\\udf06\\ud834"`);
shouldBe(JSON.stringify('\uDEAD'), `"\\udead"`);
shouldBe(JSON.stringify('\uD834\uD834\uDF06'), `"\\ud834𝌆"`);
shouldBe(JSON.stringify('\uD834a'), `"\\ud834a"`);
shouldBe(JSON.stringify('\uD834\u0400'), `"\\ud834Ѐ"`);

View File

@ -0,0 +1,47 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
function foo() {
bar = 4;
}
function get() {
return bar;
}
for (var i = 0; i < 1e6; ++i)
foo();
for (var i = 0; i < 1e6; ++i)
shouldBe(get(), 4);
shouldBe(bar, 4);
$.evalScript('let bar = 3;');
shouldBe(bar, 3);
shouldBe(get(), 3);
for (var i = 0; i < 1e6; ++i)
shouldBe(get(), 3);
foo();
shouldBe(bar, 4);
shouldBe(get(), 4);
for (var i = 0; i < 1e6; ++i)
shouldBe(get(), 4);

View File

@ -0,0 +1,53 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
function foo() {
bar = 4;
}
function get() {
return bar;
}
for (var i = 0; i < 1e6; ++i)
foo();
for (var i = 0; i < 1e6; ++i)
shouldBe(get(), 4);
shouldBe(bar, 4);
shouldThrow(() => {
$.evalScript('get(); let bar = 3;');
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
shouldBe(bar, 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
shouldBe(get(), 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
$.evalScript('bar;');
}, `ReferenceError: Cannot access uninitialized variable.`);
for (var i = 0; i < 1e3; ++i) {
shouldThrow(() => {
shouldBe(get(), 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
}

View File

@ -0,0 +1,44 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
function foo() {
bar = 4;
}
function get() {
return bar;
}
foo();
shouldBe(get(), 4);
shouldBe(bar, 4);
shouldThrow(() => {
$.evalScript('get(); let bar = 3;');
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
shouldBe(bar, 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
shouldBe(get(), 3);
}, `ReferenceError: Cannot access uninitialized variable.`);
shouldThrow(() => {
$.evalScript('bar;');
}, `ReferenceError: Cannot access uninitialized variable.`);

View File

@ -0,0 +1,31 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
function foo() {
bar = 4;
}
foo();
shouldBe(bar, 4);
$.evalScript('let bar = 3;');
shouldBe(bar, 3);
foo();
shouldBe(bar, 4);

View File

@ -0,0 +1,36 @@
function shouldThrow(func, errorMessage) {
var errorThrown = false;
var error = null;
try {
func();
} catch (e) {
errorThrown = true;
error = e;
}
if (!errorThrown)
throw new Error('not thrown');
if (String(error) !== errorMessage)
throw new Error(`bad error: ${String(error)}`);
}
noInline(shouldThrow);
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
noInline(shouldBe);
bar = 0;
function foo(code) {
eval(code);
return (function () {
return bar;
}());
}
shouldBe(foo(`42`), 0);
$.evalScript(`let bar = 42`);
shouldBe(foo(`42`), 42);
shouldBe(foo(`var bar = 1`), 1);
shouldBe(foo(`42`), 42);

View File

@ -0,0 +1,18 @@
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
function test(value)
{
return Object.prototype.toString.call(value);
}
noInline(test);
var object = {};
for (var i = 0; i < 1e5; ++i)
shouldBe(test(object), `[object Object]`);
Object.prototype[Symbol.toStringTag] = "Hello";
shouldBe(test(object), `[object Hello]`);

View File

@ -0,0 +1,18 @@
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
function test(value)
{
return Object.prototype.toString.call(value);
}
noInline(test);
var object = {};
for (var i = 0; i < 1e5; ++i)
shouldBe(test(object), `[object Object]`);
object[Symbol.toStringTag] = "Hello";
shouldBe(test(object), `[object Hello]`);

View File

@ -0,0 +1,26 @@
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
function test(value)
{
return Object.prototype.toString.call(value);
}
noInline(test);
for (var i = 0; i < 1e6; ++i) {
switch (i % 3) {
case 0:
shouldBe(test(null), `[object Null]`);
break;
case 1:
shouldBe(test(undefined), `[object Undefined]`);
break;
case 2:
shouldBe(test(true), `[object Boolean]`);
break;
}
}

View File

@ -0,0 +1,19 @@
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
function test(value)
{
return Object.prototype.toString.call(value);
}
noInline(test);
for (var i = 0; i < 1e6; ++i) {
if (i & 0x1)
shouldBe(test(null), `[object Null]`);
else
shouldBe(test(undefined), `[object Undefined]`);
}

View File

@ -0,0 +1,50 @@
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
function test(value)
{
return Object.prototype.toString.call(value);
}
noInline(test);
var value0 = {};
var value1 = { [Symbol.toStringTag]: "Hello" };
var value2 = new Date();
var value3 = "Hello";
var value4 = 42;
var value5 = Symbol("Cocoa");
var value6 = 42.195;
var value7 = false;
for (var i = 0; i < 1e6; ++i) {
switch (i % 8) {
case 0:
shouldBe(test(value0), `[object Object]`);
break;
case 1:
shouldBe(test(value1), `[object Hello]`);
break;
case 2:
shouldBe(test(value2), `[object Date]`);
break;
case 3:
shouldBe(test(value3), `[object String]`);
break;
case 4:
shouldBe(test(value4), `[object Number]`);
break;
case 5:
shouldBe(test(value5), `[object Symbol]`);
break;
case 6:
shouldBe(test(value6), `[object Number]`);
break;
case 7:
shouldBe(test(value7), `[object Boolean]`);
break;
}
}

View File

@ -0,0 +1,23 @@
function f(x, y) {
x.y = y;
};
function g(x) {
return x.y + 42;
}
noInline(f);
noInline(g);
var x = {};
var y = {};
f(x, 42);
f(y, {});
while (!numberOfDFGCompiles(g)) {
optimizeNextInvocation(g);
if (typeof g(x) !== 'number')
throw 'failed warming up';
}
if (typeof g(y) !== 'string')
throw 'failed after compilation';

View File

@ -1,4 +1,4 @@
//@ skip if $hostOS != "darwin" or $architecture == "arm" or $architecture == "x86"
//@ skip if $hostOS != "darwin" or $architecture == "arm" or $architecture == "x86" or not $jitTests
// Test that throw an OOM exception when compiling a pathological, but valid nested RegExp.
var failures = [];

View File

@ -1,5 +1,5 @@
//@ runDefault("--useLLInt=false", "--forceCodeBlockToJettisonDueToOldAge=true", "--maxPerThreadStackUsage=200000", "--exceptionStackTraceLimit=1", "--defaultErrorStackTraceLimit=1")
//@ skip if $memoryLimited or $buildType == "debug"
//@ runDefault("--useLLInt=false", "--forceCodeBlockToJettisonDueToOldAge=true", "--maxPerThreadStackUsage=200000", "--exceptionStackTraceLimit=1", "--defaultErrorStackTraceLimit=1")
let foo = 'let a';
for (let i = 0; i < 400000; i++)

View File

@ -0,0 +1,17 @@
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
noInline(shouldBe);
function test(value)
{
return value[2];
}
noInline(test);
for (var i = 0; i < 1e4; ++i) {
shouldBe(test("Hello"), 'l');
shouldBe(test("World"), 'r');
shouldBe(test("Nice"), 'c');
}

View File

@ -1,3 +1,4 @@
//@ skip if $memoryLimited
var exception;
try {
bar = '2.3023e-320'

View File

@ -0,0 +1,10 @@
function thisA() {
return this.a
}
function thisAStrictWrapper() {
'use strict';
thisA.apply(this);
}
let x = false;
for (let j=0; j<1e4; j++)
thisAStrictWrapper.call(x);

View File

@ -0,0 +1,53 @@
//@ skip if not $jitTests
function __isPropertyOfType(obj, name, type) {
desc = Object.getOwnPropertyDescriptor(obj, name)
return typeof type === 'undefined' || typeof desc.value === type;
}
function __getProperties(obj, type) {
let properties = [];
for (let name of Object.getOwnPropertyNames(obj)) {
if (__isPropertyOfType(obj, name, type)) properties.push(name);
}
let proto = Object.getPrototypeOf(obj);
while (proto && proto != Object.prototype) {
Object.getOwnPropertyNames(proto).forEach(name => {
});
proto = Object.getPrototypeOf(proto);
}
return properties;
}
function* __getObjects(root = this, level = 0) {
if (level > 4) return;
let obj_names = __getProperties(root, 'object');
for (let obj_name of obj_names) {
let obj = root[obj_name];
yield* __getObjects(obj, level + 1);
}
}
function __getRandomObject() {
for (let obj of __getObjects()) {
}
}
var theClass = class {
constructor() {
if (242487 != null && typeof __getRandomObject() == "object") try {
} catch (e) {}
}
};
var childClass = class Class extends theClass {
constructor() {
var arrow = () => {
try {
super();
} catch (e) {}
this.idValue
};
arrow()()();
}
};
for (var counter = 0; counter < 1000; counter++) {
try {
new childClass();
} catch (e) {}
}

View File

@ -0,0 +1,25 @@
//@ runDefault("--jitPolicyScale=0")
// Run with for i in {1..1000}; do echo $i && VM=/path/to/WebKit/WebKitBuild/Debug/ && DYLD_FRAMEWORK_PATH=$VM $VM/jsc --useDollarVM=1 --jitPolicyScale=0 type-for-get-by-val-can-be-widen-after-ai.js ; done
function Hello(y) {
this.y = y;
this.x = foo(this.y);
}
function foo(z) {
try {
for (var i = 0; i < 1; i++) {
z[i];
}
} catch {
}
}
new Hello('a');
new Hello('a');
for (let i = 0; i < 100; ++i) {
new Hello();
}
// Busy loop to let the crash reporter have a chance to capture the crash log for the Compiler thread.
for (let i = 0; i < 1000000; ++i) {
$vm.ftlTrue();
}

View File

@ -0,0 +1,18 @@
function foo(o) {
for (var i = 0; i < 100; ++i) {
o.f = o.f;
}
}
let typedArrays = [
Uint8Array,
Uint32Array,
Uint8Array,
];
for (let constructor of typedArrays) {
let a = new constructor(0);
for (let i = 0; i < 10000; i++) {
foo(a);
}
}