Now that all the bad type-punning is gone, JS::Value has a single
asBits_ field and we should use a class aggregate type instead.
Differential Revision: https://phabricator.services.mozilla.com/D46325
--HG--
extra : moz-landing-system : lando
Now that all the bad type-punning is gone, JS::Value has a single
asBits_ field and we should use a class aggregate type instead.
Differential Revision: https://phabricator.services.mozilla.com/D46325
--HG--
extra : moz-landing-system : lando
Most live nursery strings can be deduplicated in moveToTenured through a hashset.
Dependent strings are complicated to deal with since their chars need to be updated with the newly deduplicated base chars.
If the dependent string is tenured, its bases cannot be deduplicated since a tenured dependent string chars cannot be updated. Otherwise, the following steps will be able to update its chars.
1. Preserve the nursery base chain by saving dependent string nursery bases in its relocation overlay. This allows dependent string nursery root base to be reached.
2. Calculate the original dependent string base offset: dependent string nursery chars - dependent string root base nursery chars. Root base nursery chars is saved in its relocation overlay.
3. Update the dependent string chars with its new root base chars and the calculated offset.
4. Assign either the root base or the undepended string in which the dependent string uses chars from as the new base to unchain any potentially long dependency chain.
Differential Revision: https://phabricator.services.mozilla.com/D39440
--HG--
extra : moz-landing-system : lando
The final huge patch. This is a search-and-replace removal of js::Class followed by clang-format and removal of the alias from TypeDecls.h.
Depends on D41986
Differential Revision: https://phabricator.services.mozilla.com/D41987
--HG--
extra : moz-landing-system : lando
JSClass contained void* members corresponding to the internal pointer members of js::Class. This stores the internal members in JSClass and removes js::Class.
This leaves js::Class aliased to JSClass while we remove references to it. I also aliased Jsvalify and Valueify into global scope temporarily to make this compile. These get removed in the following patches.
I had to remove a few functions which now don't compile with js::Class being the same type as JSClass.
Differential Revision: https://phabricator.services.mozilla.com/D41983
--HG--
extra : moz-landing-system : lando
Merge js::FreeOp and JSFreeOp, but alias the former to the latter while we fix uses.
Differential Revision: https://phabricator.services.mozilla.com/D41410
--HG--
extra : moz-landing-system : lando
Merge js::FreeOp and JSFreeOp, but alias the former to the latter while we fix uses.
Differential Revision: https://phabricator.services.mozilla.com/D41410
--HG--
extra : moz-landing-system : lando
This replaces the use of heap-alloced Rooted with PersistentRooted which is safe wrt destruction order.
I had to add PersistentRooted and StackGCVector to OPAQUE_TYPES to make this work... I'm not really sure what this does.
Differential Revision: https://phabricator.services.mozilla.com/D30668
--HG--
extra : moz-landing-system : lando
Introduce a MOZ_STACK_CLASS StackGCVector, which is
specialization of inline capacity to 8 of GCVector.
Differential Revision: https://phabricator.services.mozilla.com/D23182
--HG--
extra : moz-landing-system : lando
- modify line wrap up to 80 chars; (tw=80)
- modify size of tab to 2 chars everywhere; (sts=2, sw=2)
--HG--
extra : rebase_source : 7eedce0311b340c9a5a1265dc42d3121cc0f32a0
extra : amend_source : 9cb4ffdd5005f5c4c14172390dd00b04b2066cd7
This compartment flag was only ever needed in order to track system-privileged
add-on code running under the compartment-per-addon system. That system, and
the legacy add-ons it supported, are gone.
WebExtension compartments have their add-on ID stored on their principal, and
are tracked in less obtrusive ways, so this code is no longer useful.
MozReview-Commit-ID: NVEd3Oawak
--HG--
extra : rebase_source : 31908a4daa5e7897ce165a5383110fb722391662
This adds JS::Zone to TypeDecls.h. Arguably that is pretty borderline, but
even though the Zone type is only used in a dozen or so places in Gecko,
it's a central concept.
--HG--
extra : rebase_source : 2267ad26c8888f3db9213acdb64ce7a56b1c16e5
extra : source : 7f7eb82a83f47c8e1a4b67527c42f88e35f9ff4a
Layout: js/src/vm/Symbol.h defines the new class JS::Symbol. JS::Symbol is the
same size as JSString on all platforms, because the allocator does not support
smaller allocations.
Allocation: Since the purpose of symbols is to serve as property keys, they are
always allocated in the atoms compartment.
We take a lock when allocating. This could probably be replaced with a
main-thread-only assertion. However, if atom allocation is not already a
bottleneck, symbol allocation probably never will be.
Symbols are given their own finalize-class in the GC. This means we allocate a
page per zone for symbols, even though they are only ever allocated in the
atoms zone. Terrence thought this could be easily fixed later. It should be; we
never touch the page, but a 32-bit virtual address space does not just have
infinite pages to spare.
A jsapi-test exercises the new symbol allocation code. A few oddities in
jsapi-tests are fixed in passing.
Discussion after review led to some new assertions about minimum object size in
AllocateObject and AllocateNonObject.
--HG--
extra : rebase_source : 45abb651d3b1b493d77a5dd0eb554f96b058c63a
The API for symbol Values is much like the API for strings.
The implementation behind all this is in a later patch. Here, a class
JS::Symbol is declared, but not defined anywhere yet.
The constants being deleted from js/public/Value.h probably haven't been used
since Tracemonkey days.
--HG--
extra : rebase_source : 5b2d0cc4d99223483e850ee80913eef3854c427c