Ignore:
Timestamp:
Nov 6, 2020, 12:23:25 PM (5 years ago)
Author:
[email protected]
Message:

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.

  1. 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.
  2. Atomics.wait should be renamed to Atomics.notify.
  3. Atomics operation should be VarArgs in DFG because DFGSSALoweringPhase assumes that they are VarArgs and they can have another arg for CheckInBounds dependency.
  4. 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):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGNode.h:

(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):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileAtomicsIsLockFree):

  • jsc.cpp:

(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):

  • runtime/SmallStrings.h:

(JSC::SmallStrings::notEqualString const):
(JSC::SmallStrings::timedOutString const):
(JSC::SmallStrings::okString const):

Source/WTF:

  • wtf/PlatformEnable.h:

Tools:

  • Scripts/test262/Runner.pm:

(getFeatureFlags):

  • Scripts/webkitpy/layout_tests/run_webkit_tests.py:

(main):

LayoutTests:

  • webaudio/dom-exceptions-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSCJSValue.h

    r268993 r269531  
    295295    JS_EXPORT_PRIVATE double toInteger(JSGlobalObject*) const;
    296296    JS_EXPORT_PRIVATE double toIntegerPreserveNaN(JSGlobalObject*) const;
     297    double toIntegerOrInfinity(JSGlobalObject*) const;
    297298    int32_t toInt32(JSGlobalObject*) const;
    298299    uint32_t toUInt32(JSGlobalObject*) const;
Note: See TracChangeset for help on using the changeset viewer.