Backed out changeset c46147974f79 (bug 1940342) for causing btime failures CLOSED TREE

This commit is contained in:
Alexandru Marc
2025-03-05 06:22:39 +02:00
parent 6e676184ba
commit a38ff5f3a4
3 changed files with 107 additions and 117 deletions

View File

@@ -77,7 +77,9 @@ enum JSExnType {
JSEXN_EVALERR,
JSEXN_RANGEERR,
JSEXN_REFERENCEERR,
#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT
JSEXN_SUPPRESSEDERR,
#endif
JSEXN_SYNTAXERR,
JSEXN_TYPEERR,
JSEXN_URIERR,

View File

@@ -59,22 +59,15 @@
# define IF_WASM_JSPI(REAL, IMAGINARY) IMAGINARY
#endif
// IF_EXPLICIT_RESOURCE_MANAGEMENT is already used elsewhere.
#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT
# define IF_HAVE_EXPLICIT_RESOURCE_MANAGEMENT(REAL, IMAGINARY) REAL
#else
# define IF_HAVE_EXPLICIT_RESOURCE_MANAGEMENT(REAL, IMAGINARY) IMAGINARY
#endif
#ifdef NIGHTLY_BUILD
# define IF_NIGHTLY(REAL, IMAGINARY) REAL
#else
# define IF_NIGHTLY(REAL, IMAGINARY) IMAGINARY
#endif
#define JS_FOR_PROTOTYPES_( \
REAL, IMAGINARY, REAL_IF_INTL, REAL_IF_TEMPORAL, REAL_IF_WASM_TYPE, \
REAL_IF_WASM_JSPI, REAL_IF_EXPLICIT_RESOURCE_MANAGEMENT, REAL_IF_NIGHTLY) \
#define JS_FOR_PROTOTYPES_(REAL, IMAGINARY, REAL_IF_INTL, REAL_IF_TEMPORAL, \
REAL_IF_WASM_TYPE, REAL_IF_WASM_JSPI, \
REAL_IF_NIGHTLY) \
IMAGINARY(Null, dummy) \
REAL(Object, OCLASP(Plain)) \
REAL(Function, &FunctionClass) \
@@ -93,8 +86,8 @@
REAL(EvalError, ERROR_CLASP(JSEXN_EVALERR)) \
REAL(RangeError, ERROR_CLASP(JSEXN_RANGEERR)) \
REAL(ReferenceError, ERROR_CLASP(JSEXN_REFERENCEERR)) \
REAL_IF_EXPLICIT_RESOURCE_MANAGEMENT(SuppressedError, \
ERROR_CLASP(JSEXN_SUPPRESSEDERR)) \
IF_EXPLICIT_RESOURCE_MANAGEMENT( \
REAL(SuppressedError, ERROR_CLASP(JSEXN_SUPPRESSEDERR))) \
REAL(SyntaxError, ERROR_CLASP(JSEXN_SYNTAXERR)) \
REAL(TypeError, ERROR_CLASP(JSEXN_TYPEERR)) \
REAL(URIError, ERROR_CLASP(JSEXN_URIERR)) \
@@ -159,10 +152,10 @@
REAL(WeakRef, OCLASP(WeakRef)) \
REAL(Iterator, OCLASP(Iterator)) \
REAL(AsyncIterator, OCLASP(AsyncIterator)) \
REAL_IF_EXPLICIT_RESOURCE_MANAGEMENT(DisposableStack, \
OCLASP(DisposableStack)) \
REAL_IF_EXPLICIT_RESOURCE_MANAGEMENT(AsyncDisposableStack, \
OCLASP(AsyncDisposableStack)) \
IF_EXPLICIT_RESOURCE_MANAGEMENT( \
REAL(DisposableStack, OCLASP(DisposableStack))) \
IF_EXPLICIT_RESOURCE_MANAGEMENT( \
REAL(AsyncDisposableStack, OCLASP(AsyncDisposableStack))) \
REAL_IF_TEMPORAL(Temporal, OCLASP(temporal::Temporal)) \
REAL_IF_TEMPORAL(Duration, OCLASP(temporal::Duration)) \
REAL_IF_TEMPORAL(Instant, OCLASP(temporal::Instant)) \
@@ -173,21 +166,11 @@
REAL_IF_TEMPORAL(PlainTime, OCLASP(temporal::PlainTime)) \
REAL_IF_TEMPORAL(TemporalNow, OCLASP(temporal::TemporalNow)) \
REAL_IF_TEMPORAL(ZonedDateTime, OCLASP(temporal::ZonedDateTime))
// DO NOT ADD CONDITIONAL ENTRIES TO THIS LIST! (As in, do not add entries that
// are only present in some configurations.) It will break binary compatibility.
// Instead, create an IF_<feature> macro and add it to the parameter list below
// and add a corresponding parameter to JS_FOR_PROTOTYPES_ above.
//
// Note that entries may be freely added to or removed from this list, even in
// the middle. The only invariant that must be upheld is that the offsets in the
// list do not change depending on configuration settings of the same version of
// the source.
#define JS_FOR_PROTOTYPES(REAL, IMAGINARY) \
JS_FOR_PROTOTYPES_( \
REAL, IMAGINARY, IF_INTL(REAL, IMAGINARY), IF_TEMPORAL(REAL, IMAGINARY), \
IF_WASM_TYPE(REAL, IMAGINARY), IF_WASM_JSPI(REAL, IMAGINARY), \
IF_HAVE_EXPLICIT_RESOURCE_MANAGEMENT(REAL, IMAGINARY), \
IF_NIGHTLY(REAL, IMAGINARY))
#define JS_FOR_EACH_PROTOTYPE(MACRO) JS_FOR_PROTOTYPES(MACRO, MACRO)

View File

@@ -48,8 +48,13 @@ namespace xpc {
#define Between(x, a, b) (a <= x && x <= b)
#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT
static_assert(JSProto_URIError - JSProto_Error == 9,
"New prototype added in error object range");
#else
static_assert(JSProto_URIError - JSProto_Error == 8,
"New prototype added in error object range");
#endif
#define AssertErrorObjectKeyInBounds(key) \
static_assert(Between(key, JSProto_Error, JSProto_URIError), \
"We depend on js/ProtoKey.h ordering here");