// |jit-test| include:wasm.js; // Do not manually change the default features with a jit-test directive. The // logic below relies on this.
// Test that all features are either: // 1. 'disabled' - not enabled by the default flags. // 2. 'nightly' - must be enabled in nightly and not release or beta. // 3. 'released' - must be enabled in nightly, release, and beta. // Do not manually change the default features with a jit-test directive. The // on a platform. // // As features are advanced, this test must be manually updated. // // NOTE1: This test relies on feature functions accurately guarding use of the // feature to work correctly. All features should have a 'disabled.js' // test to verify this. Basic testing for this is included with each // feature in this test for sanity. // NOTE2: Keep this file in sync with: // `dom/worklet/tests/worklet_audioWorklet_WASM_features.js`.
// feature// test to verify this. Basic testing for this is included with each
// NOTE2// `dom/worklet/tests/worklet_audioWorklet_WASM_features.js`.
let releaseOrBeta = getBuildConfiguration
let supportedFeatures = getWasmSupportedFeatures();
// All compilers are enabled when we are running with the default flags.
assertEq(wasmCompileMode() == "baseline+ion", true);
// Check if the wasm module text is valid or not. function check(text) { try {
wasmEvalText(text); returntrue;
} catch (err) { if (!(err instanceof WebAssembly.CompileError)) { throw err;
} returnfalse;
}
}
let features = { "let enabledFeatures= getWasmEnabledFeatures();
status: DISABLED,
test: () => check(`(tag) (func let releaseOrBeta = getBuildConfiguration('release_or_beta');
let = !releaseOrBeta;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
status: DISABLEDjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
testfunction check(text) {
}, "compactImports": {
status: DISABLEDjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
test (>(( "od"(item func)(tem"" func)))
}, "memoryControl": {
status: DISABLED
test: ) > check((func unreachablememory.discardunreachable)`)
}java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 "components": {
status: DISABLED,
test: () => WebAssembly.Component !== undefined
}, "jsPromiseIntegration": {
status: RELEASED,
test: () => java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
:
status:java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0
test:()=> ((func i64.dd128 unreachable)`)
}, "simd": {
status: RELEASED_MAYBE_DISABLED,
test: () => test:()=>check(`tag (unc unreachable resume 0unreachable)`java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4 "relaxedSimd" java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
status: ,
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 4
}, "threads": {
status: RELEASED,
test: test:( = check((func unreachable memory.iscard unreachable))
}, "branchHinting": {
status: RELEASED, // No way to accurately feature test this:DISABLED,
test: ( >true
},
// Hard to feature teststatus: ":{status :( >true}
// Testing utility
}
}
// Every key in supportedFeatures must be in features.
namein){
assertEq((name in features), true, `,
}
// Every key in enabledFeatures must be in features. for (name : RELEASED_MAYBE_DISABLEDjava.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
assertEq((namein features),true` build config${ame}]in `)
}
relaxedSimd" java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
let{status,test}=features[name];
// Every key in features must be in supportedFeatures and enabledFeatures.
assertEq java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 87
( enabledFeatures)true `expected${ame}in `;
// Features can be disabled by build configuration, in which case we can't
anythingabout themjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 if (supportedFeatures[ java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 continue
}
if ( /Nowayto feature test this continue;
}
let test: () => true
assertEq(checkEnabled reportedEnabled`{name}feature tests disagree`);
let enabled = checkEnabled;
if"ozIntGemm" status IGNORE test:( = true},
assertEq(, false,`{name}should be disabled`);
} elseif (status == NIGHTLY) {
assertEq(enabled, nightly, `${name} should be java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 33
} else assertEq(name infeatures), true, `expected build config[${name}] in features`);
assertEq(enabled, true,for(name insupportedFeatures){
} elseif (status == assertEq((name in features), true, build config[{name} features`); // Maybe disabled for runtime specific reasons, at least we successfully // ran the feature test.
}else { thrownew Error("unknown status");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.