Skip to content

Commit

Permalink
[JSC] Disable ArrayBuffer#transfer
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=248484
rdar://102775650

Reviewed by Mark Lam.

ArrayBuffer#transfer's semantics is still under discussion, and TC39 decided separating this out from
the rest of resizable ArrayBuffer, and creating a new proposal for ArrayBuffer#transfer.
We disable ArrayBuffer#transfer to follow to this.

[1]: https://github.com/tc39/proposal-resizablearraybuffer/issues/113

* JSTests/ChakraCore/test/typedarray/arraybufferType.baseline-jsc:
* JSTests/stress/v8-harmony-arraybuffer-transfer.js:
* JSTests/test262/config.yaml:
* Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp:
(JSC::JSArrayBufferPrototype::finishCreation):
* Source/JavaScriptCore/runtime/OptionsList.h:

Canonical link: https://commits.webkit.org/257162@main
  • Loading branch information
Constellation committed Nov 30, 2022
1 parent 1cc87d6 commit 458fd47
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ bar = 42
slice
byteLength
resize
transfer
resizable
maxByteLength
constructor
Expand All @@ -24,7 +23,6 @@ bar = 42
slice
byteLength
resize
transfer
resizable
maxByteLength
constructor
Expand Down
2 changes: 1 addition & 1 deletion JSTests/stress/v8-harmony-arraybuffer-transfer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ requireOptions("--useResizableArrayBuffer=1")
//@ requireOptions("--useResizableArrayBuffer=1", "--useArrayBufferTransfer=1")
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Expand Down
2 changes: 1 addition & 1 deletion JSTests/test262/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ flags:
ShadowRealm: useShadowRealm
import-assertions: useImportAssertion
json-modules: useImportAssertion
resizable-arraybuffer: useResizableArrayBuffer
resizable-arraybuffer: useArrayBufferTransfer
skip:
features:
# https://bugs.webkit.org/show_bug.cgi?id=174931
Expand Down
3 changes: 2 additions & 1 deletion Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ void JSArrayBufferPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject
JSC_NATIVE_GETTER_WITHOUT_TRANSITION(vm.propertyNames->byteLength, arrayBufferProtoGetterFuncByteLength, PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
if (Options::useResizableArrayBuffer()) {
JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->resize, arrayBufferProtoFuncResize, static_cast<unsigned>(PropertyAttribute::DontEnum), 1, ImplementationVisibility::Public);
JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->transfer, arrayBufferProtoFuncTransfer, static_cast<unsigned>(PropertyAttribute::DontEnum), 0, ImplementationVisibility::Public);
if (Options::useArrayBufferTransfer())
JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(vm.propertyNames->transfer, arrayBufferProtoFuncTransfer, static_cast<unsigned>(PropertyAttribute::DontEnum), 0, ImplementationVisibility::Public);
JSC_NATIVE_GETTER_WITHOUT_TRANSITION(vm.propertyNames->resizable, arrayBufferProtoGetterFuncResizable, PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
JSC_NATIVE_GETTER_WITHOUT_TRANSITION(vm.propertyNames->maxByteLength, arrayBufferProtoGetterFuncMaxByteLength, PropertyAttribute::DontEnum | PropertyAttribute::ReadOnly);
}
Expand Down
1 change: 1 addition & 0 deletions Source/JavaScriptCore/runtime/OptionsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ bool canUseWebAssemblyFastMemory();
\
/* Feature Flags */\
\
v(Bool, useArrayBufferTransfer, false, Normal, "Expose ArrayBuffer.transfer feature.") \
v(Bool, useArrayGroupMethod, true, Normal, "Expose the group() and groupToMap() methods on Array.") \
v(Bool, useAtomicsWaitAsync, true, Normal, "Expose the waitAsync() methods on Atomics.") \
v(Bool, useImportAssertion, true, Normal, "Enable import assertion.") \
Expand Down

0 comments on commit 458fd47

Please sign in to comment.