[V8] ScriptWrappable should hold the wrapper handle directly (Dromaeo/dom-modify...
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 18:14:22 +0000 (18:14 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 18:14:22 +0000 (18:14 +0000)
commit156d01ad45b9308b2354398f18902f09c07d7bca
treedb26c7f8ebc26b9bceaa2fc49c162166ddee727a
parent5cc61e508c79e8b6f3bc5d6eddb2a6347d467b5e
[V8] ScriptWrappable should hold the wrapper handle directly (Dromaeo/dom-modify and dom-traverse get ~2.5% faster)
https://bugs.webkit.org/show_bug.cgi?id=97974

Reviewed by Eric Seidel.

Previously, we stored a pointer to a handle to a wrapper in Node. That
is an extra layer of indirection that slows down finding the wrapper
for the node. A handle is just a pointer, so we might as we just store
the handle in the Node directly. That speeds up dom-modify and
dom-traverse by about 2.5%.

This change also lets us get rid of the ChunkedTable we were using to
store all the wrappers because they're now stored in the Nodes
directly.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
* bindings/v8/IntrusiveDOMWrapperMap.h:
(WebCore::IntrusiveDOMWrapperMap::IntrusiveDOMWrapperMap):
(WebCore::IntrusiveDOMWrapperMap::get):
(WebCore::IntrusiveDOMWrapperMap::set):
(WebCore::IntrusiveDOMWrapperMap::contains):
(WebCore::IntrusiveDOMWrapperMap::visit):
(WebCore::IntrusiveDOMWrapperMap::removeIfPresent):
(WebCore::IntrusiveDOMWrapperMap::clear):
* bindings/v8/ScriptWrappable.h:
(WebCore::ScriptWrappable::ScriptWrappable):
(WebCore::ScriptWrappable::wrapper):
(WebCore::ScriptWrappable::setWrapper):
(WebCore::ScriptWrappable::disposeWrapper):
(WebCore::ScriptWrappable::reportMemoryUsage):
(ScriptWrappable):
* bindings/v8/V8DOMWrapper.h:
(WebCore::V8DOMWrapper::getCachedWrapper):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/v8/IntrusiveDOMWrapperMap.h
Source/WebCore/bindings/v8/ScriptWrappable.h
Source/WebCore/bindings/v8/StaticDOMDataStore.h
Source/WebCore/bindings/v8/V8DOMWrapper.h