Re-enable SharedArrayBuffer for JSC shell and Testers
https://bugs.webkit.org/show_bug.cgi?id=212069
Reviewed by Keith Miller.
JSTests:
Update tests to align to the latest spec.
- stress/SharedArrayBuffer-opt.js:
(shouldSucceed):
(idx.of.string_appeared_here.a.of.arrays.m.of.atomics):
(string_appeared_here.a.of.arrays.m.of.atomics): Deleted.
- stress/SharedArrayBuffer.js:
(shouldSucceed):
(Symbol):
- stress/array-buffer-byte-length.js:
(shouldThrow):
(Symbol):
- stress/atomics-add-uint32.js:
- stress/atomics-known-int-use.js:
- stress/atomics-neg-zero.js:
- stress/atomics-store-return.js:
- stress/lars-sab-workers.js:
(resources):
(notify):
(wake): Deleted.
- stress/regress-170473.js:
- stress/regress-189317.js:
- stress/shared-array-buffer-sort-while-different-thread-is-modifying.js: Added.
(262.agent.waitUntil):
(262.agent.start.262.agent.receiveBroadcast):
- test262/config.yaml:
- test262/expectations.yaml:
LayoutTests/imported/w3c:
- web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-failure.https.any-expected.txt:
- web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-failure.https.any.serviceworker-expected.txt:
- web-platform-tests/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/requires-success.any.worker-expected.txt:
- web-platform-tests/wasm/jsapi/memory/constructor.any-expected.txt:
- web-platform-tests/wasm/jsapi/memory/constructor.any.worker-expected.txt:
- web-platform-tests/workers/postMessage_block.https-expected.txt:
Source/JavaScriptCore:
This patch revives SharedArrayBuffer and Atomics and aligning them to the latest spec.
- SharedArrayBuffer's sort should be done in JS side. C++ sort is not safe for SharedArrayBuffer since the buffer
can be modified by different threads while sorting.
- Atomics.wait should be renamed to Atomics.notify.
- Atomics operation should be VarArgs in DFG because DFGSSALoweringPhase assumes that they are VarArgs and they can
have another arg for CheckInBounds dependency.
- For test262, JSC shell should support "--can-block-is-false" flag. If it is true, the main thread's CanBlock becomes false.
This means that
Atomics.wait
cannot be used.
- builtins/BuiltinNames.h:
- builtins/TypedArrayPrototype.js:
(sort):
- bytecode/LinkTimeConstant.h:
- dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
- dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
(JSC::DFG::clobberize):
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::Node::mustGenerate const):
(JSC::DFG::Node::hasVarArgs const):
(JSC::DFG::Node::mustGenerate): Deleted.
- dfg/DFGNodeType.h:
- dfg/DFGSSALoweringPhase.cpp:
(JSC::DFG::SSALoweringPhase::handleNode):
- dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::FTL::DFG::LowerDFGToB3::compileAtomicsIsLockFree):
(printUsageStatement):
(CommandLine::parseArguments):
(runJSC):
- runtime/AtomicsObject.cpp:
(JSC::AtomicsObject::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSC_DEFINE_JIT_OPERATION):
- runtime/CommonIdentifiers.h:
- runtime/Intrinsic.cpp:
(JSC::intrinsicName):
- runtime/Intrinsic.h:
- runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferSlice):
(JSC::arrayBufferByteLength):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::JSArrayBufferPrototype::finishCreation):
- runtime/JSCJSValue.h:
- runtime/JSCJSValueInlines.h:
(JSC::JSValue::toIntegerOrInfinity const):
- runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncReverse):
(JSC::genericTypedArrayViewPrivateFuncSort):
- runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
- runtime/JSTypedArrayViewPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
- runtime/JSTypedArrayViewPrototype.h:
- runtime/OptionsList.h:
- runtime/SimpleTypedArrayController.cpp:
(JSC::SimpleTypedArrayController::SimpleTypedArrayController):
(JSC::SimpleTypedArrayController::isAtomicsWaitAllowedOnCurrentThread):
- runtime/SimpleTypedArrayController.h:
- runtime/SmallStrings.cpp:
(JSC::SmallStrings::initializeCommonStrings):
(JSC::SmallStrings::visitStrongReferences):
(JSC::SmallStrings::notEqualString const):
(JSC::SmallStrings::timedOutString const):
(JSC::SmallStrings::okString const):
Source/WTF:
Tools:
- Scripts/test262/Runner.pm:
(getFeatureFlags):
- Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(main):
LayoutTests:
- webaudio/dom-exceptions-expected.txt: