Skip to content

Commit

Permalink
Bug 1795914 - Remove JS Streams implementation r=jandem
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaudet committed Oct 24, 2022
1 parent 3d10b58 commit 4852cc8
Show file tree
Hide file tree
Showing 50 changed files with 79 additions and 8,835 deletions.
1 change: 0 additions & 1 deletion dom/base/BodyStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#define mozilla_dom_BodyStream_h

#include "jsapi.h"
#include "js/Stream.h"
#include "mozilla/AlreadyAddRefed.h"
#include "mozilla/dom/ByteStreamHelpers.h"
#include "mozilla/dom/BindingDeclarations.h"
Expand Down
1 change: 0 additions & 1 deletion dom/fetch/FetchStreamReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "FetchStreamReader.h"
#include "InternalResponse.h"
#include "js/Stream.h"
#include "mozilla/ConsoleReportCollector.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/AutoEntryScript.h"
Expand Down
18 changes: 0 additions & 18 deletions js/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,6 @@ def enable_decorators(value):
set_config("ENABLE_DECORATORS", enable_decorators)
set_define("ENABLE_DECORATORS", enable_decorators)

# Enable JS Streams
# ===================================================
option(
"--enable-js-streams",
default=False,
help="Enable non-default JS Streams implementation",
)


@depends("--enable-js-streams")
def enable_js_streams(value):
if value:
return True


set_config("MOZ_JS_STREAMS", enable_js_streams)
set_define("MOZ_JS_STREAMS", enable_js_streams)

# JIT support
# =======================================================
@depends(target, "--enable-record-tuple")
Expand Down
166 changes: 78 additions & 88 deletions js/public/ProtoKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,94 +46,84 @@
# define IF_WASM_TYPE(REAL, IMAGINARY) IMAGINARY
#endif

#define JS_FOR_PROTOTYPES_(REAL, IMAGINARY, REAL_IF_INTL, REAL_IF_WASM_TYPE) \
IMAGINARY(Null, dummy) \
REAL(Object, OCLASP(Plain)) \
REAL(Function, &FunctionClass) \
REAL(Array, OCLASP(Array)) \
REAL(Boolean, OCLASP(Boolean)) \
REAL(JSON, CLASP(JSON)) \
REAL(Date, OCLASP(Date)) \
REAL(Math, CLASP(Math)) \
REAL(Number, OCLASP(Number)) \
REAL(String, OCLASP(String)) \
REAL(RegExp, OCLASP(RegExp)) \
REAL(Error, ERROR_CLASP(JSEXN_ERR)) \
REAL(InternalError, ERROR_CLASP(JSEXN_INTERNALERR)) \
REAL(AggregateError, ERROR_CLASP(JSEXN_AGGREGATEERR)) \
REAL(EvalError, ERROR_CLASP(JSEXN_EVALERR)) \
REAL(RangeError, ERROR_CLASP(JSEXN_RANGEERR)) \
REAL(ReferenceError, ERROR_CLASP(JSEXN_REFERENCEERR)) \
REAL(SyntaxError, ERROR_CLASP(JSEXN_SYNTAXERR)) \
REAL(TypeError, ERROR_CLASP(JSEXN_TYPEERR)) \
REAL(URIError, ERROR_CLASP(JSEXN_URIERR)) \
REAL(DebuggeeWouldRun, ERROR_CLASP(JSEXN_DEBUGGEEWOULDRUN)) \
REAL(CompileError, ERROR_CLASP(JSEXN_WASMCOMPILEERROR)) \
REAL(LinkError, ERROR_CLASP(JSEXN_WASMLINKERROR)) \
REAL(RuntimeError, ERROR_CLASP(JSEXN_WASMRUNTIMEERROR)) \
REAL(ArrayBuffer, OCLASP(ArrayBuffer)) \
REAL(Int8Array, TYPED_ARRAY_CLASP(Int8)) \
REAL(Uint8Array, TYPED_ARRAY_CLASP(Uint8)) \
REAL(Int16Array, TYPED_ARRAY_CLASP(Int16)) \
REAL(Uint16Array, TYPED_ARRAY_CLASP(Uint16)) \
REAL(Int32Array, TYPED_ARRAY_CLASP(Int32)) \
REAL(Uint32Array, TYPED_ARRAY_CLASP(Uint32)) \
REAL(Float32Array, TYPED_ARRAY_CLASP(Float32)) \
REAL(Float64Array, TYPED_ARRAY_CLASP(Float64)) \
REAL(Uint8ClampedArray, TYPED_ARRAY_CLASP(Uint8Clamped)) \
REAL(BigInt64Array, TYPED_ARRAY_CLASP(BigInt64)) \
REAL(BigUint64Array, TYPED_ARRAY_CLASP(BigUint64)) \
REAL(BigInt, OCLASP(BigInt)) \
REAL(Proxy, CLASP(Proxy)) \
REAL(WeakMap, OCLASP(WeakMap)) \
REAL(Map, OCLASP(Map)) \
REAL(Set, OCLASP(Set)) \
REAL(DataView, OCLASP(DataView)) \
REAL(Symbol, OCLASP(Symbol)) \
REAL(ShadowRealm, OCLASP(ShadowRealm)) \
REAL(SharedArrayBuffer, OCLASP(SharedArrayBuffer)) \
REAL_IF_INTL(Intl, CLASP(Intl)) \
REAL_IF_INTL(Collator, OCLASP(Collator)) \
REAL_IF_INTL(DateTimeFormat, OCLASP(DateTimeFormat)) \
REAL_IF_INTL(DisplayNames, OCLASP(DisplayNames)) \
REAL_IF_INTL(ListFormat, OCLASP(ListFormat)) \
REAL_IF_INTL(Locale, OCLASP(Locale)) \
REAL_IF_INTL(NumberFormat, OCLASP(NumberFormat)) \
REAL_IF_INTL(PluralRules, OCLASP(PluralRules)) \
REAL_IF_INTL(RelativeTimeFormat, OCLASP(RelativeTimeFormat)) \
REAL(Reflect, CLASP(Reflect)) \
REAL(WeakSet, OCLASP(WeakSet)) \
REAL(TypedArray, &js::TypedArrayObject::sharedTypedArrayPrototypeClass) \
REAL(Atomics, OCLASP(Atomics)) \
REAL(SavedFrame, &js::SavedFrame::class_) \
REAL(Promise, OCLASP(Promise)) \
REAL(AsyncFunction, CLASP(AsyncFunction)) \
REAL(GeneratorFunction, CLASP(GeneratorFunction)) \
REAL(AsyncGeneratorFunction, CLASP(AsyncGeneratorFunction)) \
IF_JS_STREAMS(REAL(ReadableStream, &js::ReadableStream::class_)) \
IF_JS_STREAMS(REAL(ReadableStreamDefaultReader, \
&js::ReadableStreamDefaultReader::class_)) \
IF_JS_STREAMS(REAL(ReadableStreamDefaultController, \
&js::ReadableStreamDefaultController::class_)) \
IF_JS_STREAMS(REAL(ReadableByteStreamController, \
&js::ReadableByteStreamController::class_)) \
IF_JS_STREAMS( \
REAL(ByteLengthQueuingStrategy, &js::ByteLengthQueuingStrategy::class_)) \
IF_JS_STREAMS(REAL(CountQueuingStrategy, &js::CountQueuingStrategy::class_)) \
REAL(WebAssembly, OCLASP(WasmNamespace)) \
REAL(WasmModule, OCLASP(WasmModule)) \
REAL(WasmInstance, OCLASP(WasmInstance)) \
REAL(WasmMemory, OCLASP(WasmMemory)) \
REAL(WasmTable, OCLASP(WasmTable)) \
REAL(WasmGlobal, OCLASP(WasmGlobal)) \
REAL(WasmTag, OCLASP(WasmTag)) \
REAL_IF_WASM_TYPE(WasmFunction, CLASP(WasmFunction)) \
REAL(WasmException, OCLASP(WasmException)) \
REAL(FinalizationRegistry, OCLASP(FinalizationRegistry)) \
REAL(WeakRef, OCLASP(WeakRef)) \
REAL(Iterator, OCLASP(Iterator)) \
REAL(AsyncIterator, OCLASP(AsyncIterator)) \
IF_RECORD_TUPLE(REAL(Record, (&RecordType::class_))) \
#define JS_FOR_PROTOTYPES_(REAL, IMAGINARY, REAL_IF_INTL, REAL_IF_WASM_TYPE) \
IMAGINARY(Null, dummy) \
REAL(Object, OCLASP(Plain)) \
REAL(Function, &FunctionClass) \
REAL(Array, OCLASP(Array)) \
REAL(Boolean, OCLASP(Boolean)) \
REAL(JSON, CLASP(JSON)) \
REAL(Date, OCLASP(Date)) \
REAL(Math, CLASP(Math)) \
REAL(Number, OCLASP(Number)) \
REAL(String, OCLASP(String)) \
REAL(RegExp, OCLASP(RegExp)) \
REAL(Error, ERROR_CLASP(JSEXN_ERR)) \
REAL(InternalError, ERROR_CLASP(JSEXN_INTERNALERR)) \
REAL(AggregateError, ERROR_CLASP(JSEXN_AGGREGATEERR)) \
REAL(EvalError, ERROR_CLASP(JSEXN_EVALERR)) \
REAL(RangeError, ERROR_CLASP(JSEXN_RANGEERR)) \
REAL(ReferenceError, ERROR_CLASP(JSEXN_REFERENCEERR)) \
REAL(SyntaxError, ERROR_CLASP(JSEXN_SYNTAXERR)) \
REAL(TypeError, ERROR_CLASP(JSEXN_TYPEERR)) \
REAL(URIError, ERROR_CLASP(JSEXN_URIERR)) \
REAL(DebuggeeWouldRun, ERROR_CLASP(JSEXN_DEBUGGEEWOULDRUN)) \
REAL(CompileError, ERROR_CLASP(JSEXN_WASMCOMPILEERROR)) \
REAL(LinkError, ERROR_CLASP(JSEXN_WASMLINKERROR)) \
REAL(RuntimeError, ERROR_CLASP(JSEXN_WASMRUNTIMEERROR)) \
REAL(ArrayBuffer, OCLASP(ArrayBuffer)) \
REAL(Int8Array, TYPED_ARRAY_CLASP(Int8)) \
REAL(Uint8Array, TYPED_ARRAY_CLASP(Uint8)) \
REAL(Int16Array, TYPED_ARRAY_CLASP(Int16)) \
REAL(Uint16Array, TYPED_ARRAY_CLASP(Uint16)) \
REAL(Int32Array, TYPED_ARRAY_CLASP(Int32)) \
REAL(Uint32Array, TYPED_ARRAY_CLASP(Uint32)) \
REAL(Float32Array, TYPED_ARRAY_CLASP(Float32)) \
REAL(Float64Array, TYPED_ARRAY_CLASP(Float64)) \
REAL(Uint8ClampedArray, TYPED_ARRAY_CLASP(Uint8Clamped)) \
REAL(BigInt64Array, TYPED_ARRAY_CLASP(BigInt64)) \
REAL(BigUint64Array, TYPED_ARRAY_CLASP(BigUint64)) \
REAL(BigInt, OCLASP(BigInt)) \
REAL(Proxy, CLASP(Proxy)) \
REAL(WeakMap, OCLASP(WeakMap)) \
REAL(Map, OCLASP(Map)) \
REAL(Set, OCLASP(Set)) \
REAL(DataView, OCLASP(DataView)) \
REAL(Symbol, OCLASP(Symbol)) \
REAL(ShadowRealm, OCLASP(ShadowRealm)) \
REAL(SharedArrayBuffer, OCLASP(SharedArrayBuffer)) \
REAL_IF_INTL(Intl, CLASP(Intl)) \
REAL_IF_INTL(Collator, OCLASP(Collator)) \
REAL_IF_INTL(DateTimeFormat, OCLASP(DateTimeFormat)) \
REAL_IF_INTL(DisplayNames, OCLASP(DisplayNames)) \
REAL_IF_INTL(ListFormat, OCLASP(ListFormat)) \
REAL_IF_INTL(Locale, OCLASP(Locale)) \
REAL_IF_INTL(NumberFormat, OCLASP(NumberFormat)) \
REAL_IF_INTL(PluralRules, OCLASP(PluralRules)) \
REAL_IF_INTL(RelativeTimeFormat, OCLASP(RelativeTimeFormat)) \
REAL(Reflect, CLASP(Reflect)) \
REAL(WeakSet, OCLASP(WeakSet)) \
REAL(TypedArray, &js::TypedArrayObject::sharedTypedArrayPrototypeClass) \
REAL(Atomics, OCLASP(Atomics)) \
REAL(SavedFrame, &js::SavedFrame::class_) \
REAL(Promise, OCLASP(Promise)) \
REAL(AsyncFunction, CLASP(AsyncFunction)) \
REAL(GeneratorFunction, CLASP(GeneratorFunction)) \
REAL(AsyncGeneratorFunction, CLASP(AsyncGeneratorFunction)) \
REAL(WebAssembly, OCLASP(WasmNamespace)) \
REAL(WasmModule, OCLASP(WasmModule)) \
REAL(WasmInstance, OCLASP(WasmInstance)) \
REAL(WasmMemory, OCLASP(WasmMemory)) \
REAL(WasmTable, OCLASP(WasmTable)) \
REAL(WasmGlobal, OCLASP(WasmGlobal)) \
REAL(WasmTag, OCLASP(WasmTag)) \
REAL_IF_WASM_TYPE(WasmFunction, CLASP(WasmFunction)) \
REAL(WasmException, OCLASP(WasmException)) \
REAL(FinalizationRegistry, OCLASP(FinalizationRegistry)) \
REAL(WeakRef, OCLASP(WeakRef)) \
REAL(Iterator, OCLASP(Iterator)) \
REAL(AsyncIterator, OCLASP(AsyncIterator)) \
IF_RECORD_TUPLE(REAL(Record, (&RecordType::class_))) \
IF_RECORD_TUPLE(REAL(Tuple, (&TupleType::class_)))

#define JS_FOR_PROTOTYPES(REAL, IMAGINARY) \
Expand Down
14 changes: 0 additions & 14 deletions js/public/RealmOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,6 @@ class JS_PUBLIC_API RealmCreationOptions {
bool getCoopAndCoepEnabled() const;
RealmCreationOptions& setCoopAndCoepEnabled(bool flag);

bool getStreamsEnabled() const { return streams_; }
RealmCreationOptions& setStreamsEnabled(bool flag) {
#ifdef MOZ_JS_STREAMS
# ifdef MOZ_DOM_STREAMS
# error "JS and DOM streams shouldn't be simultaneously configured"
# endif
streams_ = flag;
#else
MOZ_ASSERT(!streams_);
#endif
return *this;
}

WeakRefSpecifier getWeakRefsEnabled() const { return weakRefs_; }
RealmCreationOptions& setWeakRefsEnabled(WeakRefSpecifier spec) {
weakRefs_ = spec;
Expand Down Expand Up @@ -280,7 +267,6 @@ class JS_PUBLIC_API RealmCreationOptions {
bool sharedMemoryAndAtomics_ = false;
bool defineSharedArrayBufferConstructor_ = true;
bool coopAndCoep_ = false;
bool streams_ = false;
bool toSource_ = false;
bool propertyErrorMessageFix_ = false;
bool iteratorHelpers_ = false;
Expand Down
Loading

0 comments on commit 4852cc8

Please sign in to comment.