Summary: | Introduced the concept of opaque roots, in preparation for marking the DOM with them | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Geoffrey Garen <ggaren> | ||||
Component: | New Bugs | Assignee: | Geoffrey Garen <ggaren> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | buildbot, oliver | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Other | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Geoffrey Garen
2011-04-05 16:22:58 PDT
Created attachment 88333 [details]
Patch
Comment on attachment 88333 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=88333&action=review > Source/JavaScriptCore/collector/handles/HandleHeap.cpp:110 > + ASSERT(isValidWeakHandle(node->slot())); > + JSCell* cell = node->slot()->asCell(); > + if (Heap::isMarked(cell)) > + continue; > + > + WeakHandleOwner* weakOwner = node->weakOwner(); > + if (!weakOwner) > + continue; > + > + if (!weakOwner->isReachableFromOpaqueRoots(Handle<Unknown>::wrapSlot(node->slot()), node->weakOwnerContext(), markStack)) > + continue; > + > + heapRootMarker.mark(node->slot()); I wish we could do something to separate out handles that will remain alive as we enumerate them, otherwise we end up visiting nodes repeatedly (even if just for an isMarked check) > I wish we could do something to separate out handles that will remain alive as we enumerate them, otherwise we end up visiting nodes repeatedly (even if just for an isMarked check)
This loop almost always executes exactly once, so the tradeoff probably doesn't favor this approach, but:
I think we could optimize by doing an initial pass to separate off the unmarked handles into a temporary linked list. Thereafter, we could iterate only that linked list.
Attachment 88333 [details] did not build on win: Build output: http://queues.webkit.org/results/8346011 Attachment 88333 [details] did not build on win: Build output: http://queues.webkit.org/results/8343016 Committed r83011: <http://trac.webkit.org/changeset/83011> |