This splits the API into two, one that does a bunch of checks and calls into
the JS engine, and one for use by the CC where all preconditions are assumed to
be satisfied and can be inlined entirely.
Depends on D140865
Differential Revision: https://phabricator.services.mozilla.com/D140866
This is a backout of the patch in bug 1581574 in the hope that it will fix the
crashes in bug 1731432.
Previously this write barrier was not required and we relied on the read
barrier, but it seems that may not be sufficient to allow us to mark gray roots
after the first GC slice. There are few ways that the value of a Heap<T> can be
observed without triggering the read barrier, and that could explain what's
happening here.
The contents of JS holders are cleared when they are removed from the holder
map, so that will also trigger the write barrier.
Differential Revision: https://phabricator.services.mozilla.com/D126253
This is a backout of the patch in bug 1581574 in the hope that it will fix the
crashes in bug 1731432.
Previously this write barrier was not required and we relied on the read
barrier, but it seems that may not be sufficient to allow us to mark gray roots
after the first GC slice. There are few ways that the value of a Heap<T> can be
observed without triggering the read barrier, and that could explain what's
happening here.
The contents of JS holders are cleared when they are removed from the holder
map, so that will also trigger the write barrier.
Differential Revision: https://phabricator.services.mozilla.com/D126253
The link pointers move to the base class in a similar way to PersistentRootedBase.
This lets us get rid of a bunch more reinterpret_casts.
Differential Revision: https://phabricator.services.mozilla.com/D125952
I don't think this does anything. The type is always present so we won't
restrict use of this constructor by SFINAE, although I may have misunderstood
the purpose of this.
I tried 'fixing' the SFINAE to what I though it should be by using enable_if_t
but it had the same effect as removing it. In both cases the code compiles, and
if I try to construct a rooted with an inappropriate argument it fails with a
sensible error.
Differential Revision: https://phabricator.services.mozilla.com/D125949
The link pointers move to the base class in a similar way to PersistentRootedBase.
This lets us get rid of a bunch more reinterpret_casts.
Differential Revision: https://phabricator.services.mozilla.com/D125952
I don't think this does anything. The type is always present so we won't
restrict use of this constructor by SFINAE, although I may have misunderstood
the purpose of this.
I tried 'fixing' the SFINAE to what I though it should be by using enable_if_t
but it had the same effect as removing it. In both cases the code compiles, and
if I try to construct a rooted with an inappropriate argument it fails with a
sensible error.
Differential Revision: https://phabricator.services.mozilla.com/D125949
When compiling spidermonkey public APIs under MSVC, the dummy type RootListEntry
needs a GCPolicy even though it is not instantiated.
Differential Revision: https://phabricator.services.mozilla.com/D119428
Convert all JS_FRIEND_API to JS_PUBLIC_API. At this point, the JS_PUBLIC_API has
no formal curation process and in practice we add a lot of new features to
JS_FRIEND_API without giving much thought to if they should be public. The
result is that all embedders need to use the friend API in some form and the
distinction has lost meaning.
Going forward, we should continue to use the js/public/experimental directory as
a place to expose new APIs, and in general should strive for high quality of the
APIs that are exposed. If a particular API is tricky or discouraged, comments
explaining that will be more helpful that a losely applied FRIEND_API marker.
Differential Revision: https://phabricator.services.mozilla.com/D117607
Add a common base type with the template parameter erased. This lets us remove
the RootListEntry type and the undefined reinterpret_casts it is using.
Depends on D117604
Differential Revision: https://phabricator.services.mozilla.com/D117605
Add a common base type for all PersistentRooted instead of relying on undefined
reinterpret_casts. This avoids PersistentRooted<RootListEntry*> which causes
potential issues when SpiderMonkey is used in a project compiled under MSVC. The
static_cast is still unchecked so the same care needs to be taken as before.
Depends on D117603
Differential Revision: https://phabricator.services.mozilla.com/D117604
WASI doesn't support catching call-stack overflows with
stack-pointer checks, so custom RecursionLimiter is used to directly count entries to certain functions
and report stack overflows.
Differential Revision: https://phabricator.services.mozilla.com/D111813