[javascriptcore-test262-automation] Changes from https://github.com/webkit/webkit.git at sha 5bbf629de8 on Fri Oct 19 2018 18:41:28 GMT+0000 (Coordinated Universal Time)

This commit is contained in:
test262-automation 2018-10-19 18:44:18 +00:00 committed by Rick Waldron
parent 3936950114
commit 7e43d64794
4 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,19 @@
//@ runBigIntEnabled
let assert = {
sameValue: function(i, e, m) {
if (i !== e)
throw new Error(m);
}
}
function bigIntAddition(x, y) {
return x - y - 1n;
}
noInline(bigIntAddition);
for (let i = 0; i < 10000; i++) {
let r = bigIntAddition(3n, 10n);
assert.sameValue(r, -8n, 3n + " - " + 10n + " - 1 = " + r);
}

View File

@ -0,0 +1,18 @@
//@ runBigIntEnabled
function assert(v, e) {
if (v !== e)
throw new Error("Expected value: " + e + " but got: " + v)
}
function bigIntPropagation(a, b) {
let c = a - b;
return c - 0n;
}
noInline(bigIntPropagation);
for (let i = 0; i < 100000; i++) {
let out = bigIntPropagation(0xffffffffffffffffffffffffffffffn, 0x1n);
assert(out, 0xfffffffffffffffffffffffffffffen)
}

View File

@ -0,0 +1,26 @@
//@ runBigIntEnabled
function assert(v, e) {
if (v !== e)
throw new Error("Expected value: " + e + " but got: " + v)
}
function bigIntOperations(a, b) {
let c = a - b;
return a - c;
}
noInline(bigIntOperations);
c = 0;
let o = { valueOf: function () {
c++;
return 0b1111n;
}};
for (let i = 0; i < 100000; i++) {
let out = bigIntOperations(o, 0b1010n);
assert(out, 10n);
}
assert(c, 200000);

View File

@ -0,0 +1,22 @@
function assert(a, e) {
if (a !== e)
throw new Error("Bad");
}
function valueSub() {
let sum = 0;
do {
// We trigger the JIT compilation of valueSub
// so Date.now() will have SpecNone as result
for (let i = 0; i < 10000; i++)
sum++;
sum += 0.5;
} while (Date.now() - sum < 0);
assert(sum, 10000.5);
}
noInline(valueSub);
valueSub();