[V8] Use implicit references instead of object groups to keep registered MutationObse...
authoradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 23:56:27 +0000 (23:56 +0000)
committeradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Mar 2013 23:56:27 +0000 (23:56 +0000)
commite40a85623ae07df552239f76a36b9466201f43e0
tree2ddd8a2a4f0c94111c144e5d1e706581a11d2599
parent24536c377ed3e4590c1ff12891c1145b0c8d7df7
[V8] Use implicit references instead of object groups to keep registered MutationObservers alive
https://bugs.webkit.org/show_bug.cgi?id=111382

Reviewed by Adam Barth.

.:

* ManualTests/mutation-observer-leaks-nodes.html: Added.

Source/WebCore:

Two-phase approach to implicit references: after grouping objects
together, add an implicit reference between each registered node's
group and the MutationObserver's group (which includes wrappers from
all worlds).

Also changed many uses of v8::Value to v8::Object where we know we're
dealing with Object and the V8 API expects them.

Test: ManualTests/mutation-observer-leaks-nodes.html

* bindings/v8/V8GCController.cpp:
(WebCore::ImplicitConnection::ImplicitConnection):
(WebCore::ImplicitConnection::wrapper):
(ImplicitConnection):
(WebCore::ImplicitReference::ImplicitReference): Wrapper class holding a parent who should have an implicit reference to a child.
(ImplicitReference):
(WebCore::operator<): Needed for std::sort() call to avoid the overhead of using a HashMap
(WebCore::WrapperGrouper::addObjectWrapperToGroup):
(WebCore::WrapperGrouper::addNodeWrapperToGroup):
(WebCore::WrapperGrouper::addImplicitReference):
(WrapperGrouper):
(WebCore::WrapperGrouper::apply):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
ManualTests/mutation-observer-leaks-nodes.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/V8GCController.cpp