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 allows js::ExecuteInJSMEnvironment to take a target object argument
as used by the subscript loader. This adds WithEnvironments with a
corresponding lexical on top of the ordinary NonSyntacticVariablesObject
environment chain.
MozReview-Commit-ID: JhHEfV92Zpv
--HG--
extra : rebase_source : d1ef9564d30a25fd9e1cf1ca7e95bf40c780dcdf
While the flexibility of the current trait is nice, it's actually not
used to its fullest anywhere, and is boilerplate-y. While it is useful
to be able to put the links anywhere, there's not much usefulness from
being able to split mNext and mPrev.
So instead of a trait that allows to get/set mNext and mPrev
independently, we just use a trait that tells how to get a reference to
a DoublyLinkedListElement from a list element itself.
--HG--
extra : rebase_source : 674277bac4fc979f2e483a77b5ef1495baccc7fe
This class doesn't have anything to do with __exposedProps__ any more,
so give it a more descriptive name. We'd still like to remove it
entirely eventually.
MozReview-Commit-ID: 87KCpG6f8rI
--HG--
extra : rebase_source : 98a51a6af0fc8446dbcd8efa083d6c79286279d3
This patch gently removes support for __exposedProps__ by changing
ExposedPropertiesOnly::check() to always return false, while still
failing silently in deny for some kinds of access.
The tests that I changed all involve testing the behavior with
__exposedProps__. I adjusted them to expect it to fail, or to adjust
the error message they get when they fail. That seemed better than
deleting them entirely.
Note that test_bug1065185.html had a bug, so that it never executed
the first case. I fixed that, and then fixed up the test to work when
__exposedProps__ is not supported.
This also removes various bits of the test framework that use
__exposedProps__, but don't actually need to.
MozReview-Commit-ID: 8fvkAmITmXY
--HG--
extra : rebase_source : ef7e2c55adc12511f17f3865ebb46c343875f0b3
In the new order, it will be a compartment-level bit rather than a
realm-level bit, so it does not belong on the Scope.
--HG--
extra : rebase_source : 44aa4620f7fd7f8d253c8c7f09bf8c97c00ff061
extra : source : 5a9c01720d7929e43aa70341d3821bfaa2479592
The entire purpose of this patch is to support accessing this bit from
WrapperFactory (see the last hunk) without going through a particular
scope.
--HG--
extra : rebase_source : d2952e981f4b277e6ca565077c6e6d18c69c8df5
A hazard is reported where on one iteration through the loop over the arguments, obj is set to a JSObject*. Then on the next iteration, the analysis incorrectly things that the if test could skip overwriting obj, and instead call as() on the previous iteration's value. This turns out to be impossible because reaching as() requires the if condition to be false, which means that both branches of the or are evaluated, and the second branch assigns to obj.
It seems like the call to as() should be dominated by the obj assignment, but in practice the compiler assigns to a temporary boolean variable and then tests it, so in terms of control flow only the as() call is *not* dominated by the obj assignment.
This patch just roots obj.
--HG--
extra : rebase_source : bedc87a91756dcf9a57a7a2c36b98537c6fdd590
extra : histedit_source : 7b9cb11887aa01b927c3623bddb4069be01817f3
If you pass a string from script to an IDL method that takes an nsIAtom,
XPConnect will automagically atomize the string for you.
But nsIAtom is no longer scriptable (see the blockers for bug 1392883,
especially bug 1396694). So the code to convert can be removed.
--HG--
extra : rebase_source : af85fa48c1988348d3a9a81b05ed43403d3b730a
This tests both that the settings have the desired effect and that switching
between sharing enabled and sharing disabled without a startup cache flush
does not cause any issues.
Tests for user pref changes are currently non-fatal, since they're known not
to work reliably.
MozReview-Commit-ID: 1ZFwyiNf3da
--HG--
extra : rebase_source : c38bd92d2137c90f8c4d202b7009612b45ff4be9
User preference changes currently don't reliably take effect before component
loader initialization, which means they can't be used to write reliable tests.
Environment variables don't have this problem, so adding an environment
variable override makes testing much easier. It's also fairly convenient
during development, when we need to switch between different configurations
for testing.
MozReview-Commit-ID: 8PufRQNRnoU
--HG--
extra : rebase_source : c5ca2f3cb18a8398c95bbbf86e2cd27430f5161a
Scripts for use in shared globals need to be compiled for non-syntactic
scopes, while scripts for standalone globals should be compiled as global
scripts for better performance.
Since the startup cache and script preloader store scripts as they were
compiled in the last session, when global sharing settings may have been
different, it can lead to a mismatch, and a crash, due to loading the wrong
type of script.
Using a separate cache path for each type of script fixes this problem, since
it ensures that the cached script will always be of the type we expect.
MozReview-Commit-ID: DnNb2Xi6KeL
--HG--
extra : rebase_source : d2474d1da3f8e1066c21a7c65693ea09ec5b8074
This API is for use by mozJSComponentLoader to load JSMs into a
NonSyntacticVariablesObject with a shared global.
MozReview-Commit-ID: LtGdY4ULy45
--HG--
extra : rebase_source : 8d71718b567d7a00c4bfc4514ed342b9ab56c7b0
Remaining uses should only require it to outerize globals and perform
sanity checks.
MozReview-Commit-ID: JGq3gp3tAbY
--HG--
extra : rebase_source : 974ab7f0cb9a6a17aec499f7bf7fc1a8e770ccd5
It was possible to leak environments to script and debugger. This patch
simplifies the logic and removes confusing helper functions.
MozReview-Commit-ID: 4jEuYE4Q7bi
--HG--
extra : rebase_source : 8618e74bf2c67c096d540eed70bedce6928596ee
Split GetThisValue into three concerns:
1) Sanity check |this| and convert Window to WindowProxy
2) Find the |this| of an extensible LexicalEnvironmentObject
3) Find the target of a WithEnvironmentObject
MozReview-Commit-ID: I2U54IxClSy
--HG--
extra : rebase_source : 3257c79af0517aba2ec343d209945f10815eaf54
When we pre-compile scripts for a different global than they are eventually
executed in, we need to clone them into the new global before we can execute
them, which can be expensive. This also prevents us from using lazy parsing,
since lazy functions are currently eagerly compiled when cloned.
Since the vast majority of the scripts compiled by the preloader are executed
in the shared modules scope, initially compiling them there removes a lot of
startup overhead. For the few that aren't, we don't lose anything by compiling
them in the shared module global, but we also don't gain anything over
compiling them in the XPConnect compilation scope.
MozReview-Commit-ID: CEh42BmIMhL
--HG--
extra : rebase_source : 93f639022375dd3f0b8e06533e829ce4089d46b7
This removes the double-include macro hackery that we use to define two
separate string types (nsAString and nsACString) in favor of a templated
solution.
Annotations for Valgrind and the JS hazard analysis are updated as well as
the rust binding generations for string code.
This removes the double-include macro hackery that we use to define two
separate string types (nsAString and nsACString) in favor of a templated
solution.
Annotations for Valgrind and the JS hazard analysis are updated as well as
the rust binding generations for string code.
--HG--
extra : rebase_source : 63ab2c4620cfcd4b764d42d654c82f30f984d016
extra : source : 9115364cd4aa078c49bba7911069f8178e55166f
While the flexibility of the current trait is nice, it's actually not
used to its fullest anywhere, and is boilerplate-y. While it is useful
to be able to put the links anywhere, there's not much usefulness from
being able to split mNext and mPrev.
So instead of a trait that allows to get/set mNext and mPrev
independently, we just use a trait that tells how to get a reference to
a DoublyLinkedListElement from a list element itself.
--HG--
extra : rebase_source : f84c5799c305a4a3b7dc5deb727a05d4d537bb15
While the flexibility of the current trait is nice, it's actually not
used to its fullest anywhere, and is boilerplate-y. While it is useful
to be able to put the links anywhere, there's not much usefulness from
being able to split mNext and mPrev.
So instead of a trait that allows to get/set mNext and mPrev
independently, we just use a trait that tells how to get a reference to
a DoublyLinkedListElement from a list element itself.
--HG--
extra : rebase_source : b7d502754a764670e291acdd56726948db935497
These flags don't guarantee that the getter and setter functions are defined.
MozReview-Commit-ID: GBcoRYoKHqL
--HG--
extra : rebase_source : 1234ec91cf05566a3130360b152bf2cb986ec1c3
Going through the extension policy service rather than using
WebExtensionPolicy objects directly adds a lot of unnecessary overhead to
common operations on extension principals, and also makes the code more
complicated than it needs to be.
We also use weak references to policy objects here, since principals should
ideally lose as much of their elevated privileges as possible once the
extension instance that created them has been destroyed (which is something we
couldn't handle easily when we simply tracked ID strings).
MozReview-Commit-ID: KDNvVdvLkIt
--HG--
extra : rebase_source : 1b567919d2461bd0315d1a7d89f330cbd585f579
Only use the promotion rate to make pre tenuring and nursery size decisions
(now that it is calculated correctly and not under-estimated) if the nursery
is at least 90% full.
Asserts in MoveEmitterMIPS[32|64]::emitDoubleMove cause failures in some
tests, but they are redundant. The asserts check if the source or
destination register is scratch register, however scratch register is
actually used only for memory to memory move.
When triggering an iframe load or starting to parse a document for an iframe, the main thread may often have some time before the new page has been created. Try to trigger CC/GC slice at such point in order to avoid collector later when page is already executing its JS
--HG--
extra : rebase_source : 806df0af1dbaefb1761134eca0bb7c6ade6ac1a9
This are some unit tests to track regressions in the environment
behavior exposed to embeddings for various javascript loaders inside
Gecko.
MozReview-Commit-ID: 8pn56Skwbat
The `name_` field of AutoFlushICache is only ever passed to JitSpew* on
ARM, and on non-debug builds, JitSpew* essentially disappears, so clang
claims `name_` is unused. It is annoying to jump through hoops to
satisfy clang here, but that's life with fatal warnings.