This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.
--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
It's easy to mess up the scoping so that (a) the label is pushed and then
immediately popped, and/or (b) the string doesn't live long enough. It's also
easy to do a utf16-to-utf8 conversion unnecessarily when the profiler is
inactive. This patch splits that macro into three new ones that are harder to
mess up.
- AUTO_PROFILER_LABEL_DYNAMIC_CSTR: same as current.
- AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING: for nsCStrings.
- AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING: for nsStrings.
--HG--
extra : rebase_source : 3e2bbec4737b696e1c86579ae54be4cb3186c100
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.
--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.
MozReview-Commit-ID: 1ah5JUAZwBA
--HG--
extra : rebase_source : 45a3974cb80ede0cb3beea92f895679c5ea7aa4b
We want to be able to store scripts compiled with or without
non-syntactic support in cache when we toggle JSM global sharing. In
current code this script is cloned on execution, but with JSM global
sharing we have would hit assertions.
MozReview-Commit-ID: 2pVTTxLpx6S
--HG--
extra : rebase_source : b123de20f216161c408bba75c8c0fd81be0508df
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.
MozReview-Commit-ID: 1ah5JUAZwBA
--HG--
extra : rebase_source : 202904e30b582c788ec440c406607ba98b8836e6
We want to be able to store scripts compiled with or without
non-syntactic support in cache when we toggle JSM global sharing. In
current code this script is cloned on execution, but with JSM global
sharing we have would hit assertions.
MozReview-Commit-ID: 2pVTTxLpx6S
--HG--
extra : rebase_source : 5913a43a2dfddf74187f08ab9c53babe377bd706
When using the subscript loader with JSM global sharing, it was possible
that subscript would pollute the global of all JSMs in the sharing.
MozReview-Commit-ID: 1ah5JUAZwBA
--HG--
extra : rebase_source : 5fecf7dc61019431d67bcee4199e40a8278c8c64
This patch adds a preference jsloader.shareGlobal that makes it so
that JSMs share a single global, in order to reduce memory usage. The
pref is disabled by default, and will be enabled in a later bug. Each
JSM gets its own NonSyntacticVariablesObject (NSVO), which is used for
top level variable bindings and as the value of |this| within the JSM.
For the module loader, the main change is setting up the shared
global, and the NSVO for each JSM. A number of files are blacklisted
from the shared global, because they do things to the global that
would interfer with other JSMs. This is detailed in
mozJSComponentLoader::ReuseGlobal().
MozReview-Commit-ID: 3qVAc1c5aMI
--HG--
extra : rebase_source : fe7e2672be8d09d6b7cec25e08cd464ff3cd6573
The existing code uses various intermediate objects, but the only
thing they are used for now is to figure out if the compartment we're
in has the system principal or not, so just compute that directly.
MozReview-Commit-ID: FMoWfAX8rGW
--HG--
extra : rebase_source : 385ab0e10a0c719155c48e3822e7844434f417f8
This patch makes the following changes to the macros.
- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
mostly misused.
- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
universally available now anyway.
- Combines the first two string literal arguments of PROFILER_LABEL and
PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
them to be separate, and it forced a '::' in the label, which isn't always
appropriate. Also, the meaning of the "name_space" argument was interpreted
in an interesting variety of ways.
- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
it clearer they construct RAII objects rather than just being function calls.
(I myself have screwed up the scoping because of this in the past.)
- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
the caller doesn't need to. This makes a *lot* more of the uses fit onto a
single line.
The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).
- Fixes a bunch of labels that had gotten out of sync with the name of the
class and/or function that encloses them.
- Removes a useless PROFILER_LABEL use within a trivial scope in
EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
a good idea.
- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
done within them, instead of at their callsites, because that's a more
standard way of doing things.
--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
This is useful for legacy addons as we increasingly lockdown filesystem access
in content processes.
MozReview-Commit-ID: AZbsSFpbIvt
--HG--
extra : rebase_source : 56dfe91ac9fbeb0bd48dc8a2f87ed6038e7521cc
Thanks to the previous patch, we never set any of the function
arguments, so they can be removed, and various code for running
functions can be deleted.
MozReview-Commit-ID: BTIIyDtBPMR
--HG--
extra : rebase_source : 944adf3ac8f1579639e631a478fc286e980972ab
FindTargetObject in DoLoadSubScriptWithOptions will always return a
global object, so the boolean values we pass around to determine if a
global was being reused will always be false. The next patch will
eliminate the various |function| arguments that are now unused.
MozReview-Commit-ID: GvPNFGluRub
--HG--
extra : rebase_source : 76a67f5523153a37942c2730388e62125ecf4390
Also, be consistent with the rest of the code and use a handle
typedef in one place.
MozReview-Commit-ID: KY3cnLemoUl
--HG--
extra : rebase_source : 4c3ae2750c868b5401a686dd164adbd04b45a0b5