All JSProtoKey entries are now using `InitViaClassSpec`, so we can remove the 'init'
parameter from `JS_FOR_PROTOTYPES` and update all callers accordingly. Furthermore
the `protoTable` array can be changed to an array of `JSClass*` and
`GlobalObject::resolveConstructor` can be cleaned-up to always use the ClassSpec
initialisation path.
Differential Revision: https://phabricator.services.mozilla.com/D52706
--HG--
extra : moz-landing-system : lando
Also use ClassSpec initialisation for all WebAssembly namespace constructors
to ensure a failed initialisation can still be retried.
Differential Revision: https://phabricator.services.mozilla.com/D52705
--HG--
extra : moz-landing-system : lando
The "constructor" property of the GeneratorFunction prototype is non-writable,
so we need to manually adjust the property attributes in the `FinishClassInitOp`.
This change needs to happen first to ensure "constructor" is still stored in
the last property, which in turn ensures the property can be modified without
triggering a transition into dictionary mode.
jsapi.cpp:
Remove the JSProto_GeneratorFunction special cases now that we can use
`ClassSpec::DontDefineConstructor`.
Differential Revision: https://phabricator.services.mozilla.com/D52677
--HG--
extra : moz-landing-system : lando
Proxy JSClasses are defined through a special macro (`PROXY_CLASS_DEF`), which
ensures all Proxy related bits are set correctly. The macro doesn't allow to
specify a ClassSpec, so we need to add a new macro which supports that
functionality.
Differential Revision: https://phabricator.services.mozilla.com/D52666
--HG--
extra : moz-landing-system : lando
Similar to the JSON changes in part 5. Additionally 'FinishClassInitOp' is
needed to initialise the double constant properties.
Differential Revision: https://phabricator.services.mozilla.com/D52662
--HG--
extra : moz-landing-system : lando
The JSON ClassSpec uses a custom 'createConstructor', because the JSON object
is a singleton object and not a built-in constructor function.
Differential Revision: https://phabricator.services.mozilla.com/D52661
--HG--
extra : moz-landing-system : lando
A ClassSpec's 'FinishClassInitOp' isn't called when `InitBareBuiltinCtor` is
used, which allows us to unconditionally define all well-known symbols in
`SymbolClassFinish`. That means we no longer need the separate `InitBareSymbolCtor`
function.
Differential Revision: https://phabricator.services.mozilla.com/D52660
--HG--
extra : moz-landing-system : lando
Move String to ClassSpec using similar changes like done for Number in part 2.
Differential Revision: https://phabricator.services.mozilla.com/D52659
--HG--
extra : moz-landing-system : lando
In addition to a custom 'createProperty' hook, the Number ClassSpec also uses
a 'FinishClassInitOp' to initialise Number-related global properties like
`isNaN` and to initialise functions which are shared between Number and the
global object (i.e. `parseInt`).
Differential Revision: https://phabricator.services.mozilla.com/D52658
--HG--
extra : moz-landing-system : lando
Boolean.prototype is itself a Boolean object, so the ClassSpec needs to use
a custom 'createPrototype' function to create and initialise the prototype
object.
Differential Revision: https://phabricator.services.mozilla.com/D52657
--HG--
extra : moz-landing-system : lando
All JSProtoKey entries are now using `InitViaClassSpec`, so we can remove the 'init'
parameter from `JS_FOR_PROTOTYPES` and update all callers accordingly. Furthermore
the `protoTable` array can be changed to an array of `JSClass*` and
`GlobalObject::resolveConstructor` can be cleaned-up to always use the ClassSpec
initialisation path.
Differential Revision: https://phabricator.services.mozilla.com/D52706
--HG--
extra : moz-landing-system : lando
Also use ClassSpec initialisation for all WebAssembly namespace constructors
to ensure a failed initialisation can still be retried.
Differential Revision: https://phabricator.services.mozilla.com/D52705
--HG--
extra : moz-landing-system : lando
The "constructor" property of the GeneratorFunction prototype is non-writable,
so we need to manually adjust the property attributes in the `FinishClassInitOp`.
This change needs to happen first to ensure "constructor" is still stored in
the last property, which in turn ensures the property can be modified without
triggering a transition into dictionary mode.
jsapi.cpp:
Remove the JSProto_GeneratorFunction special cases now that we can use
`ClassSpec::DontDefineConstructor`.
Differential Revision: https://phabricator.services.mozilla.com/D52677
--HG--
extra : moz-landing-system : lando
Proxy JSClasses are defined through a special macro (`PROXY_CLASS_DEF`), which
ensures all Proxy related bits are set correctly. The macro doesn't allow to
specify a ClassSpec, so we need to add a new macro which supports that
functionality.
Differential Revision: https://phabricator.services.mozilla.com/D52666
--HG--
extra : moz-landing-system : lando
Similar to the JSON changes in part 5. Additionally 'FinishClassInitOp' is
needed to initialise the double constant properties.
Differential Revision: https://phabricator.services.mozilla.com/D52662
--HG--
extra : moz-landing-system : lando
The JSON ClassSpec uses a custom 'createConstructor', because the JSON object
is a singleton object and not a built-in constructor function.
Differential Revision: https://phabricator.services.mozilla.com/D52661
--HG--
extra : moz-landing-system : lando
A ClassSpec's 'FinishClassInitOp' isn't called when `InitBareBuiltinCtor` is
used, which allows us to unconditionally define all well-known symbols in
`SymbolClassFinish`. That means we no longer need the separate `InitBareSymbolCtor`
function.
Differential Revision: https://phabricator.services.mozilla.com/D52660
--HG--
extra : moz-landing-system : lando
Move String to ClassSpec using similar changes like done for Number in part 2.
Differential Revision: https://phabricator.services.mozilla.com/D52659
--HG--
extra : moz-landing-system : lando
In addition to a custom 'createProperty' hook, the Number ClassSpec also uses
a 'FinishClassInitOp' to initialise Number-related global properties like
`isNaN` and to initialise functions which are shared between Number and the
global object (i.e. `parseInt`).
Differential Revision: https://phabricator.services.mozilla.com/D52658
--HG--
extra : moz-landing-system : lando
Boolean.prototype is itself a Boolean object, so the ClassSpec needs to use
a custom 'createPrototype' function to create and initialise the prototype
object.
Differential Revision: https://phabricator.services.mozilla.com/D52657
--HG--
extra : moz-landing-system : lando
Adds AggregateError, but only enables it for Nightly builds, because the draft
proposal is still incomplete, so it doesn't make sense to let this feature ride
the trains at this moment.
- The `other_error_properties` array was changed to individual static variables,
because AggregateError has more than three properties, which prevents it to be
stored in `JSPropertySpec[][3]`.
- `AggregateErrorObject` can't use the normal `ErrorObject` class, because it
needs an additional slot for the [[AggregateErrors]].
- For similar reasons it can't use the shared `Error` constructor function,
because the `AggregateError` constructor has an additional `errors` iterable
argument which it needs to process.
Differential Revision: https://phabricator.services.mozilla.com/D51653
--HG--
extra : moz-landing-system : lando
This matches the JitCode GC-thing lifetime and will hopefully help avoid
fragmentation.
Differential Revision: https://phabricator.services.mozilla.com/D52823
--HG--
extra : moz-landing-system : lando
This adds two AUTO_PROFILER_LABEL_DYNAMIC_... macros and updates select
usages of the old macros to use the new ones. These new macros cause
the dynamic string of the label to be included in BHR stacks.
We don't want to do this all of the time, as in many cases we may not
be interested enough in the dynamic string or it may be sensitive
information, but it is rather important information for certain cases.
This uses the same buffer that we use for the strings for JS frames,
and if we fail to fit into that buffer we just append the raw label.
If the string is too long for our static buffer (128 bytes), we just
leave it truncated, as it should be stable and we may be able to infer
from the truncated form what the full form would be.
Differential Revision: https://phabricator.services.mozilla.com/D51665
--HG--
extra : moz-landing-system : lando
This macro isn't defined anywhere and doesn't seem to do anything. It
affects the oom-backtraces property of the build configuration object in
the testing functions, but since the macro is never defined, it seems to
be always set to false anyway, so just hardcode it.
Differential Revision: https://phabricator.services.mozilla.com/D51769
--HG--
extra : moz-landing-system : lando
This macro is not defined anywhere and has no effect in the end whether
it's defined or not.
Differential Revision: https://phabricator.services.mozilla.com/D51767
--HG--
extra : moz-landing-system : lando
This file provides the implementation of js/Utility.h, so it should be renamed
to match the header name.
Differential Revision: https://phabricator.services.mozilla.com/D51378
--HG--
rename : js/src/jsutil.cpp => js/src/util/Utility.cpp
extra : moz-landing-system : lando