Closed
Bug 961077
Opened 11 years ago
Closed 11 years ago
PersistentRooted should not publicly derive from LinkedListElement
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(2 files, 1 obsolete file)
6.82 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
5.61 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
This allows clients to the API to put these into their own linked lists - something that can only have unfortunate consequences.
Assignee | ||
Comment 1•11 years ago
|
||
Here's a patch to make this use private inheritance. We need to make LinkedList<T> and LinkedListElement<T> friend classes so they can cast the base pointer down to a PersistentRooted pointer again. I removed the existing typedefs for these types because they're never used.
Attachment #8361793 -
Flags: review?(sphink)
Comment 2•11 years ago
|
||
Comment on attachment 8361793 [details] [diff] [review]
persistent-rooted-inheritance
Review of attachment 8361793 [details] [diff] [review]:
-----------------------------------------------------------------
The one thing that bothers me about this is the call through a 'marker' function pointer instead of templatizing on the function. Can the optimizer eliminate that? If not, something like the attached patch on top of your patch would eliminate a level of indirection.
Attachment #8361793 -
Flags: review?(sphink) → review+
Comment 3•11 years ago
|
||
Assignee | ||
Comment 4•11 years ago
|
||
(In reply to Steve Fink [:sfink] from comment #2)
> The one thing that bothers me about this is the call through a 'marker'
> function pointer instead of templatizing on the function. Can the optimizer
> eliminate that? If not, something like the attached patch on top of your
> patch would eliminate a level of indirection.
I agree, and I'm not sure of the answer. I'm going to land the original patch and look into this further.
Whiteboard: [leave open]
Assignee | ||
Comment 5•11 years ago
|
||
Assignee | ||
Comment 6•11 years ago
|
||
How about this? It's a version of your patch with typedefs to make it easier to read.
Attachment #8363171 -
Attachment is obsolete: true
Attachment #8363647 -
Flags: review?(sphink)
Comment 7•11 years ago
|
||
Comment on attachment 8363647 [details] [diff] [review]
tidy-perisitent-rooted
Review of attachment 8363647 [details] [diff] [review]:
-----------------------------------------------------------------
Oh! It's clever how you merged the two mark functions into a single signature.
Now you just need to eliminate markChainIfNotNull by partially specializing markChain on pointer types to do the null check... never mind, this is good! :)
Attachment #8363647 -
Flags: review?(sphink) → review+
Comment 8•11 years ago
|
||
Assignee | ||
Comment 9•11 years ago
|
||
Whiteboard: [leave open]
Comment 10•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in
before you can comment on or make changes to this bug.
Description
•