[V8] Garbage collection should use opaque roots rather than implicit references
https://bugs.webkit.org/show_bug.cgi?id=100707

Reviewed by Kentaro Hara.

Source/WebCore:

This patch replaces visitDOMWrapper with opaqueRootForGC. The
former used to inform V8 of implicit relationships between wrapper
objects on a per-wrapper basis. That meant that we needed to know which
DOMDataStore a given wrapper was in during garbage collection.

After this patch, we now use object groups rather than implicit
references to inform V8 of these relationships. That has two benefits:

1) We no longer need to know which DOMDataStore a wrapper belongs
   because we don't need to find the exact source wrapper for the
   implicit connection.

2) We can now handle more complicated implicit relationships, for
   example when some of the intervening objects haven't had their
   JavaScript wrappers created yet.

This patch also unlocks to paths of future development:
A) Fixing the remaining failures in fast/dom/gc-9.html
B) Enumerating DOM wrappers entirely from V8 rather than from the
   DOMWrapperMaps (so that we can move more object towards using
   IntrusiveDOMWrapperMaps, which aren't enumerable from WebCore).

* bindings/scripts/CodeGeneratorV8.pm:
(NeedsCustomOpaqueRootForGC):
(GenerateOpaqueRootForGC):
(GenerateHeader):
(GenerateImplementation):
* bindings/v8/V8GCController.cpp:
(ImplicitConnection):
(WebCore::ImplicitConnection::ImplicitConnection):
(WebCore::ImplicitConnection::root):
(WebCore::ImplicitConnection::wrapper):
(WebCore):
(WebCore::operator<):
(WrapperGrouper):
(WebCore::WrapperGrouper::WrapperGrouper):
(WebCore::WrapperGrouper::addToGroup):
(WebCore::WrapperGrouper::keepAlive):
(WebCore::WrapperGrouper::apply):
(WebCore::ObjectVisitor::ObjectVisitor):
(WebCore::ObjectVisitor::visitDOMWrapper):
(ObjectVisitor):
(WebCore::V8GCController::opaqueRootForGC):
(WebCore::NodeVisitor::NodeVisitor):
(WebCore::NodeVisitor::visitNodeWrapper):
(NodeVisitor):
(WebCore::V8GCController::majorGCPrologue):
* bindings/v8/V8GCController.h:
(WebCore):
(V8GCController):
* bindings/v8/WrapperTypeInfo.h:
(WebCore):
(WebCore::WrapperTypeInfo::opaqueRootForGC):
(WrapperTypeInfo):
* bindings/v8/custom/V8NodeListCustom.cpp:
(WebCore::V8NodeList::opaqueRootForGC):
* bindings/v8/custom/V8SpeechRecognitionResultCustom.cpp:
(WebCore::V8SpeechRecognitionResult::opaqueRootForGC):

LayoutTests:

Test progression.

* platform/chromium/fast/dom/gc-9-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed chromium mac ml expectation updating.

* platform/chromium-mac-mountainlion/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed gardening.  Mark a crashy test.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, remove entries for tests no longer failing.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled DEPS.

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-31

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderArena has a memory leak and poor efficiency
https://bugs.webkit.org/show_bug.cgi?id=100893

Reviewed by Eric Seidel.

1) Avoid memory leak that persists for the Document lifetime by
increasing recycled size buckets up to 1024. It was previously 400,
and sizeof(RenderNamedFlowThread) / sizeof(RenderSVGText) both blew this
quota. An assert was added to prevent this happening again.

2) Fix the size of the recyled size bucket array on 64-bit. We only
need 8 byte granularity on 64-bit, but we had 4.

3) Try and pass power-of-two sizes to the underlying malloc() call, so
that we're space efficient. We now take Arena metadata into account.

4) Double the default RenderArena size allocation to 8192 bytes. Even
for a render of a trivial text file, 4096 bytes is not enough to prevent
extra calls into the underlying malloc() for more arena pool.

* rendering/RenderArena.cpp:
(WebCore::RenderArena::RenderArena): Adjust arena size so that we pass on the page-sized multiple to the underlying malloc() implementation.
(WebCore::RenderArena::allocate):
(WebCore::RenderArena::free): Assert that the allocation size is handled by our recycling buckets.
* rendering/RenderArena.h:
(WebCore): Maintain free buckets up to 1024 bytes to avoid memory leak.
(RenderArena): Double the default allocation size and handle 64-bit systems more efficiently.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Missing stderr output when using run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=100709

Reviewed by Dirk Pranke.

Appends #EOF to the end of the stderr output only at the end of a test,
not possibly part-way through. This will allow all of the stderr output
to appear on the results page after running run-webkit-tests.

* DumpRenderTree/chromium/TestEventPrinter.cpp:
(TestEventPrinter::handleTextFooter):
(TestEventPrinter::handleTestFooter):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133120 268f45cc-cd09-0410-ab3c-d52691b4dbfc