Closed Bug 442729 Opened 11 years ago Closed 11 years ago

Annotate stack-only classes in layout

Categories

(Core :: Layout, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla1.9.1a1

People

(Reporter: benjamin, Assigned: benjamin)

References

Details

Attachments

(1 file)

PCOMGC needs various classes that appear only on the stack to be annotated, for correct rewriting and analysis. This bug covers such classes in layout/ and view/.
Attachment #327441 - Flags: superreview?(roc)
Attachment #327441 - Flags: review?(roc)
Blocks: XPCOMGC
Attachment #327441 - Attachment is patch: true
Attachment #327441 - Attachment mime type: application/octet-stream → text/plain
+class NS_STACK_CLASS nsSVGFilterInstance

Why are these classes labelled the way they are? Does nsSVGFilterInstance have to be on the stack for some reason? We might one day want to cache nsSVGFilterInstances.
These classes were selected because they contain nsCOMPtr members. In XPCOMGC, you have several different "storage types" with different requirements:

* stack-only types: any member-comptrs are rewritten to be raw pointers
* GC-only types: use nsCOMPtr members for write barriers
* managed types: can appear on the stack or the GC heap: member pointers to GC types are rewritten to be raw pointers instead of COMPtrs, but special care has to be taken to fire write barriers correctly.

I'm trying to have as few managed types as practical because of the difficulties of dealing with write-barrier correctness. If we need to remove the stack-only annotation in the future for specific classes such as nsSVGFilterInstance, we can certainly do so.
Comment on attachment 327441 [details] [diff] [review]
NS_STACK_CLASS for layout/ and view/, rev. 1

OK, thanks for the explanation.
Attachment #327441 - Flags: superreview?(roc)
Attachment #327441 - Flags: superreview+
Attachment #327441 - Flags: review?(roc)
Attachment #327441 - Flags: review+
Pushed, revision 0ae69a177872
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1a1
You need to log in before you can comment on or make changes to this bug.