Closed Bug 658564 Opened 14 years ago Closed 14 years ago

If ExactStructContainer has a NULL finalizer it should not be allocated as a finalizable object

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lhansen, Assigned: lhansen)

References

Details

(Whiteboard: has-patch)

Attachments

(1 file)

Ideally it would be allocated in non-finalized memory so that the GC does not have to look at it to see if it's finalizable; at the very least the "finalize" bit should be turned off so that the empty constructor is not called.
There's a Serrano regression caused by this problem: AS2 variable arrays (internal to the AS2 ScriptObject) now use ExactStructContainer, while before they used GC::Callocated memory which was non-finalizable. So finalizers are invoked on all those variable arrays that are taken by the garbage collector, and if we had deeper testing we would have found that objects passed to GC::Free were finalizable but not finalized (contrary to what should be the case).
Attached patch PatchSplinter Review
This is a mostly principled solution to the problem: extend the new operators for GCFinalizedObject so that it's possible to ask for no finalization at construction time. This ties in with segregated allocation for finalization and does not require exposing GC::ClearFinalize. An even more principled solution would have been to introduce a new GC class, GCFinalizableObject; that seemed too much right now, and it can come later.
Attachment #534722 - Flags: review?(treilly)
Probable slight performance regression for Serrano; I'm inclined to let it slide - it disappears in the noise around exact tracing anyway - and not push the fix to Serrano, but I'd like QRB backing for that.
Flags: flashplayer-qrb?
Whiteboard: has-patch
It would also be good to remove the storage for _finalizer when it wasn't required, especially for these power of two sized arrays. Like maybe finalizer could be a template parameter instead of a member.
Attachment #534722 - Flags: review?(treilly) → review+
(In reply to comment #4) > It would also be good to remove the storage for _finalizer when it wasn't > required, especially for these power of two sized arrays. Like maybe > finalizer could be a template parameter instead of a member. I will make a note of that on the bug for generic array types.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Flags: flashplayer-qrb? → flashplayer-qrb+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: