Bug 1840642 - Refactor getRealmConfiguration and getBuildConfiguration r=mgaudet

This implementation allows for the old behavior, returning a plain
object, if these functions are given no argument, while providing the
new behavior, querying the build/realm configuration, if an argument is
given.

Differential Revision: https://phabricator.services.mozilla.com/D188788
This commit is contained in:
Vinny Diehl 2023-09-25 15:42:19 +00:00
Родитель 85c2d72afc
Коммит b6d5797728
345 изменённых файлов: 573 добавлений и 539 удалений

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

@ -188,10 +188,19 @@ static bool EnvVarAsInt(const char* name, int* valueOut) {
static bool GetRealmConfiguration(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
RootedObject callee(cx, &args.callee());
RootedObject info(cx, JS_NewPlainObject(cx));
if (!info) {
return false;
}
if (args.length() > 1) {
ReportUsageErrorASCII(cx, callee, "Must have zero or one arguments");
return false;
}
if (args.length() == 1 && !args[0].isString()) {
ReportUsageErrorASCII(cx, callee, "Argument must be a string");
return false;
}
bool importAssertions = cx->options().importAssertions();
if (!JS_SetProperty(cx, info, "importAssertions",
@ -215,16 +224,45 @@ static bool GetRealmConfiguration(JSContext* cx, unsigned argc, Value* vp) {
}
#endif
if (args.length() == 1) {
RootedString str(cx, ToString(cx, args[0]));
if (!str) {
return false;
}
RootedId id(cx);
if (!JS_StringToId(cx, str, &id)) {
return false;
}
bool hasProperty;
if (JS_HasPropertyById(cx, info, id, &hasProperty) && hasProperty) {
// Returning a true/false from GetProperty
return GetProperty(cx, info, info, id, args.rval());
}
ReportUsageErrorASCII(cx, callee, "Invalid option name");
return false;
}
args.rval().setObject(*info);
return true;
}
static bool GetBuildConfiguration(JSContext* cx, unsigned argc, Value* vp) {
CallArgs args = CallArgsFromVp(argc, vp);
RootedObject callee(cx, &args.callee());
RootedObject info(cx, JS_NewPlainObject(cx));
if (!info) {
return false;
}
if (args.length() > 1) {
ReportUsageErrorASCII(cx, callee, "Must have zero or one arguments");
return false;
}
if (args.length() == 1 && !args[0].isString()) {
ReportUsageErrorASCII(cx, callee, "Argument must be a string");
return false;
}
if (!JS_SetProperty(cx, info, "rooting-analysis", FalseHandleValue)) {
return false;
@ -580,6 +618,26 @@ static bool GetBuildConfiguration(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
if (args.length() == 1) {
RootedString str(cx, ToString(cx, args[0]));
if (!str) {
return false;
}
RootedId id(cx);
if (!JS_StringToId(cx, str, &id)) {
return false;
}
bool hasProperty;
if (JS_HasPropertyById(cx, info, id, &hasProperty) && hasProperty) {
// Returning a true/false from GetProperty
return GetProperty(cx, info, info, id, args.rval());
}
ReportUsageErrorASCII(cx, callee, "Invalid option name");
return false;
}
args.rval().setObject(*info);
return true;
}
@ -8771,15 +8829,15 @@ static const JSFunctionSpecWithHelp TestingFunctions[] = {
" Perform a GC and allow relazification of functions. Accepts the same\n"
" arguments as gc()."),
JS_FN_HELP("getBuildConfiguration", GetBuildConfiguration, 0, 0,
"getBuildConfiguration()",
" Return an object describing some of the configuration options SpiderMonkey\n"
" was built with."),
JS_FN_HELP("getBuildConfiguration", GetBuildConfiguration, 1, 0,
"getBuildConfiguration([option])",
" Query the options SpiderMonkey was built with, or return an object\n"
" with the options if no argument is given."),
JS_FN_HELP("getRealmConfiguration", GetRealmConfiguration, 0, 0,
"getRealmConfiguration()",
" Return an object describing some of the runtime options SpiderMonkey\n"
" is running with."),
JS_FN_HELP("getRealmConfiguration", GetRealmConfiguration, 1, 0,
"getRealmConfiguration([option])",
" Query the runtime options SpiderMonkey is running with, or return an\n."
" object with the options if no argument is given."),
JS_FN_HELP("isLcovEnabled", ::IsLCovEnabled, 0, 0,
"isLcovEnabled()",

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

@ -85,7 +85,7 @@ if not cfg.sixgill_plugin:
)
subprocess.check_call(
[cfg.js, "-e", 'if (!getBuildConfiguration()["has-ctypes"]) quit(1)']
[cfg.js, "-e", 'if (!getBuildConfiguration("has-ctypes")) quit(1)']
)

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

@ -330,7 +330,7 @@ function cLibrary()
throw new Error("Unable to open libc");
}
if (getBuildConfiguration()["moz-memory"]) {
if (getBuildConfiguration("moz-memory")) {
throw new Error("cannot use libc functions with --enable-jemalloc, since they will be routed " +
"through jemalloc, but calling libc.free() directly will bypass it and the " +
"malloc/free will be mismatched");

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

@ -35,7 +35,7 @@ excluded_tests = [
name = "spec"
url = "https://github.com/WebAssembly/spec"
excluded_tests = []
directive = "; test-also=--no-avx; skip-variant-if: --no-avx, !getBuildConfiguration().x86 && !getBuildConfiguration().x64 || getBuildConfiguration().simulator"
directive = "; test-also=--no-avx; skip-variant-if: --no-avx, !getBuildConfiguration('x86') && !getBuildConfiguration('x64') || getBuildConfiguration('simulator')"
[[repos]]
name = "threads"

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

@ -43,15 +43,13 @@ diff --git a/js/src/jit-test/tests/wasm/spec/memory64/harness/harness.js b/js/sr
}
+function partialOobWriteMayWritePartialData() {
+ let cfg = getBuildConfiguration();
+ let arm_native = cfg["arm"] && !cfg["arm-simulator"];
+ let arm64_native = cfg["arm64"] && !cfg["arm64-simulator"];
+ let arm_native = getBuildConfiguration("arm") && !getBuildConfiguration("arm-simulator");
+ let arm64_native = getBuildConfiguration("arm64") && !getBuildConfiguration("arm64-simulator");
+ return arm_native || arm64_native;
+}
+
+let cfg = getBuildConfiguration();
+let native_arm = cfg["arm"] && !cfg["arm-simulator"];
+let native_arm64 = cfg["arm64"] && !cfg["arm64-simulator"];
+let native_arm = getBuildConfiguration("arm") && !getBuildConfiguration("arm-simulator");
+let native_arm64 = getBuildConfiguration("arm64") && !getBuildConfiguration("arm64-simulator");
+
function bytes(type, bytes) {
var typedBuffer = new Uint8Array(bytes);

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

@ -135,16 +135,15 @@ function codegenTestMultiplatform_adhoc(module_text, export_name,
// Poke the build-configuration object to find out what target we're
// generating code for.
let conf = getBuildConfiguration();
let genX64 = conf.x64;
let genX86 = conf.x86;
let genArm64 = conf.arm64;
let genArm = conf.arm;
let genX64 = getBuildConfiguration("x64");
let genX86 = getBuildConfiguration("x86");
let genArm64 = getBuildConfiguration("arm64");
let genArm = getBuildConfiguration("arm");
// So far so good, except .. X64 or X86 might be emulating something else.
if (genX64 && genArm64 && conf['arm64-simulator']) {
if (genX64 && genArm64 && getBuildConfiguration("arm64-simulator")) {
genX64 = false;
}
if (genX86 && genArm && conf['arm-simulator']) {
if (genX86 && genArm && getBuildConfiguration("arm-simulator")) {
genX86 = false;
}

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

@ -7,7 +7,7 @@
// Call the function f. On beta and release, expect it to throw an error that is
// an instance of error.
function nightlyOnly(error, f) {
if (getBuildConfiguration().release_or_beta) {
if (getBuildConfiguration("release_or_beta")) {
try {
f();
throw new Error("use of feature expected to fail on release and beta, but succeeded; please update test");

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

@ -1,6 +1,6 @@
// Functions shared by gc/pretenure-*.js tests
const is64bit = getBuildConfiguration()['pointer-byte-size'] === 8;
const is64bit = getBuildConfiguration("pointer-byte-size") === 8;
// Count of objects that will exceed the size of the nursery.
const nurseryCount = is64bit ? 25000 : 50000;

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

@ -4,7 +4,6 @@ if (!wasmIsSupported())
load(libdir + "asserts.js");
function canRunHugeMemoryTests() {
let conf = getBuildConfiguration();
// We're aiming for 64-bit desktop builds with no interesting analysis
// running that might inflate memory consumption unreasonably. It's OK if
// they're debug builds, though.
@ -16,12 +15,12 @@ function canRunHugeMemoryTests() {
let blocked = ['rooting-analysis','simulator',
'android','wasi','asan','tsan','ubsan','dtrace','valgrind'];
for ( let b of blocked ) {
if (conf[b]) {
if (getBuildConfiguration(b)) {
print("Failing canRunHugeMemoryTests() because '" + b + "' is true");
return false;
}
}
if (conf['pointer-byte-size'] != 8) {
if (getBuildConfiguration("pointer-byte-size") != 8) {
print("Failing canRunHugeMemoryTests() because the build is not 64-bit");
return false;
}
@ -583,6 +582,6 @@ function assertSame(got, expected) {
// TailCallIterations is selected to be large enough to trigger
// "too much recursion", but not to be slow.
var TailCallIterations = getBuildConfiguration().simulator ? 1000 : 100000;
var TailCallIterations = getBuildConfiguration("simulator") ? 1000 : 100000;
// TailCallBallast is selected to spill registers as parameters.
var TailCallBallast = 30;

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

@ -33,8 +33,7 @@ function test() {
assertEq(a[MAX_DENSE_ELEMENTS_COUNT + 1], MAX_DENSE_ELEMENTS_COUNT + 1);
}
var config = getBuildConfiguration();
// Takes too long time on debug build.
if (!config.debug) {
if (!getBuildConfiguration("debug")) {
test();
}

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['arm-simulator']
// |jit-test| skip-if: !getBuildConfiguration("arm-simulator")
// Single-step profiling currently only works in the ARM simulator
load(libdir + "asm.js");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
function f(stdlib, foreign, buffer) {
"use asm";

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus:6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus:6; skip-if: getBuildConfiguration("wasi")
timeout(1);
// Adapted from randomly chosen test: js/src/jit-test/tests/asm.js/testBug975182.js
(function() {

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()["pointer-byte-size"] != 8
// |jit-test| skip-if: getBuildConfiguration("pointer-byte-size") != 8
var stdlib = this;
// The significance of this constant is that it is a 31-bit value that is larger

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !isAsmJSCompilationAvailable() || !getBuildConfiguration()['arm-simulator']
// |jit-test| skip-if: !isAsmJSCompilationAvailable() || !getBuildConfiguration("arm-simulator")
// Single-step profiling currently only works in the ARM simulator
load(libdir + "asm.js");

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
load(libdir + "asm.js");

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
load(libdir + "asm.js");

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
load(libdir + "asm.js");

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
load(libdir + "asm.js");

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
load(libdir + "asm.js");
@ -6,7 +6,7 @@ enableGeckoProfiling();
var f = asmLink(asmCompile('glob', 'ffis', 'buf', USE_ASM + "function f() { var i=0; while (1) { i=(i+1)|0 } } return f"));
timeout(1);
if (getBuildConfiguration()["arm-simulator"])
if (getBuildConfiguration("arm-simulator"))
enableSingleStepProfiling();
f();
assertEq(true, false);

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
load(libdir + "asm.js");
@ -6,7 +6,7 @@ enableGeckoProfiling();
var f = asmLink(asmCompile('glob', 'ffis', 'buf', USE_ASM + "function g() { var i=0; while (1) { i=(i+1)|0 } } function f() { g() } return f"));
timeout(1);
if (getBuildConfiguration()["arm-simulator"])
if (getBuildConfiguration("arm-simulator"))
enableSingleStepProfiling();
f();
assertEq(true, false);

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

@ -111,7 +111,7 @@ fill(src_buf);
// Too slow in debug-noopt builds but we don't want to flag the test as slow,
// since that means it'll never be run.
if (this.getBuildConfiguration && !getBuildConfiguration().debug)
if (this.getBuildConfiguration && !getBuildConfiguration("debug"))
{
let t = new Uint8Array(target_buf);
for (let my_src_buf of [src_buf, target_buf]) {

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: helperThreadCount() === 0 || getBuildConfiguration()["arm64-simulator"] === true
// |jit-test| skip-if: helperThreadCount() === 0 || getBuildConfiguration("arm64-simulator") === true
// Let a few threads hammer on memory with atomics to provoke errors
// in exclusion work. This test is not 100% fail-safe: the test may

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

@ -1,4 +1,4 @@
// |jit-test| allow-oom; allow-unhandlable-oom; skip-if: getBuildConfiguration()['android']
// |jit-test| allow-oom; allow-unhandlable-oom; skip-if: getBuildConfiguration("android")
// Disabled on Android due to harness problems (Bug 1532654)
gcparam("maxBytes", gcparam("gcBytes") + 1);
fullcompartmentchecks(true);

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

@ -1,4 +1,4 @@
// |jit-test| allow-oom; allow-unhandlable-oom; skip-if: getBuildConfiguration()['android']
// |jit-test| allow-oom; allow-unhandlable-oom; skip-if: getBuildConfiguration("android")
// Disabled on Android due to harness problems (Bug 1532654)
gcparam("maxBytes", gcparam("gcBytes") + 4*1024);

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
timeout(0.1, function() { return false; });
Atomics.add(new Int32Array(1), 0, {

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration().debug === true
// |jit-test| skip-if: getBuildConfiguration("debug") === true
function f(){};
Object.defineProperty(f, "name", {value: "a".repeat((1<<30)-2)});
var ex = null;

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

@ -1,4 +1,4 @@
// |jit-test| slow; skip-if: getBuildConfiguration()['debug']
// |jit-test| slow; skip-if: getBuildConfiguration("debug")
var s = '';
s += new Uint8Array(2 ** 23 + 2);

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

@ -1,4 +1,4 @@
// |jit-test| error: 42; skip-if: getBuildConfiguration()['wasi']
// |jit-test| error: 42; skip-if: getBuildConfiguration("wasi")
load(libdir + "immutable-prototype.js");
// Suppress the large quantity of output on stdout (eg from calling

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
setJitCompilerOption("baseline.warmup.trigger", 1);
setJitCompilerOption("ion.warmup.trigger", 2);

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
// Bug 857050: Remove the timeout function root before shutting down.
function timeoutfunc() {}
timeout(1, timeoutfunc);

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
/* This test will loop infinitely if the shell watchdog
fails to kick in. */

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

@ -1,7 +1,5 @@
var config = getBuildConfiguration();
// FIXME: ASAN and debug builds run this too slowly for now.
if (!config.debug && !config.asan) {
if (!getBuildConfiguration("debug") && !getBuildConfiguration("asan")) {
let longArray = [];
longArray.length = getMaxArgs() + 1;
let shortArray = [];

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

@ -1,7 +1,5 @@
var config = getBuildConfiguration();
// FIXME: ASAN and debug builds run this too slowly for now.
if (!config.debug && !config.asan) {
if (!getBuildConfiguration("debug") && !getBuildConfiguration("asan")) {
let longArray = [];
longArray.length = getMaxArgs() - 1;
let shortArray = [];

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

@ -1,4 +1,4 @@
// |jit-test| slow; skip-if: (getBuildConfiguration()['asan'] && getBuildConfiguration()['debug'])
// |jit-test| slow; skip-if: (getBuildConfiguration("asan") && getBuildConfiguration("debug"))
// This test is too slow to run at all with ASan in a debug configuration
function fatty() {
@ -9,7 +9,7 @@ function fatty() {
}
}
if (!getBuildConfiguration()['root-analysis']) { // >:(
if (!getBuildConfiguration("root-analysis")) { // >:(
foo = evalcx("(function foo() { foo.bar() })");
foo.bar = evalcx("(function bar() {})");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()["arm64-simulator"] === true
// |jit-test| skip-if: getBuildConfiguration("arm64-simulator") === true
//
// The ARM64 Simulator can take upwards of 6 minutes to execute this test,
// which fails intermittently with timeouts.

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
function f(x) {
if (x === 0)
return;

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()["android"]
// |jit-test| skip-if: getBuildConfiguration("android")
try {
a = {};
@ -7,7 +7,7 @@ try {
Function(a, a, a);
assertEq(true, false, "allocation overflow expected");
} catch (e) {
if (getBuildConfiguration()['pointer-byte-size'] == 4) {
if (getBuildConfiguration("pointer-byte-size") == 4) {
assertEq((e + "").includes("InternalError: allocation size overflow"), true);
} // else on 64-bit, it will be a SyntaxError for invalid code.
}

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()["pointer-byte-size"] > 4 || getBuildConfiguration()["android"]
// |jit-test| skip-if: getBuildConfiguration("pointer-byte-size") > 4 || getBuildConfiguration("android")
// On 64-bit, this will allocate 2G temporary strings for keys while
// stringifying the Array, which takes a rather long time and doesn't have the

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()["android"]
// |jit-test| skip-if: getBuildConfiguration("android")
try {
var z = "1";
@ -25,7 +25,7 @@ try {
z += z
} catch (e) {}
uneval(this);
assertEq(getBuildConfiguration()["pointer-byte-size"], 8, "32-bit should OOM; 64-bit should not");
assertEq(getBuildConfiguration("pointer-byte-size"), 8, "32-bit should OOM; 64-bit should not");
} catch (e) {
const msg = e + "";
assertEq(msg.includes("out of memory") || msg.includes("InternalError: allocation size overflow"), true);

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()["arm64-simulator"] === true
// |jit-test| skip-if: getBuildConfiguration("arm64-simulator") === true
// This test times out in ARM64 simulator builds.
function makeIonCompiledScript(n) {

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['osx'] && getBuildConfiguration()['arm64']
// |jit-test| skip-if: getBuildConfiguration("osx") && getBuildConfiguration("arm64")
load(libdir + "asserts.js");
function main() {
class Base {}

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['arm'] || getBuildConfiguration()['arm64']
// |jit-test| skip-if: getBuildConfiguration("arm") || getBuildConfiguration("arm64")
// skip on arm, arm64 due to bug 1511615
load(libdir + 'asserts.js');

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

@ -1,11 +1,11 @@
load(libdir + 'asserts.js');
function test() {
if (getBuildConfiguration()["pointer-byte-size"] == 4) {
if (getBuildConfiguration("pointer-byte-size") == 4) {
let big_array = ctypes.int32_t.array(0xfffffff);
assertRangeErrorMessage(() => { big_array.array(0xfffffff); },
"array size does not fit in size_t");
} else if (getBuildConfiguration()["pointer-byte-size"] == 8) {
} else if (getBuildConfiguration("pointer-byte-size") == 8) {
let big_array = ctypes.int32_t.array(0xfffffff);
assertRangeErrorMessage(() => { big_array.array(0xfffffff); },
"array size does not fit in JavaScript number");

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

@ -1,7 +1,7 @@
load(libdir + 'asserts.js');
function test() {
if (getBuildConfiguration()["pointer-byte-size"] == 4) {
if (getBuildConfiguration("pointer-byte-size") == 4) {
let big_array = ctypes.int32_t.array(0xfffffff);
assertRangeErrorMessage(() => { ctypes.StructType("x", [{a: big_array},
{b: big_array},
@ -9,7 +9,7 @@ function test() {
{d: big_array},
{e: big_array}]); },
"struct size does not fit in size_t");
} else if (getBuildConfiguration()["pointer-byte-size"] == 8) {
} else if (getBuildConfiguration("pointer-byte-size") == 8) {
let big_array = ctypes.int32_t.array(0xfffffffffffffff);
assertRangeErrorMessage(() => { ctypes.StructType("x", [{a: big_array},
{b: big_array},

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
//
// Two Environments nested in the same runtime scope share the correct tail of their parent chains.

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

@ -1,4 +1,4 @@
// |jit-test| allow-oom; allow-unhandlable-oom; allow-overrecursed; skip-if: getBuildConfiguration()['android']
// |jit-test| allow-oom; allow-unhandlable-oom; allow-overrecursed; skip-if: getBuildConfiguration("android")
// Disabled on Android due to harness problems (Bug 1532654)
g = newGlobal({newCompartment: true})

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
g = newGlobal({newCompartment: true});
g.parent = this;

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

@ -6,7 +6,7 @@ if (!wasmDebuggingEnabled())
throw "TestComplete";
// Single-step profiling currently only works in the ARM simulator
if (!getBuildConfiguration()["arm-simulator"])
if (!getBuildConfiguration("arm-simulator"))
throw "TestComplete";
enableGeckoProfiling();

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['decorators']
// |jit-test| skip-if: !getBuildConfiguration("decorators")
load(libdir + "asserts.js");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['decorators']
// |jit-test| skip-if: !getBuildConfiguration("decorators")
load(libdir + "asserts.js");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['decorators']
// |jit-test| skip-if: !getBuildConfiguration("decorators")
load(libdir + "asserts.js");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['decorators']
// |jit-test| skip-if: !getBuildConfiguration("decorators")
load(libdir + "asserts.js");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['decorators']
// |jit-test| skip-if: !getBuildConfiguration("decorators")
load(libdir + "asserts.js");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['decorators']
// |jit-test| skip-if: !getBuildConfiguration("decorators")
load(libdir + "asserts.js");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['decorators']
// |jit-test| skip-if: !getBuildConfiguration("decorators")
load(libdir + "asserts.js");

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
var iters = 250;

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

@ -1,4 +1,4 @@
// |jit-test| allow-overrecursed; allow-unhandlable-oom; skip-if: getBuildConfiguration()['android']
// |jit-test| allow-overrecursed; allow-unhandlable-oom; skip-if: getBuildConfiguration("android")
// Disabled on Android due to harness problems (Bug 1532654)
enableShellAllocationMetadataBuilder();

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['has-gczeal'] || helperThreadCount() === 0
// |jit-test| skip-if: !getBuildConfiguration("has-gczeal") || helperThreadCount() === 0
// This will fail with --no-threads.
verifyprebarriers();

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()["arm64-simulator"] === true
// |jit-test| skip-if: getBuildConfiguration("arm64-simulator") === true
// This test times out in ARM64 simulator builds.
gczeal(0);

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

@ -1,4 +1,4 @@
// |jit-test| --fuzzing-safe; --ion-offthread-compile=off; --ion-warmup-threshold=10; skip-if: (getBuildConfiguration()['android'] && getBuildConfiguration()['debug'] && getBuildConfiguration()['arm64'])
// |jit-test| --fuzzing-safe; --ion-offthread-compile=off; --ion-warmup-threshold=10; skip-if: (getBuildConfiguration("android") && getBuildConfiguration("debug") && getBuildConfiguration("arm64"))
// Test that Nursery::disable() waits for poisoning to finish before
// discarding and re-poisoning its chunks.

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['has-gczeal']
// |jit-test| skip-if: !getBuildConfiguration("has-gczeal")
gczeal(0);
gczeal(20);
startgc(1);

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

@ -1,4 +1,4 @@
// |jit-test| allow-unhandlable-oom; skip-if: (getBuildConfiguration()['android'] && getBuildConfiguration()['debug'])
// |jit-test| allow-unhandlable-oom; skip-if: (getBuildConfiguration("android") && getBuildConfiguration("debug"))
gczeal(0);
if (!this.enqueueMark) {

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

@ -1,4 +1,4 @@
// |jit-test| allow-unhandlable-oom; skip-if: (getBuildConfiguration()['android'] && getBuildConfiguration()['debug'])
// |jit-test| allow-unhandlable-oom; skip-if: (getBuildConfiguration("android") && getBuildConfiguration("debug"))
gczeal(0);
if (!this.enqueueMark) {

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !(getBuildConfiguration()['has-gczeal']) || helperThreadCount() === 0
// |jit-test| skip-if: !(getBuildConfiguration("has-gczeal")) || helperThreadCount() === 0
setGCCallback({
action: "majorGC",
});

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['has-gczeal'] || (getBuildConfiguration()['osx'] && getBuildConfiguration()['arm64'])
// |jit-test| skip-if: !getBuildConfiguration("has-gczeal") || (getBuildConfiguration("osx") && getBuildConfiguration("arm64"))
// Test aborting an incremental GC in all possible states

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
//
// Tests aimed at AbstractGeneratorObject::FixedSlotLimit.

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['moz-memory']
// |jit-test| skip-if: !getBuildConfiguration("moz-memory")
// Run this test only if we're using jemalloc. Other malloc implementations
// exhibit surprising behaviors. For example, 32-bit Fedora builds have
// non-deterministic allocation sizes.
@ -11,9 +11,7 @@
// something SpiderMonkey hackers really want to know; they're supposed to be
// stable.
const config = getBuildConfiguration();
const pointerByteSize = config["pointer-byte-size"];
const pointerByteSize = getBuildConfiguration("pointer-byte-size");
assertEq(pointerByteSize === 4 || pointerByteSize === 8, true);
const m32 = pointerByteSize === 4;

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['moz-memory']
// |jit-test| skip-if: !getBuildConfiguration("moz-memory")
// Run this test only if we're using jemalloc. Other malloc implementations
// exhibit surprising behaviors. For example, 32-bit Fedora builds have
// non-deterministic allocation sizes.
@ -11,7 +11,7 @@
// something SpiderMonkey hackers really want to know; they're supposed to be
// stable.
if (getBuildConfiguration()['pointer-byte-size'] == 4)
if (getBuildConfiguration("pointer-byte-size") == 4)
var s = (s32, s64) => s32
else
var s = (s32, s64) => s64

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['moz-memory']
// |jit-test| skip-if: !getBuildConfiguration("moz-memory")
// Run this test only if we're using jemalloc. Other malloc implementations
// exhibit surprising behaviors. For example, 32-bit Fedora builds have
// non-deterministic allocation sizes.
@ -11,8 +11,6 @@
// something SpiderMonkey hackers really want to know; they're supposed to be
// stable.
var config = getBuildConfiguration();
gczeal(0); // Need to control when tenuring happens
// Hack to skip this test if strings are not allocated in the nursery.
@ -35,7 +33,7 @@ gczeal(0); // Need to control when tenuring happens
if (getJitCompilerOptions()["ion.warmup.trigger"] <= 100)
setJitCompilerOption("ion.warmup.trigger", 100);
if (config['pointer-byte-size'] == 4)
if (getBuildConfiguration("pointer-byte-size") == 4)
var s = (s32, s64) => s32
else
var s = (s32, s64) => s64
@ -82,7 +80,7 @@ function tByteSize(str) {
// - Nursery-allocated strings require a header that stores the zone.
// Expected sizes based on type of string
const m32 = (config['pointer-byte-size'] == 4);
const m32 = (getBuildConfiguration("pointer-byte-size") == 4);
const TA = m32 ? 24 : 32; // ThinInlineString atom, includes a hash value
const TN = m32 ? 16 : 24; // ThinInlineString
const FN = m32 ? 32 : 32; // FatInlineString
@ -234,7 +232,7 @@ assertEq(byteSize(rope16), s(Nurser
// allocated in the nursery. If this ever changes, please add tests for the new
// cases. Also note that on Windows mozmalloc's smallest allocation size is
// two words compared to one word on other platforms.
if (config['windows']) {
if (getBuildConfiguration("windows")) {
assertEq(byteSize(newString("", {external: true})), s(EN+8, EN+16));
assertEq(byteSize(newString("1", {external: true})), s(EN+8, EN+16));
assertEq(byteSize(newString("12", {external: true})), s(EN+8, EN+16));

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: !getBuildConfiguration()['moz-memory']
// |jit-test| skip-if: !getBuildConfiguration("moz-memory")
// Run this test only if we're using jemalloc. Other malloc implementations
// exhibit surprising behaviors. For example, 32-bit Fedora builds have
// non-deterministic allocation sizes.
@ -11,9 +11,7 @@
// something SpiderMonkey hackers really want to know; they're supposed to be
// stable.
var config = getBuildConfiguration();
const SIZE_OF_SYMBOL = config['pointer-byte-size'] == 4 ? 16 : 16;
const SIZE_OF_SYMBOL = getBuildConfiguration("pointer-byte-size") == 4 ? 16 : 16;
// Without a description.
assertEq(byteSize(Symbol()), SIZE_OF_SYMBOL);

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

@ -1,3 +1,3 @@
// Try out the pointerByteSize shell function.
var size = getBuildConfiguration()["pointer-byte-size"];
var size = getBuildConfiguration("pointer-byte-size");
assertEq(size == 4 || size == 8, true);

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

@ -1,4 +1,4 @@
// |jit-test| --spectre-mitigations=on; skip-if: getBuildConfiguration()['mips32'] || getBuildConfiguration()['mips64'] || getBuildConfiguration()['riscv64']
// |jit-test| --spectre-mitigations=on; skip-if: getBuildConfiguration("mips32") || getBuildConfiguration("mips64") || getBuildConfiguration("riscv64")
function f() {
return arguments[arguments.length];
}

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
timeout(5);
function f0(p0,p1,p2,p3,p4,p5,p6,p7,p8,p9) {
var v0;

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
timeout(1);
function f0(p0) {
var v0;

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
timeout(5);
function f0() {
var v0;

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
timeout(5);
function f0(p0,p1,p2,p3,p4,p5,p6,p7,p8) {
var v0;

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
// Don't assert in the type analyzer.
timeout(5);
function f0(p0,p1,p2,p3) {

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

@ -9,7 +9,6 @@ var warp = true;
// Prevent GC from cancelling/discarding Ion compilations.
gczeal(0);
var config = getBuildConfiguration();
var max = 200;
// Check that we are able to remove the operation inside recover test functions (denoted by "rop..."),
@ -1567,13 +1566,13 @@ function rhypot_object_4args(i) {
var uceFault_random = eval(`(${uceFault})`.replace('uceFault', 'uceFault_random'));
function rrandom(i) {
// setRNGState() exists only in debug builds
if(config.debug) setRNGState(2, 1+i);
if (getBuildConfiguration("debug")) setRNGState(2, 1+i);
var x = Math.random();
if (uceFault_random(i) || uceFault_random(i)) {
// TODO(Warp): Conditional operator ?: prevents recovering operands.
// assertEq(x, config.debug ? setRNGState(2, 1+i) || Math.random() : x);
if (config.debug) {
// assertEq(x, getBuildConfiguration("debug") ? setRNGState(2, 1+i) || Math.random() : x);
if (getBuildConfiguration("debug")) {
assertEq(x, setRNGState(2, 1+i) || Math.random());
} else {
assertEq(x, x);

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
timeout(1);
for(;;);

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['arm64']
// |jit-test| skip-if: getBuildConfiguration("arm64")
//
// Test skipped on ARM64 due to bug 1546742.
function f() {

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
timeout(1, function() { return false; });

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

@ -1 +1 @@
|jit-test| allow-oom; skip-if: (!largeArrayBufferSupported() || getBuildConfiguration().tsan)
|jit-test| allow-oom; skip-if: (!largeArrayBufferSupported() || getBuildConfiguration("tsan"))

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

@ -85,7 +85,7 @@ for (let parse of [parseAsModuleScript, parseAsClassicScript]) {
]).assert(parse("x = import(foo);"));
if (getRealmConfiguration()['importAssertions']) {
if (getRealmConfiguration("importAssertions")) {
program([
expressionStatement(
importCall(
@ -203,7 +203,7 @@ assertParseThrowsSyntaxError("x = import(");
assertParseThrowsSyntaxError("x = import(1,");
assertParseThrowsSyntaxError("x = import(1, 2");
if (!getRealmConfiguration()['importAssertions']) {
if (!getRealmConfiguration("importAssertions")) {
assertParseThrowsSyntaxError("import(1, 2");
assertParseThrowsSyntaxError("import(1, 2)");
assertParseThrowsSyntaxError("x = import(1, 2)");

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

@ -386,7 +386,7 @@ program([
)
]).assert(parseAsModule("export default 1234"));
if (getRealmConfiguration()['importAssertions']) {
if (getRealmConfiguration("importAssertions")) {
program([
exportDeclaration(
null,

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

@ -324,7 +324,7 @@ program([
)
]).assert(parseAsModule("import 'a'"));
if (getRealmConfiguration()['importAssertions']) {
if (getRealmConfiguration("importAssertions")) {
program([
importDeclaration(
[

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

@ -70,7 +70,7 @@ testImportEntries('import {x} from "a"; import {y} from "b";',
[{moduleRequest: {specifier: 'a', assertions: null}, importName: 'x', localName: 'x'},
{moduleRequest: {specifier: 'b', assertions: null}, importName: 'y', localName: 'y'}]);
if(getRealmConfiguration()['importAssertions']) {
if (getRealmConfiguration("importAssertions")) {
testImportEntries('import v from "mod" assert {};',
[{moduleRequest: {specifier: 'mod', assertions: null}, importName: 'default', localName: 'v'}]);

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

@ -50,7 +50,7 @@ testRequestedModules("import a from 'foo'; export {} from 'bar'; export * from '
{ specifier: 'baz', assertions: null }
]);
if(getRealmConfiguration()['importAssertions']) {
if (getRealmConfiguration("importAssertions")) {
testRequestedModules("import a from 'foo' assert {}", [
{ specifier: 'foo', assertions: null },
]);

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

@ -1,6 +1,6 @@
load(libdir + "syntax.js");
if (!getBuildConfiguration()['decorators']) {
if (!getBuildConfiguration("decorators")) {
function check_syntax_error_at(e, code, name) {
assertEq(e instanceof SyntaxError, true, name + ": " + code);
assertEq(e.message, "illegal character U+0040", name + ": " + code);

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

@ -16,7 +16,7 @@ var g = newGlobal();
g.parent = this;
g.eval("new Debugger(parent).onExceptionUnwind = function () {};");
enableGeckoProfiling();
if (getBuildConfiguration()["arm-simulator"])
if (getBuildConfiguration("arm-simulator"))
enableSingleStepProfiling(1);
loadFile("jsTestDriverEnd();");
loadFile("jsTestDriverEnd();");

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

@ -1,5 +1,5 @@
// `debugGetQueuedJobs` is available only in debug build.
if (!getBuildConfiguration().debug) {
if (!getBuildConfiguration("debug")) {
quit();
}

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
timeout(0.5);
var proxy = new Proxy({}, {

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

@ -1,4 +1,4 @@
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration()['wasi']
// |jit-test| exitstatus: 6; skip-if: getBuildConfiguration("wasi")
timeout(0.5)
var proxy = new Proxy({}, {

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
var s = "";
var input = "";
for (var i = 0; i < 500; ++i) {

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
var s = "";
var input = "";
for (var i = 0; i < 500; ++i) {

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

@ -63,7 +63,7 @@ test();
// Test if the test is still useful, or if all results match without
// fingerprinting resistance as well.
if (!getBuildConfiguration()["android"] &&
if (!getBuildConfiguration("android") &&
Math.cos(1e130 ) == -0.767224894221913 &&
Math.cos(1e272 ) == -0.7415825695514536 &&
Math.cos(1e284 ) == 0.7086865671674247 &&

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: getBuildConfiguration("wasi")
//
// Test that the SavedFrame caching doesn't mess up counts. Specifically, that
// if we capture only the first n frames of a stack, we don't cache that stack

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

@ -1,4 +1,4 @@
// |jit-test| skip-if: typeof Intl === 'undefined'; skip-if: getBuildConfiguration()['wasi']
// |jit-test| skip-if: typeof Intl === 'undefined'; skip-if: getBuildConfiguration("wasi")
// Clobbering `Symbol` should not impact creation of %Intl%.[[FallbackSymbol]]
globalThis.Symbol = null;

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

@ -1,4 +1,4 @@
// |jit-test| crash; skip-if: getBuildConfiguration()['tsan'] || getBuildConfiguration()['wasi']; --ion-warmup-threshold=50
// |jit-test| crash; skip-if: getBuildConfiguration("tsan") || getBuildConfiguration("wasi"); --ion-warmup-threshold=50
setJitCompilerOption("offthread-compilation.enable", 0);
var opts = getJitCompilerOptions();

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

@ -1,4 +1,4 @@
// |jit-test| tz-pacific; skip-if: getBuildConfiguration()['wasi']
// |jit-test| tz-pacific; skip-if: getBuildConfiguration("wasi")
function arrayExists(array, x) {
for (var i = 0; i < array.length; i++) {

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше