Backed out changeset db6f7a903c64 (bug 1651725) for spidermonkey bustage on /basic.js. CLOSED TREE

This commit is contained in:
Csoregi Natalia 2020-09-10 19:43:00 +03:00
Родитель b46701e328
Коммит 67eb265e55
12 изменённых файлов: 15 добавлений и 132 удалений

Просмотреть файл

@ -763,17 +763,3 @@ def can_build_data_file(yasm, gnu_as, target, compile_environment):
if not yasm and not gnu_as:
die('Building ICU requires either yasm or a GNU assembler. If you do not have '
'either of those available for this platform you must use --without-intl-api')
# Initial support for WebAssembly JS-API Type Reflections
# =======================================================
@depends(milestone.is_nightly)
def default_wasm_type_reflections(is_nightly):
return is_nightly
js_option('--enable-wasm-type-reflections',
default=default_wasm_type_reflections,
help='Enable type reflection in WASM JS-API')
set_config('ENABLE_WASM_TYPE_REFLECTIONS', depends_if('--enable-wasm-type-reflections')(lambda x: True))
set_define('ENABLE_WASM_TYPE_REFLECTIONS', depends_if('--enable-wasm-type-reflections')(lambda x: True))

Просмотреть файл

@ -454,9 +454,6 @@ MSG_DEF(JSMSG_WASM_TYPEREF_FROM_JS, 0, JSEXN_TYPEERR, "conversion from Ja
MSG_DEF(JSMSG_WASM_TYPEREF_TO_JS, 0, JSEXN_TYPEERR, "conversion from WebAssembly typed ref to JavaScript value unimplemented")
MSG_DEF(JSMSG_WASM_WRONG_NUMBER_OF_VALUES, 2, JSEXN_TYPEERR, "wrong number of values returned by JavaScript to WebAssembly (expected {0}, got {1})")
MSG_DEF(JSMSG_WASM_NONSHARED_WAIT , 0, JSEXN_WASMRUNTIMEERROR, "atomic wait on non-shared memory")
MSG_DEF(JSMSG_WASM_NULL_REQUIRED, 0, JSEXN_TYPEERR, "nullref requires a null value")
MSG_DEF(JSMSG_WASM_SUPPLY_ONLY_ONE, 2, JSEXN_TYPEERR, "exactly one of {0} and {1} must be supplied")
MSG_DEF(JSMSG_WASM_MISSING_REQUIRED, 1, JSEXN_TYPEERR, "Missing required argument {0}")
// Proxy
MSG_DEF(JSMSG_BAD_TRAP_RETURN_VALUE, 2, JSEXN_TYPEERR,"trap {1} for {0} returned a primitive value")

Просмотреть файл

@ -119,11 +119,6 @@ wasmEvalText('(module (import "a" "" (func $foo (result f64))))', {a:{"":()=>{}}
wasmValidateText('(module (memory 0))');
wasmValidateText('(module (memory 1))');
wasmValidateText('(module (memory 16384))');
wasmFailValidateText('(module (memory 16385))', /minimum memory size too big/);
wasmEvalText('(module (memory 0 65536))')
wasmFailValidateText('(module (memory 0 65537))', /maximum memory size too big/);
var buf = wasmEvalText('(module (memory 1) (export "memory" (memory 0)))').exports.memory.buffer;
assertEq(buf instanceof ArrayBuffer, true);

Просмотреть файл

@ -911,8 +911,7 @@ static bool GetLimits(JSContext* cx, HandleObject obj, uint32_t maximumField,
}
uint32_t initial = 0;
if (!initialVal.isUndefined() &&
!EnforceRangeU32(cx, initialVal, kind, "initial size", &initial)) {
if (!EnforceRangeU32(cx, initialVal, kind, "initial size", &initial)) {
return false;
}
limits->initial = initial;
@ -923,30 +922,6 @@ static bool GetLimits(JSContext* cx, HandleObject obj, uint32_t maximumField,
return false;
}
#ifdef ENABLE_WASM_TYPE_REFLECTIONS
// Get minimum parameter.
JSAtom* minimumAtom = Atomize(cx, "minimum", strlen("minimum"));
if (!minimumAtom) {
return false;
}
RootedId minimumId(cx, AtomToId(minimumAtom));
RootedValue minimumVal(cx);
if (!GetProperty(cx, obj, obj, minimumId, &minimumVal)) {
return false;
}
uint32_t minimum = 0;
if (!minimumVal.isUndefined() &&
!EnforceRangeU32(cx, minimumVal, kind, "initial size", &minimum)) {
return false;
}
if (!minimumVal.isUndefined()) {
limits->initial = minimum;
}
#endif
// Get maximum parameter.
JSAtom* maximumAtom = Atomize(cx, "maximum", strlen("maximum"));
if (!maximumAtom) {
return false;
@ -1010,21 +985,6 @@ static bool GetLimits(JSContext* cx, HandleObject obj, uint32_t maximumField,
}
}
#ifdef ENABLE_WASM_TYPE_REFLECTIONS
// Check both minimum and initial are not supplied.
if (minimumVal.isUndefined() == initialVal.isUndefined()) {
JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr,
JSMSG_WASM_SUPPLY_ONLY_ONE, "minimum", "initial");
return false;
}
#else
if (initialVal.isUndefined()) {
JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr,
JSMSG_WASM_MISSING_REQUIRED, "initial");
return false;
}
#endif
return true;
}
@ -2158,6 +2118,7 @@ bool WasmMemoryObject::construct(JSContext* cx, unsigned argc, Value* vp) {
JSMSG_WASM_MEM_IMP_LIMIT);
return false;
}
ConvertMemoryPagesToBytes(&limits);
RootedArrayBufferObjectMaybeShared buffer(cx);

Просмотреть файл

@ -1859,7 +1859,7 @@ static bool DecodeLimits(Decoder& d, Limits* limits,
if (limits->initial > maximum) {
return d.failf(
"memory size initial must not be greater than maximum; "
"memory size minimum must not be greater than maximum; "
"maximum length %" PRIu32 " is less than initial length %" PRIu64,
maximum, limits->initial);
}

Просмотреть файл

@ -1,3 +0,0 @@
[constructor-types.tentative.any.js]
expected:
if release_or_beta: FAIL

Просмотреть файл

@ -1,3 +0,0 @@
[constructor-types.tentative.any.js]
expected:
if release_or_beta: FAIL

Просмотреть файл

@ -1,20 +0,0 @@
// META: global=jsshell
// META: script=/wasm/jsapi/assertions.js
// META: script=/wasm/jsapi/memory/assertions.js
test(() => {
const argument = { initial: 5, minimum: 6 };
assert_throws_js(TypeError, () => new WebAssembly.Memory(argument));
}, "Initializing with both initial and minimum");
test(() => {
const argument = { minimum: 0 };
const memory = new WebAssembly.Memory(argument);
assert_Memory(memory, { "size": 0 });
}, "Zero minimum");
test(() => {
const argument = { minimum: 4 };
const memory = new WebAssembly.Memory(argument);
assert_Memory(memory, { "size": 4 });
}, "Non-zero minimum");

Просмотреть файл

@ -72,16 +72,7 @@ test(() => {
assert_unreached(`Should not call [[HasProperty]] with ${x}`);
},
get(o, x) {
// Due to the requirement not to supply both minimum and initial, we need to ignore one of them.
switch (x) {
case "shared":
return false;
case "minimum":
case "maximum":
return 0;
default:
return undefined;
}
return 0;
},
});
new WebAssembly.Memory(proxy);

Просмотреть файл

@ -11,14 +11,3 @@ function assert_equal_to_array(table, expected, message) {
assert_throws_js(RangeError, () => table.get(expected.length + 1),
`${message}: table.get(${expected.length + 1} of ${expected.length})`);
}
function assert_Table(actual, expected) {
assert_equals(Object.getPrototypeOf(actual), WebAssembly.Table.prototype,
"prototype");
assert_true(Object.isExtensible(actual), "extensible");
assert_equals(actual.length, expected.length, "length");
for (let i = 0; i < expected.length; ++i) {
assert_equals(actual.get(i), null, `actual.get(${i})`);
}
}

Просмотреть файл

@ -1,20 +0,0 @@
// META: global=jsshell
// META: script=/wasm/jsapi/assertions.js
// META: script=/wasm/jsapi/table/assertions.js
test(() => {
const argument = { "element": "anyfunc", "initial": 0, "minimum": 0 };
assert_throws_js(TypeError, () => WebAssembly.Table(argument));
}, "Supplying both initial and minimum");
test(() => {
const argument = { "element": "anyfunc", "minimum": 0 };
const table = new WebAssembly.Table(argument);
assert_Table(table, { "length": 0 });
}, "Basic (zero, minimum)");
test(() => {
const argument = { "element": "anyfunc", "minimum": 5 };
const table = new WebAssembly.Table(argument);
assert_Table(table, { "length": 5 });
}, "Basic (non-zero, minimum)");

Просмотреть файл

@ -1,6 +1,16 @@
// META: global=window,dedicatedworker,jsshell
// META: script=/wasm/jsapi/assertions.js
// META: script=/wasm/jsapi/table/assertions.js
function assert_Table(actual, expected) {
assert_equals(Object.getPrototypeOf(actual), WebAssembly.Table.prototype,
"prototype");
assert_true(Object.isExtensible(actual), "extensible");
assert_equals(actual.length, expected.length, "length");
for (let i = 0; i < expected.length; ++i) {
assert_equals(actual.get(i), null, `actual.get(${i})`);
}
}
test(() => {
assert_function_name(WebAssembly.Table, "Table", "WebAssembly.Table");