DescriptionOilpan: Support polymorphic objects in HeapVectorBackings
This CL supports HeapVector<T> where T is ALLOW_ONLY_INLINE_ALLOCATION and T has a vtable.
The way we support it is somewhat hacky:
1) VectorUnusedSlotClearer zeros out unused slots.
2) HeapVectorBacking calls finalizers and trace methods only for slots that are not zeroed out if T has a vtable. That way we can avoid HeapVectorBacking from visiting unused slots.
Note: For T that doesn't have a vtable, HeapVectorBacking visits all objects (including unused slots) treating a zeroed slot as a valid object. This works as long as T is canInitializeWithMemset. This means that after this CL, HeapVector can support objects that are canInitializeWithMemset or have a vtable. This CL adds a static_assert about it to Heap.h.
BUG=475801
TEST=HeapTest.VectorDestructorsWithVtable
TBR=tkent
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194780
Patch Set 1 #Patch Set 2 : #
Total comments: 5
Patch Set 3 : #
Total comments: 3
Messages
Total messages: 16 (5 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||