Fail parsing if line number (including initial offset) overflows the uint32_t
line number. Source length is capped at 4B characters so this change only
affects cases of inline-scripts with billions of lines which is not a
realistic case, even for generated code.
Differential Revision: https://phabricator.services.mozilla.com/D94115
Choose the string pretenuring threshold as 0.55, as it's the most common
pretured rate when the number of strings pretenured exceeds 30,000 in JetStream2
benchmark. (about 0.55~0.57 in my tests).
However this threshold shouldn't have any major impact on benchmarks like Octane,
JetStream2 and Kraken, as in these benchmarks when the pretenuring condition is
met, the tenured rate is 99%.
Differential Revision: https://phabricator.services.mozilla.com/D92762
This commit adds support for the eqref value type. It shares the same
representation as externref, with the restriction that all values must
be TypedObject's. Dynamic type checks similar to funcref are added to
stubs.
As fallout from anyref removal, struct types were left as subtypes of
externref. This commit switches them to be subtypes of eqref.
As a small tweak, the ordering on cases when switching on refTypeKind()
were standardized to binary order (i.e. funcref, externref, eqref).
I think we can refactor some code to simplify the process of adding
new reftypes and would like to do that in the future.
Differential Revision: https://phabricator.services.mozilla.com/D93000
The final patch in this series. This changes the GenericTracer APIs to take a
thing pointer and return a possibly updated versions, rather than taking a
double pointer to the thing. This means that we can change the details of how
pointers are stored in the heap without chaning this interface.
Differential Revision: https://phabricator.services.mozilla.com/D93336
This commit merges the TypedObject namespace into the WebAssembly namespace, and
only exposes the TypedObject definitions when the GC feature is enabled.
A future commit will remove the TypedObject definitions from the namespace, but we
still need the infrastructure from this commit for storing the TypedObject definitions
in private slots in the namespace.
Differential Revision: https://phabricator.services.mozilla.com/D92857
This commit merges the TypedObject namespace into the WebAssembly namespace, and
only exposes the TypedObject definitions when the GC feature is enabled.
A future commit will remove the TypedObject definitions from the namespace, but we
still need the infrastructure from this commit for storing the TypedObject definitions
in private slots in the namespace.
Differential Revision: https://phabricator.services.mozilla.com/D92857
This simplifies the threshold checks and the decision to make a collection
non-incremental ultimately happens in GCRuntime::budgetIncrementalGC anyway. We
still have telemetry for incremental/non-incremental collections and
non-incremental reason.
Differential Revision: https://phabricator.services.mozilla.com/D92592
This adds the parameter, without using it, also without passing the correct
value.
The later patch will change the consumer of those API to pass the correct value,
and then use the passed parameter.
Differential Revision: https://phabricator.services.mozilla.com/D92404
I gave TraceOptions some implicit consturctors to make it easier to set a
single option by passing an enum value.
Depends on D92595
Differential Revision: https://phabricator.services.mozilla.com/D92596
This splits out a GenericTracer class (with a virtual method per edge kind)
from CallbackTracer (with a single virtual method for all edges). GenericTracer
is used interally whereas all external uses use CallbackTracer.
Differential Revision: https://phabricator.services.mozilla.com/D92254
Currently we have two different enums that determine the tracer kind. Combine
this into a single enum and move it to the JS namespace.
Differential Revision: https://phabricator.services.mozilla.com/D92253
The instances of this are called 'actions' everywhere and I think it makes
sense that the type should be called that. Also make it an enum class and move
it into the JS namespace.
Differential Revision: https://phabricator.services.mozilla.com/D92252
The `using` declarations in "Proxy.h" make it act like a second
"NamespaceImports.h", introducing names from `JS` into the `js` namespace.
Remove the `using` declarations from "Proxy.h" and then fix up the breakage by:
- Prepend `JS::` in various header files.
- Add "NamespaceImports.h" in cpp files.
- Add `PropertyDescriptor` to "NamespaceImports.h". There are many unqualified
references to `PropertyDescriptor`, making it a prime candidate for
"NamespaceImports.h".
Drive-by changes:
- Use local variables in `CheckProxyFlags()` to make the `static_assert`
conditions more readable.
Differential Revision: https://phabricator.services.mozilla.com/D92207
No longer reset a moved-from Result to an error state, which required
UnusedZero<E>::GetDefaultValue, which was somewhat confusing, and might
also be inefficient. Leaving Result in a valid state, which might be a
success or error state is sufficient.
Differential Revision: https://phabricator.services.mozilla.com/D91250
This commit adds the boilerplate machinery for the function-references proposal. The
interesting piece is that the GC proposal is moved to require the function-references
proposal to be enabled.
The configuration machinery for features is refactored in this commit to avoid passing
6 different booleans around as parameters to functions.
* A FeatureArgs struct is added with values for all 'feature' configuration options
- A feature is defined as an option that affects validation or semantics
- Essentially everything besides 'debug', 'mode', 'tier'
* All feature configuration responsibility is removed from CompilerEnvironment
* ModuleEnvironment is modified to accept a FeatureArgs in addition to a
CompilerEnvironment
- The CompilerEnvironment field may eventually be removed, as it's not needed
within function validation, and is only used by the compilers later
Differential Revision: https://phabricator.services.mozilla.com/D89857
The getConstructorName testing function and UbiNode got the constructor name of a
JS object via the ObjectGroup's TypeNewScript. There's currently no way to get that
information without TI (and it always depended on brittle optimization heuristics)
so this patch removes that code.
Differential Revision: https://phabricator.services.mozilla.com/D91419
Script object-literal singletons are only generated for top-level run-once
scripts which both XDR and cloning no longer need to support. As a result,
the `cloneSingletons` mechanism is no longer needed and can be removed.
We can simplify the Interpreter and JITs handling of JSOp::Object to no
longer worry about cloneSingletons as a result. They also lets us remove the
`setSingletonsAsValues` code since we no longer have realm-wide poison bits.
Differential Revision: https://phabricator.services.mozilla.com/D91365
Among other things, there were some misuses of std::forward, and
GenericErrorResult was (presumably accidentally) instatiated with
references as the template argument type, e.g. const nsresult&,
which circumvented the check for not calling it with NS_OK in
ResultExtensions.h
Differential Revision: https://phabricator.services.mozilla.com/D90561
Among other things, there were some misuses of std::forward, and
GenericErrorResult was (presumably accidentally) instatiated with
references as the template argument type, e.g. const nsresult&,
which circumvented the check for not calling it with NS_OK in
ResultExtensions.h
Differential Revision: https://phabricator.services.mozilla.com/D90561
This adds a 'minimum' argument to the JS-API for the WebAssembly.Memory
and WebAssembly.Table objects. This parameter represents the minimum
size of the object which was specified by the 'initial' parameter. This
supports using either initial or minimum to specify the parameter.
This commit is part of the work to add type reflections to the
WebAssembly JS-API as specified in the js-types proposal.
Differential Revision: https://phabricator.services.mozilla.com/D85887