Use the value from the intrinsics holder instead of making a new copy each time.
This also lets us remove the self-hosting global in the future.
Differential Revision: https://phabricator.services.mozilla.com/D118365
Use consistent casing with the rest of intrinsics so that we can sort the
intrinsics in later patches.
Depends on D118236
Differential Revision: https://phabricator.services.mozilla.com/D118363
We never had any consistency with how we named the intrinsics, so remove the
underscore prefix to match the rest of the intrinsics.
Differential Revision: https://phabricator.services.mozilla.com/D118236
The old system would initialize it on the self-hosting global and rely on
CloneValue to copy it lazily to the intrinsics-holder of a given realm. Now we
eagerly initialize the binding when the intrinics-holder is created. In
practice, once a self-hosted builtin is used it is very likely that undefined
will be needed there too. Also remove the unused 'global' binding while we are
here.
This change helps strip down the self-hosting global so that we can remove it
entirely in the future.
Differential Revision: https://phabricator.services.mozilla.com/D118234
The Wasm spec for the text format specifies that imports should come
before definitions:
The second condition enforces that all imports must occur before any
regular definition of a function, table, memory, or global, thereby
maintaining the ordering of the respective index spaces.
https://webassembly.github.io/spec/core/text/modules.html#text-module
However, this was not enforced for the test parser until recently.
Differential Revision: https://phabricator.services.mozilla.com/D118082
This introduces templates that capture the common code patterns around
most instance calls, and uses those where possible. It turns out that
we can clean up the handling of return values significantly too, since
the builtin signatures capture all the necessary information and a
weird special case was removed last year.
Differential Revision: https://phabricator.services.mozilla.com/D112966
This changes font-family storage to reuse the rust types, removing a
bunch of code while at it. This allows us to, for example, use a single
static font family for -moz-bullet and clone it, rather than creating a
lot of expensive copies.
Differential Revision: https://phabricator.services.mozilla.com/D118011
The jit-test was triggering slices that were "too long" for the test to abort the
sweep phase. Reduce the count for the test to pass.
The devtools test was failing because shapes no longer show up in the visible part
of the memory allocation table (it's more down the list because there are fewer
shapes). Use PropMap instead.
Differential Revision: https://phabricator.services.mozilla.com/D117315
This is mostly removing code that's now implemented in property maps:
45 files changed, 1469 insertions(+), 2932 deletions(-)
See also the new SMDOC comment in Shape.h
In CacheIR.cpp remove the previous shape check. This is no longer necessary
after this code got rewritten a while ago.
Differential Revision: https://phabricator.services.mozilla.com/D117314
This change ensures we don't report "en-US-posix" as the default locale when
`LANG=C` is set by the user, because that could be confusing after part 2.
The current rules about selecting the appropriate default locale were last
discussed in <https://bugzilla.mozilla.org/show_bug.cgi?id=1175347>. The
preference in that bug was to accept every part of the default locale as long
as there's a possible fallback locale. For example when the user locale is
"de-ZA", which can be supported through the fallback to "de", "de-ZA" as a whole
is accepted. But "de-ZA" is not accepted when the default locale is for example
just "de".
The test cases were adapted to use a locale which has multiple subtags and which
has only partial support in `Intl.Collator`: `Intl.Collator` only natively
supports "az", but not "az-Cyrl-AZ". "az-Cyrl-AZ" is completely supported by all
other Intl service constructors.
Depends on D117976
Differential Revision: https://phabricator.services.mozilla.com/D117977
This will replace what we currently have in ShouldConvertToDictionary.
The HadElementsAccess object flag we currently use there will be removed
in a later patch.
Differential Revision: https://phabricator.services.mozilla.com/D117313
This corresponds to the fast path we currently have in SetIntegrityLevel, but
makes it more of a core operation.
The old Shape-based implementation doesn't support dictionary objects, but this
patch adds code for dictionary maps because it's easy to implement and is much
faster than the generic seal/freeze code.
Differential Revision: https://phabricator.services.mozilla.com/D117311
Mpas will store an array of PropertyInfos, add a private constructor to make
that work.
Also add a CompactPropertyInfo type that occupies two bytes instead of four. This
will be used for compact maps.
Differential Revision: https://phabricator.services.mozilla.com/D117306
This adds plumbing to make the JS engine set the stack quota based on the
actual stack size for external thread pool threads (and internal thread pool
ones).
The quota is calculated as 90% of the size, which is currently hardcoded into
the constants.
Differential Revision: https://phabricator.services.mozilla.com/D118183
This stops creating allocation sites for IC stubs when running in the baseline
interpreter. When a script is compiled in baseline proper this scans the IC
chain for ops that could potentially reference allocation sites, and allocates
them where necessary.
This should result in fewer sites being created and less overhead for code that
doesn't reach baseline.
Differential Revision: https://phabricator.services.mozilla.com/D117920
Instead of defining (slimmed-down) constructors on the instrinsics holder,
simply use the JSOp::BuiltinObject mechanism (which uses ProtoKey slots on the
GlobalObject). This reduces the initialization requirements on the self-hosted
global which simplifies removing it later. Using `BuiltinObject` instead of
`GetIntrinsic` loses BaselineInterpreter support but the cases here are
uncommon.
Differential Revision: https://phabricator.services.mozilla.com/D118106
Instead of relying on builtin bindings for well-known symbols, use the
BytecodeEmitter to map `GetBuiltinSymbol` to `JSOp::Symbol`. The old code relies
on `GetIntrinsic` to clone by matching well-known symbol code, while the new
system directly uses `JSOp::Symbol` with the appropriate symbol-code.
Differential Revision: https://phabricator.services.mozilla.com/D118105
This stops creating allocation sites for IC stubs when running in the baseline
interpreter. When a script is compiled in baseline proper this scans the IC
chain for ops that could potentially reference allocation sites, and allocates
them where necessary.
This should result in fewer sites being created and less overhead for code that
doesn't reach baseline.
Differential Revision: https://phabricator.services.mozilla.com/D117920
Uses the stack limit values currently used for the JS shell. This fixes confusing
behavior when the embedding forgets to call JS_SetNativeStackQuota.
Differential Revision: https://phabricator.services.mozilla.com/D117655