This is a step towards separating the mutable state on principals from const
state which can be made threadsafe. The remaining mutable fields will either
need to be moved off of nsIPrincipal or made threadsafe to destroy (e.g. using
nsMainThreadPtrHandle) and stored behind a mutex.
Serialization is handled for most types using a separate Deserializer class,
like how it was handled with `nsIURI` mutators. SystemPrincipal wasn't changed
as the `Read` method is a no-op for that class.
Differential Revision: https://phabricator.services.mozilla.com/D115092
This is necessary to remove the Init methods from principals, allowing
immutable fields to be marked as const and clearly separated from mutable
fields to improve threadsafety.
Differential Revision: https://phabricator.services.mozilla.com/D115091
As an intermediate step to allow mach commands as standalone functions, the MachCommandBase
subclass instance that currently corresponds to self has to be made available as a separate
argument (named command_context).
Differential Revision: https://phabricator.services.mozilla.com/D109650
Each `let` apparently creates a new hop in the emitter that isn't reflected in the number of hops seen by WarpBuilder. The problem only shows up when full parsing. The simplest fix is to convert `let` to `var`; the resulting testcase still triggers the original bug in WarpBuilder, but doesn't break code coverage builds.
Differential Revision: https://phabricator.services.mozilla.com/D115072
GetIntrinsic ensures that using Symbol from self-hosting always gets the
original value so std_Symbol is not helpful. Add a simple test case just to
confirm this is safe.
Depends on D115028
Differential Revision: https://phabricator.services.mozilla.com/D115029
Instead of setting the realm-behaviour on the self-hosted realm, set it on the
CompileOptions directly when parsing. This is in preparation for removal of the
self-hosted Zone. Also set NoScriptRVal at same time.
Differential Revision: https://phabricator.services.mozilla.com/D115028
This adds a fallible factory method to create new NumberFormat instances. This
allows us to report initialization errors at time of initialization, rather than
when format is called, and remove internal checks in the implementation for
successful initialization.
The existing fluent code assumes that creating a NumberFormat instance always
succeeds. This patch updates that code to handle failures.
Differential Revision: https://phabricator.services.mozilla.com/D114593
This temporarily adds intl::NumberFormatterSkeleton to the public API so that
we can use it in PluralRules. This allows us to remove the SpiderMonkey
NumberFormatterSkeleton implementation when we convert SpiderMonkey to use
intl::NumberFormat.
We can remove intl::NumberFormatterSkeleton from the public API when we
implement intl::PluralRules in Bug 1704509.
Differential Revision: https://phabricator.services.mozilla.com/D111887
Replace JS pageload proportion probes with absolute time measurements and add new probes to measure GC and main thread parsing impact during page load.
Differential Revision: https://phabricator.services.mozilla.com/D114388
This modification relies on the shared memory implemented in Bug 1698045 and on
the ability to encode and decode self-hosted content from Bug 1668361 to
optimize the JS engine initialization by making the parent process encode the
self-hosted stencil, such that all other runtime initialization would only have
to decode it, including content processes.
Differential Revision: https://phabricator.services.mozilla.com/D110578
The JSRuntime already has an API to set the self-hosted content before the
initialization. This modification adds a proper API such that the rest of Gecko,
which does not have access to the JSRuntime implementation can use this
functions as well.
Differential Revision: https://phabricator.services.mozilla.com/D110577
This change adds the ground work to share content provided by the JS engine of
the Parent process to initialize the JS engine of other threads and Content
processes.
The singleton class xpc::SelfHostedShmem is used to wrap the logic behind
holding the memory. The memory is initialized with `InitFromParent` or
`InitFromChild`. The memory is accessible using either the `Content` or
`Handle`.
The shared memory is transfered through the command line using
`mozilla::ipc::ExportSharedJSInit` and read using
`mozilla::ipc::ImportSharedJSInit` functions. The command line is used, as we
need the shared memory to be avilable for the JS engine initialization. The
command line is composed of a single command named `-jsInit` which is followed
by the handle (on Windows) and the length of the shared content.
The memory associated with the shared memory is cleared in `ShutdownXPCOM` after
closing all threads, and shuting down the JS engine. This is necessary as we
expect the JS engine to borrow content from the shared memory.
Differential Revision: https://phabricator.services.mozilla.com/D110576
XPCOMUtils._scriptloader is a read-only getter if it's never been called. Assigning a value to it throws an exception and breaks Thunderbird Mochitest.
Differential Revision: https://phabricator.services.mozilla.com/D114802
Most of the time, all shapes in the shape lineage will have the same BaseShape,
so we only need to trace its children once.
Differential Revision: https://phabricator.services.mozilla.com/D114851
This moves the pcOffset field from ICEntry to ICFallbackStub, and removes the
ICEntry* pointer from ICFallbackStub. Both of these classes are now one word smaller.
Because ICEntry and ICFallbackStubs are now both stored as ICScript arrays, we can
go from one to the other with some pointer arithmetic. This is pretty fast and
only has to happen on slower paths.
Another option would be to merge ICEntry and ICFallbackStub, but that complicates
the Baseline Interpreter code, especially on 32-bit platforms where the combined
size is not a nice power-of-two. With this patch we can use BaseIndex there.
Differential Revision: https://phabricator.services.mozilla.com/D114723
These iterators are fairly complicated (the patch deletes > 130 lines of code) and
they were only used in a few places.
This simplifies the next patch a bit.
Depends on D114721
Differential Revision: https://phabricator.services.mozilla.com/D114722
There was just one caller left, the CacheIR health report code, and it can be
changed to iterate over the JitScript's ICEntries instead.
Differential Revision: https://phabricator.services.mozilla.com/D114721
While removing dead code I accidentally broke getters and setters, and noticed that only setters currently have coverage (ion/bug765454.js), so I'm adding a testcase for bailing out inlined getters as well.
Driveby: I've had a local patch floating around for a while to tweak trial inlining jitspew, but I've been too lazy to open a bug and land it; this is just related enough to justify folding it in.
Differential Revision: https://phabricator.services.mozilla.com/D114768
I am not sure if we should preserve parts of the accessor comment, because
the constructor always create complete descriptor now.
In the future switching GetPropertyAttributes to return JS::PropertyAttributes
seems like a good idea.
Depends on D114838
Differential Revision: https://phabricator.services.mozilla.com/D114839
Instead of manipulating the uncloned self-hosted function at runtime, process
the _SetCanonicalName call during BCE and save it in ScriptStencil. This
will later lead to directly instatiating self-hosted clones from a stencil
rather than cloning from the self-hosting realm.
Differential Revision: https://phabricator.services.mozilla.com/D113456
Now, when _SetCanonicalName is used, store the canonical name on the extended
slot instead of clobbering the display name. This ensures the function names
in the self-hosted realm match their binding names and the original source
code for better clarity. Instead we apply the canonical name during function
cloning where special cases already needed to exist to find the "original"
name. The net result should be easier to understand.
Differential Revision: https://phabricator.services.mozilla.com/D113455
This adds a fallible factory method to create new NumberFormat instances. This
allows us to report initialization errors at time of initialization, rather than
when format is called, and remove internal checks in the implementation for
successful initialization.
The existing fluent code assumes that creating a NumberFormat instance always
succeeds. This patch updates that code to handle failures.
Differential Revision: https://phabricator.services.mozilla.com/D114593