Remove use of CustomAutoRooter and replace with Rooted in js/
Categories
(Core :: JavaScript: GC, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox67 | --- | fixed |
People
(Reporter: jonco, Assigned: allstars.chh)
Details
(Keywords: triage-deferred)
Attachments
(3 files, 7 obsolete files)
|
3.28 KB,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
|
2.25 KB,
patch
|
jonco
:
review+
|
Details | Diff | Splinter Review |
|
19.41 KB,
patch
|
allstars.chh
:
review+
|
Details | Diff | Splinter Review |
| Reporter | ||
Comment 1•9 years ago
|
||
Updated•8 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
| Assignee | ||
Comment 4•6 years ago
|
||
| Assignee | ||
Comment 5•6 years ago
|
||
So far there are only 3 places needs to be updated, also the other 2 class, AutoSetNewOBjectMetadata and CacheIRWriter will stay as they are now, so I remove the 'meta' keyword as I think these could be fixed in one bug.
Jonco also mentioned another possibility to use Rooted for NewObjectMetadataState
https://searchfox.org/mozilla-central/rev/490ab7f9b84570573a49d7fa018673ce0d5ddf22/js/src/vm/Realm.h#188,
I'll file another bug for this since it doesn't relate to CustomAutoRooter.
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Reporter | ||
Comment 6•6 years ago
|
||
| Reporter | ||
Comment 7•6 years ago
|
||
| Reporter | ||
Comment 8•6 years ago
|
||
| Assignee | ||
Comment 9•6 years ago
|
||
Hi Steve
Jonco suggested me to use Rooted<GCVector<>> in comment 7, however there are some questions I'll need your suggestion
-
The original AutoLookupVector will overload the operator->
https://searchfox.org/mozilla-central/source/js/src/vm/SavedStacks.cpp#249, but now with Rooted, I have to use get() to get the instance, is this correct? -
removal of HandleLookup
Now we will get JS::Handle<Lookup> or JS::MutableHandle<Lookup> from methods of AutoLookupMethod, and like original HandleLookup, I use get() to update the data structure inside Lookup, is this okay?
Thanks
Comment 10•6 years ago
|
||
| Assignee | ||
Comment 11•6 years ago
|
||
(In reply to Steve Fink [:sfink] [:s:] from comment #10)
Thanks for the feedback, this clears the questions in my mind.
I do sort of wonder if we could somehow make operator[] return a
Handle<Lookup*> instead of a Handle<Lookup>, but maybe that's too weird.
So far I am not sure when to use Rooted<T> or Rooted<T*>
but from https://searchfox.org/mozilla-central/rev/38035ee92463c9e9fbca729ac7e66476ac7eb27a/js/public/TraceKind.h#166
If we want to use Rooted<T*>, T will need to have 'kind' (JS::TraceKind) member, that means we have to define a 'TraceKind' for Lookup.
Not sure if adding a TraceKind for Lookup makes sense, but if it does, I'll try to do this and this will help my patch simpler.
Comment 12•6 years ago
|
||
(We discussed this in our meeting, and decided that Handle<Lookup*> is a bad idea because it doesn't match Rooted<Lookup>. It was probably a bad idea anyway.)
| Assignee | ||
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
| Assignee | ||
Comment 16•6 years ago
|
||
Addressed comment 15 to use Handle<Lookup>
One problem (left as a TODO) in this patch is GCVector.operator[] will return a [Mutable]Handle<T>, whereas GCVector.back() will return T&
operator[]
https://searchfox.org/mozilla-central/source/js/public/GCVector.h#173
https://searchfox.org/mozilla-central/source/js/public/GCVector.h#197
https://searchfox.org/mozilla-central/source/js/public/GCVector.h#200
back()
https://searchfox.org/mozilla-central/source/js/public/GCVector.h#170
https://searchfox.org/mozilla-central/source/js/public/GCVector.h#195
and these two will be used in
https://searchfox.org/mozilla-central/source/js/src/vm/SavedStacks.cpp#1486
https://searchfox.org/mozilla-central/source/js/src/vm/SavedStacks.cpp#1504
trying to figure out how to fix this.
| Assignee | ||
Comment 17•6 years ago
|
||
| Assignee | ||
Comment 18•6 years ago
|
||
Hi Steve
Jonco suggested me to use WrappedPtrOperation to get rid of get(), also try to use Rooted<GCVector> for AutoLookupVector, could you help to review this again?
Thanks
Comment 19•6 years ago
|
||
| Assignee | ||
Comment 20•6 years ago
|
||
Hi Steve
Your comment 19 is a good idea, I have addressed them (also with some nits I found), can you review this?
I'll merge this with Part 2 once they both get r+.
Thanks
Updated•6 years ago
|
| Assignee | ||
Comment 21•6 years ago
|
||
merge two patches
| Assignee | ||
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
Comment 24•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/7a0de0939e2f
https://hg.mozilla.org/mozilla-central/rev/ba49b929457a
https://hg.mozilla.org/mozilla-central/rev/9685cdc4b7cb
Description
•