Changeset 110641 in webkit


Ignore:
Timestamp:
Mar 13, 2012 4:56:45 PM (12 years ago)
Author:
arv@chromium.org
Message:

[V8] Use v8::V8::AddImplicitReferences instead of SetHiddenValue
https://bugs.webkit.org/show_bug.cgi?id=80880

Reviewed by Adam Barth.

Source/WebCore:

We used to add a hidden property in the getter to the returned wrapper.
With this patch we instead handle the liveness of the wrapper in the GC phase by
calling v8::V8::AddHiddenReference.

To reduce the amount of custom code we need, the V8 code generator now supports
GenerateIsReachable (as well as CustomIsReachable) which, even though different
from the JSC attribute, is used in the same cases and takes the same values (even though
at the moment not all JSC values are supported by V8). Interfaces that have *IsReachable
also have a dependent life time (just like if V8DependentLifetime was present).

Second try. This time with an added include in TextTrackList.cpp.

No new tests. Covered by existing tests.

  • Target.pri:
  • UseV8.cmake:
  • WebCore.gypi:
  • bindings/scripts/CodeGeneratorJS.pm:

(GetGenerateIsReachable):
(GetCustomIsReachable):
(GenerateHeader):
(GenerateImplementation):

  • bindings/scripts/CodeGeneratorV8.pm:

(NeedsToVisitDOMWrapper):
(GetGenerateIsReachable):
(GetCustomIsReachable):
(GenerateVisitDOMWrapper):
(GenerateHeader):
(GenerateNamedConstructorCallback):
(GenerateImplementation):

  • bindings/scripts/IDLAttributes.txt:
  • bindings/scripts/test/V8/V8Float64Array.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8Float64Array.h:

(V8Float64Array):

  • bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestActiveDOMObject.h:

(V8TestActiveDOMObject):

  • bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestCustomNamedGetter.h:

(V8TestCustomNamedGetter):

  • bindings/scripts/test/V8/V8TestEventConstructor.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestEventConstructor.h:

(V8TestEventConstructor):

  • bindings/scripts/test/V8/V8TestEventTarget.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestEventTarget.h:

(V8TestEventTarget):

  • bindings/scripts/test/V8/V8TestInterface.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestInterface.h:

(V8TestInterface):

  • bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestMediaQueryListListener.h:

(V8TestMediaQueryListListener):

  • bindings/scripts/test/V8/V8TestNamedConstructor.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestNamedConstructor.h:

(V8TestNamedConstructor):

  • bindings/scripts/test/V8/V8TestObj.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestObj.h:

(V8TestObj):

  • bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:

(WebCore):

  • bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:

(V8TestSerializedScriptValueInterface):

  • bindings/v8/NPV8Object.cpp:

(WebCore::npObjectTypeInfo):

  • bindings/v8/V8GCController.cpp:

(WebCore::GrouperVisitor::visitDOMWrapper):

  • bindings/v8/WrapperTypeInfo.h:

(WebCore):
(WrapperTypeInfo):

  • bindings/v8/custom/V8CSSStyleSheetCustom.cpp: Removed.
  • bindings/v8/custom/V8DOMStringMapCustom.cpp:
  • bindings/v8/custom/V8DOMTokenListCustom.cpp: Removed.
  • bindings/v8/custom/V8HTMLImageElementConstructor.cpp:

(WebCore):

  • bindings/v8/custom/V8NamedNodeMapCustom.cpp:
  • bindings/v8/custom/V8StyleSheetCustom.cpp:

(WebCore::toV8):

  • css/CSSStyleSheet.idl:
  • css/StyleSheet.idl:
  • dom/DOMStringMap.idl:
  • dom/NamedNodeMap.idl:
  • html/DOMTokenList.idl:
  • html/track/TextTrackList.cpp:
  • html/track/TextTrackList.idl:

LayoutTests:

  • platform/chromium/test_expectations.txt:
Location:
trunk
Files:
2 deleted
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r110640 r110641  
     12012-03-13  Erik Arvidsson  <arv@chromium.org>
     2
     3        [V8] Use v8::V8::AddImplicitReferences instead of SetHiddenValue
     4        https://bugs.webkit.org/show_bug.cgi?id=80880
     5
     6        Reviewed by Adam Barth.
     7
     8        * platform/chromium/test_expectations.txt:
     9
    1102012-03-13  Jacky Jiang  <zhajiang@rim.com>
    211
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r110637 r110641  
    618618BUGWK66377 : fast/dom/StyleSheet/gc-parent-stylesheet.html = TEXT
    619619BUGWK66377 : fast/dom/StyleSheet/gc-rule-children-wrappers.html = TEXT
    620 BUGWK66377 : fast/dom/StyleSheet/gc-styleheet-wrapper.xhtml = TEXT
    621620
    622621// -----------------------------------------------------------------
     
    34223421BUGWK66953 : transitions/default-timing-function.html = PASS FAIL
    34233422
    3424 BUGWK73865 : media/track/tracklist-is-reachable.html = TEXT CRASH
    34253423BUGWK73865 : media/track/text-track-cue-is-reachable.html = TEXT CRASH
    34263424BUGWK73865 : media/track/text-track-is-reachable.html = TEXT CRASH
  • trunk/Source/WebCore/ChangeLog

    r110640 r110641  
     12012-03-13  Erik Arvidsson  <arv@chromium.org>
     2
     3        [V8] Use v8::V8::AddImplicitReferences instead of SetHiddenValue
     4        https://bugs.webkit.org/show_bug.cgi?id=80880
     5
     6        Reviewed by Adam Barth.
     7
     8        We used to add a hidden property in the getter to the returned wrapper.
     9        With this patch we instead handle the liveness of the wrapper in the GC phase by
     10        calling v8::V8::AddHiddenReference.
     11
     12        To reduce the amount of custom code we need, the V8 code generator now supports
     13        GenerateIsReachable (as well as CustomIsReachable) which, even though different
     14        from the JSC attribute, is used in the same cases and takes the same values (even though
     15        at the moment not all JSC values are supported by V8). Interfaces that have *IsReachable
     16        also have a dependent life time (just like if V8DependentLifetime was present).
     17
     18        Second try. This time with an added include in TextTrackList.cpp.
     19
     20        No new tests. Covered by existing tests.
     21
     22        * Target.pri:
     23        * UseV8.cmake:
     24        * WebCore.gypi:
     25        * bindings/scripts/CodeGeneratorJS.pm:
     26        (GetGenerateIsReachable):
     27        (GetCustomIsReachable):
     28        (GenerateHeader):
     29        (GenerateImplementation):
     30        * bindings/scripts/CodeGeneratorV8.pm:
     31        (NeedsToVisitDOMWrapper):
     32        (GetGenerateIsReachable):
     33        (GetCustomIsReachable):
     34        (GenerateVisitDOMWrapper):
     35        (GenerateHeader):
     36        (GenerateNamedConstructorCallback):
     37        (GenerateImplementation):
     38        * bindings/scripts/IDLAttributes.txt:
     39        * bindings/scripts/test/V8/V8Float64Array.cpp:
     40        (WebCore):
     41        * bindings/scripts/test/V8/V8Float64Array.h:
     42        (V8Float64Array):
     43        * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
     44        (WebCore):
     45        * bindings/scripts/test/V8/V8TestActiveDOMObject.h:
     46        (V8TestActiveDOMObject):
     47        * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
     48        (WebCore):
     49        * bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
     50        (V8TestCustomNamedGetter):
     51        * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
     52        (WebCore):
     53        * bindings/scripts/test/V8/V8TestEventConstructor.h:
     54        (V8TestEventConstructor):
     55        * bindings/scripts/test/V8/V8TestEventTarget.cpp:
     56        (WebCore):
     57        * bindings/scripts/test/V8/V8TestEventTarget.h:
     58        (V8TestEventTarget):
     59        * bindings/scripts/test/V8/V8TestInterface.cpp:
     60        (WebCore):
     61        * bindings/scripts/test/V8/V8TestInterface.h:
     62        (V8TestInterface):
     63        * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
     64        (WebCore):
     65        * bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
     66        (V8TestMediaQueryListListener):
     67        * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
     68        (WebCore):
     69        * bindings/scripts/test/V8/V8TestNamedConstructor.h:
     70        (V8TestNamedConstructor):
     71        * bindings/scripts/test/V8/V8TestObj.cpp:
     72        (WebCore):
     73        * bindings/scripts/test/V8/V8TestObj.h:
     74        (V8TestObj):
     75        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
     76        (WebCore):
     77        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
     78        (V8TestSerializedScriptValueInterface):
     79        * bindings/v8/NPV8Object.cpp:
     80        (WebCore::npObjectTypeInfo):
     81        * bindings/v8/V8GCController.cpp:
     82        (WebCore::GrouperVisitor::visitDOMWrapper):
     83        * bindings/v8/WrapperTypeInfo.h:
     84        (WebCore):
     85        (WrapperTypeInfo):
     86        * bindings/v8/custom/V8CSSStyleSheetCustom.cpp: Removed.
     87        * bindings/v8/custom/V8DOMStringMapCustom.cpp:
     88        * bindings/v8/custom/V8DOMTokenListCustom.cpp: Removed.
     89        * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
     90        (WebCore):
     91        * bindings/v8/custom/V8NamedNodeMapCustom.cpp:
     92        * bindings/v8/custom/V8StyleSheetCustom.cpp:
     93        (WebCore::toV8):
     94        * css/CSSStyleSheet.idl:
     95        * css/StyleSheet.idl:
     96        * dom/DOMStringMap.idl:
     97        * dom/NamedNodeMap.idl:
     98        * html/DOMTokenList.idl:
     99        * html/track/TextTrackList.cpp:
     100        * html/track/TextTrackList.idl:
     101
    11022012-03-13  Jacky Jiang  <zhajiang@rim.com>
    2103
  • trunk/Source/WebCore/Target.pri

    r110639 r110641  
    161161        bindings/v8/custom/V8CSSRuleCustom.cpp \
    162162        bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp \
    163         bindings/v8/custom/V8CSSStyleSheetCustom.cpp \
    164163        bindings/v8/custom/V8CSSValueCustom.cpp \
    165164        bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp \
     
    171170        bindings/v8/custom/V8InjectedScriptManager.cpp \
    172171        bindings/v8/custom/V8InspectorFrontendHostCustom.cpp \
    173         bindings/v8/custom/V8DOMStringMapCustom.cpp \
    174         bindings/v8/custom/V8DOMTokenListCustom.cpp
     172        bindings/v8/custom/V8DOMStringMapCustom.cpp
    175173
    176174    SOURCES += \
  • trunk/Source/WebCore/UseV8.cmake

    r110547 r110641  
    7474    bindings/v8/custom/V8CSSRuleCustom.cpp
    7575    bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp
    76     bindings/v8/custom/V8CSSStyleSheetCustom.cpp
    7776    bindings/v8/custom/V8CSSValueCustom.cpp
    7877    bindings/v8/custom/V8CanvasPixelArrayCustom.cpp
     
    8685    bindings/v8/custom/V8DOMFormDataCustom.cpp
    8786    bindings/v8/custom/V8DOMStringMapCustom.cpp
    88     bindings/v8/custom/V8DOMTokenListCustom.cpp
    8987    bindings/v8/custom/V8DOMWindowCustom.cpp
    9088    bindings/v8/custom/V8DataViewCustom.cpp
  • trunk/Source/WebCore/WebCore.gypi

    r110639 r110641  
    20112011            'bindings/v8/custom/V8CSSRuleCustom.cpp',
    20122012            'bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp',
    2013             'bindings/v8/custom/V8CSSStyleSheetCustom.cpp',
    20142013            'bindings/v8/custom/V8CSSValueCustom.cpp',
    20152014            'bindings/v8/custom/V8CanvasPixelArrayCustom.cpp',
     
    20252024            'bindings/v8/custom/V8DOMFormDataCustom.cpp',
    20262025            'bindings/v8/custom/V8DOMStringMapCustom.cpp',
    2027             'bindings/v8/custom/V8DOMTokenListCustom.cpp',
    20282026            'bindings/v8/custom/V8DOMWindowCustom.cpp',
    20292027            'bindings/v8/custom/V8DataViewCustom.cpp',
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r110547 r110641  
    382382}
    383383
     384sub GetGenerateIsReachable
     385{
     386    my $dataNode = shift;
     387    return $dataNode->extendedAttributes->{"GenerateIsReachable"} || $dataNode->extendedAttributes->{"JSGenerateIsReachable"};
     388}
     389
     390sub GetCustomIsReachable
     391{
     392    my $dataNode = shift;
     393    return $dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"JSCustomIsReachable"};
     394}
     395
    384396sub GenerateConditionalString
    385397{
     
    981993
    982994    if (!$hasParent ||
    983         $dataNode->extendedAttributes->{"JSGenerateIsReachable"} ||
    984         $dataNode->extendedAttributes->{"JSCustomIsReachable"} ||
     995        GetGenerateIsReachable($dataNode) ||
     996        GetCustomIsReachable($dataNode) ||
    985997        $dataNode->extendedAttributes->{"JSCustomFinalize"} ||
    986998        $dataNode->extendedAttributes->{"ActiveDOMObject"}) {
     
    22692281    }
    22702282
    2271     if ((!$hasParent && !$dataNode->extendedAttributes->{"JSCustomIsReachable"})|| $dataNode->extendedAttributes->{"JSGenerateIsReachable"} || $dataNode->extendedAttributes->{"ActiveDOMObject"}) {
     2283    if ((!$hasParent && !GetCustomIsReachable($dataNode))|| GetGenerateIsReachable($dataNode) || $dataNode->extendedAttributes->{"ActiveDOMObject"}) {
    22722284        push(@implContent, "static inline bool isObservable(JS${implClassName}* js${implClassName})\n");
    22732285        push(@implContent, "{\n");
     
    22972309        push(@implContent, "    if (!isObservable(js${implClassName}))\n");
    22982310        push(@implContent, "        return false;\n");
    2299         if ($dataNode->extendedAttributes->{"JSGenerateIsReachable"}) {
     2311        if (GetGenerateIsReachable($dataNode)) {
    23002312            my $rootString;
    2301             if ($dataNode->extendedAttributes->{"JSGenerateIsReachable"} eq "Impl") {
     2313            if (GetGenerateIsReachable($dataNode) eq "Impl") {
    23022314                $rootString  = "    ${implType}* root = js${implClassName}->impl();\n";
    2303             } elsif ($dataNode->extendedAttributes->{"JSGenerateIsReachable"} eq "ImplContext") {
     2315            } elsif (GetGenerateIsReachable($dataNode) eq "ImplContext") {
    23042316                $rootString  = "    WebGLRenderingContext* root = js${implClassName}->impl()->context();\n";
    2305             } elsif ($dataNode->extendedAttributes->{"JSGenerateIsReachable"} eq "ImplFrame") {
     2317            } elsif (GetGenerateIsReachable($dataNode) eq "ImplFrame") {
    23062318                $rootString  = "    Frame* root = js${implClassName}->impl()->frame();\n";
    23072319                $rootString .= "    if (!root)\n";
    23082320                $rootString .= "        return false;\n";
    2309             } elsif ($dataNode->extendedAttributes->{"JSGenerateIsReachable"} eq "ImplDocument") {
     2321            } elsif (GetGenerateIsReachable($dataNode) eq "ImplDocument") {
    23102322                $rootString  = "    Document* root = js${implClassName}->impl()->document();\n";
    23112323                $rootString .= "    if (!root)\n";
    23122324                $rootString .= "        return false;\n";
    2313             } elsif ($dataNode->extendedAttributes->{"JSGenerateIsReachable"} eq "ImplElementRoot") {
     2325            } elsif (GetGenerateIsReachable($dataNode) eq "ImplElementRoot") {
    23142326                $rootString  = "    Element* element = js${implClassName}->impl()->element();\n";
    23152327                $rootString .= "    if (!element)\n";
     
    23352347    if (!$dataNode->extendedAttributes->{"JSCustomFinalize"} &&
    23362348        (!$hasParent ||
    2337          $dataNode->extendedAttributes->{"JSGenerateIsReachable"} ||
    2338          $dataNode->extendedAttributes->{"JSCustomIsReachable"} ||
     2349         GetGenerateIsReachable($dataNode) ||
     2350         GetCustomIsReachable($dataNode) ||
    23392351         $dataNode->extendedAttributes->{"ActiveDOMObject"})) {
    23402352        push(@implContent, "void JS${implClassName}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n");
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r110547 r110641  
    193193}
    194194
     195sub NeedsToVisitDOMWrapper
     196{
     197    my $dataNode = shift;
     198    return GetGenerateIsReachable($dataNode) || GetCustomIsReachable($dataNode);
     199}
     200
     201sub GetGenerateIsReachable
     202{
     203    my $dataNode = shift;
     204    return $dataNode->extendedAttributes->{"GenerateIsReachable"} || $dataNode->extendedAttributes->{"V8GenerateIsReachable"} || ""
     205}
     206
     207sub GetCustomIsReachable
     208{
     209    my $dataNode = shift;
     210    return $dataNode->extendedAttributes->{"CustomIsReachable"} || $dataNode->extendedAttributes->{"V8CustomIsReachable"};
     211}
     212
     213sub GenerateVisitDOMWrapper
     214{
     215    my ($dataNode, $implClassName) = @_;
     216
     217    if (GetCustomIsReachable($dataNode)) {
     218        return;
     219    }
     220
     221    push(@implContent, <<END);
     222void V8${implClassName}::visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper)
     223{
     224    ${implClassName}* impl = static_cast<${implClassName}*>(object);
     225END
     226    if (GetGenerateIsReachable($dataNode) eq  "ImplElementRoot" ||
     227        GetGenerateIsReachable($dataNode) eq  "ImplOwnerRoot" ||
     228        GetGenerateIsReachable($dataNode) eq  "ImplOwnerNodeRoot") {
     229
     230        my $methodName;
     231        $methodName = "element" if (GetGenerateIsReachable($dataNode) eq "ImplElementRoot");
     232        $methodName = "owner" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerRoot");
     233        $methodName = "ownerNode" if (GetGenerateIsReachable($dataNode) eq "ImplOwnerNodeRoot");
     234
     235        push(@implContent, <<END);
     236    if (Node* owner = impl->${methodName}()) {
     237        v8::Persistent<v8::Object> ownerWrapper = getDOMNodeMap().get(owner);
     238        if (!ownerWrapper.IsEmpty()) {
     239            v8::Persistent<v8::Value> value = wrapper;
     240            v8::V8::AddImplicitReferences(ownerWrapper, &value, 1);
     241        }
     242    }
     243END
     244    }
     245
     246    push(@implContent, <<END);
     247}
     248
     249END
     250}
     251
    195252sub GetSVGPropertyTypes
    196253{
     
    247304    $codeGenerator->LinkOverloadedFunctions($dataNode);
    248305
    249     my $hasDependentLifetime = $dataNode->extendedAttributes->{"V8DependentLifetime"} || $dataNode->extendedAttributes->{"ActiveDOMObject"} || $className =~ /SVG/;
     306    my $hasDependentLifetime = $dataNode->extendedAttributes->{"V8DependentLifetime"} || $dataNode->extendedAttributes->{"ActiveDOMObject"}
     307         || GetGenerateIsReachable($dataNode) || $className =~ /SVG/;
    250308    if (!$hasDependentLifetime) {
    251309        foreach (@{$dataNode->parents}) {
     
    341399    inline static v8::Handle<v8::Object> wrap(${nativeType}*${forceNewObjectParameter});
    342400    static void derefObject(void*);
     401    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    343402    static WrapperTypeInfo info;
    344403END
     
    17971856    if ($dataNode->extendedAttributes->{"ActiveDOMObject"}) {
    17981857        push(@implContent, <<END);
    1799 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, V8${implClassName}::derefObject, V8${implClassName}::toActiveDOMObject, 0 };
     1858WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, V8${implClassName}::derefObject, V8${implClassName}::toActiveDOMObject, 0, 0 };
    18001859
    18011860END
    18021861    } else {
    18031862        push(@implContent, <<END);
    1804 WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, 0, 0, 0 };
     1863WrapperTypeInfo V8${implClassName}Constructor::info = { V8${implClassName}Constructor::GetTemplate, 0, 0, 0, 0 };
    18051864
    18061865END
     
    22472306
    22482307    my $toActive = $dataNode->extendedAttributes->{"ActiveDOMObject"} ? "${className}::toActiveDOMObject" : "0";
     2308    my $domVisitor = NeedsToVisitDOMWrapper($dataNode) ? "${className}::visitDOMWrapper" : "0";
    22492309
    22502310    # Find the super descriptor.
     
    22632323    push(@implContentDecls, "namespace WebCore {\n\n");
    22642324    my $parentClassInfo = $parentClass ? "&${parentClass}::info" : "0";
    2265     push(@implContentDecls, "WrapperTypeInfo ${className}::info = { ${className}::GetTemplate, ${className}::derefObject, ${toActive}, ${parentClassInfo} };\n\n");   
     2325    push(@implContentDecls, "WrapperTypeInfo ${className}::info = { ${className}::GetTemplate, ${className}::derefObject, ${toActive}, ${domVisitor}, ${parentClassInfo} };\n\n");   
    22662326    push(@implContentDecls, "namespace ${interfaceName}Internal {\n\n");
    22672327    push(@implContentDecls, "template <typename T> void V8_USE(T) { }\n\n");
     
    23142374    if ($hasConstructors) {
    23152375        GenerateConstructorGetter($dataNode, $implClassName);
     2376    }
     2377
     2378    if (NeedsToVisitDOMWrapper($dataNode)) {
     2379        GenerateVisitDOMWrapper($dataNode, $implClassName);
    23162380    }
    23172381
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt

    r110537 r110641  
    3939CustomGetter
    4040CustomIndexedSetter
     41CustomIsReachable
    4142CustomNamedGetter
    4243CustomNamedSetter
     
    5253EventTarget
    5354ExtendsDOMGlobalObject
     55GenerateIsReachable=|Impl|ImplContext|ImplDocument|ImplElementRoot|ImplFrame
    5456Immutable
    5557ImplementedAs=*
    5658IndexedGetter
     59InitializedByEventConstructor
    5760InterfaceName=*
    58 InitializedByEventConstructor
    5961IsIndex
    6062IsWorkerContext
     
    105107V8CustomConstructor
    106108V8CustomGetter
     109V8CustomIsReachable
    107110V8CustomSetter
    108111V8CustomToJSObject
     
    110113V8DoNotCheckSignature
    111114V8EnabledAtRuntime=*
     115V8GenerateIsReachable=|ImplElementRoot|ImplOwnerRoot|ImplOwnerNodeRoot
    112116V8ReadOnly
    113117V8Unforgeable
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp

    r110537 r110641  
    4343namespace WebCore {
    4444
    45 WrapperTypeInfo V8Float64Array::info = { V8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, &V8ArrayBufferView::info };
     45WrapperTypeInfo V8Float64Array::info = { V8Float64Array::GetTemplate, V8Float64Array::derefObject, 0, 0, &V8ArrayBufferView::info };
    4646
    4747namespace Float64ArrayInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h

    r110537 r110641  
    4444    inline static v8::Handle<v8::Object> wrap(Float64Array*);
    4545    static void derefObject(void*);
     46    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4647    static WrapperTypeInfo info;
    4748    static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&);
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp

    r110537 r110641  
    3535namespace WebCore {
    3636
    37 WrapperTypeInfo V8TestActiveDOMObject::info = { V8TestActiveDOMObject::GetTemplate, V8TestActiveDOMObject::derefObject, 0, 0 };
     37WrapperTypeInfo V8TestActiveDOMObject::info = { V8TestActiveDOMObject::GetTemplate, V8TestActiveDOMObject::derefObject, 0, 0, 0 };
    3838
    3939namespace TestActiveDOMObjectInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h

    r110537 r110641  
    4343    inline static v8::Handle<v8::Object> wrap(TestActiveDOMObject*);
    4444    static void derefObject(void*);
     45    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4546    static WrapperTypeInfo info;
    4647    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp

    r110537 r110641  
    3434namespace WebCore {
    3535
    36 WrapperTypeInfo V8TestCustomNamedGetter::info = { V8TestCustomNamedGetter::GetTemplate, V8TestCustomNamedGetter::derefObject, 0, 0 };
     36WrapperTypeInfo V8TestCustomNamedGetter::info = { V8TestCustomNamedGetter::GetTemplate, V8TestCustomNamedGetter::derefObject, 0, 0, 0 };
    3737
    3838namespace TestCustomNamedGetterInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h

    r110537 r110641  
    4343    inline static v8::Handle<v8::Object> wrap(TestCustomNamedGetter*);
    4444    static void derefObject(void*);
     45    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4546    static WrapperTypeInfo info;
    4647    static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&);
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp

    r110547 r110641  
    3434namespace WebCore {
    3535
    36 WrapperTypeInfo V8TestEventConstructor::info = { V8TestEventConstructor::GetTemplate, V8TestEventConstructor::derefObject, 0, 0 };
     36WrapperTypeInfo V8TestEventConstructor::info = { V8TestEventConstructor::GetTemplate, V8TestEventConstructor::derefObject, 0, 0, 0 };
    3737
    3838namespace TestEventConstructorInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h

    r110547 r110641  
    4444    inline static v8::Handle<v8::Object> wrap(TestEventConstructor*);
    4545    static void derefObject(void*);
     46    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4647    static WrapperTypeInfo info;
    4748    static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&);
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp

    r110537 r110641  
    3737namespace WebCore {
    3838
    39 WrapperTypeInfo V8TestEventTarget::info = { V8TestEventTarget::GetTemplate, V8TestEventTarget::derefObject, 0, 0 };
     39WrapperTypeInfo V8TestEventTarget::info = { V8TestEventTarget::GetTemplate, V8TestEventTarget::derefObject, 0, 0, 0 };
    4040
    4141namespace TestEventTargetInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h

    r110537 r110641  
    4343    inline static v8::Handle<v8::Object> wrap(TestEventTarget*);
    4444    static void derefObject(void*);
     45    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4546    static WrapperTypeInfo info;
    4647    static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t, const v8::AccessorInfo&);
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp

    r110537 r110641  
    4242namespace WebCore {
    4343
    44 WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0 };
     44WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, 0 };
    4545
    4646namespace TestInterfaceInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h

    r110537 r110641  
    4545    inline static v8::Handle<v8::Object> wrap(TestInterface*);
    4646    static void derefObject(void*);
     47    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4748    static WrapperTypeInfo info;
    4849    static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp

    r110537 r110641  
    3535namespace WebCore {
    3636
    37 WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0, 0 };
     37WrapperTypeInfo V8TestMediaQueryListListener::info = { V8TestMediaQueryListListener::GetTemplate, V8TestMediaQueryListListener::derefObject, 0, 0, 0 };
    3838
    3939namespace TestMediaQueryListListenerInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h

    r110537 r110641  
    4343    inline static v8::Handle<v8::Object> wrap(TestMediaQueryListListener*);
    4444    static void derefObject(void*);
     45    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4546    static WrapperTypeInfo info;
    4647    static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp

    r110537 r110641  
    3434namespace WebCore {
    3535
    36 WrapperTypeInfo V8TestNamedConstructor::info = { V8TestNamedConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0 };
     36WrapperTypeInfo V8TestNamedConstructor::info = { V8TestNamedConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0 };
    3737
    3838namespace TestNamedConstructorInternal {
     
    4242} // namespace TestNamedConstructorInternal
    4343
    44 WrapperTypeInfo V8TestNamedConstructorConstructor::info = { V8TestNamedConstructorConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0 };
     44WrapperTypeInfo V8TestNamedConstructorConstructor::info = { V8TestNamedConstructorConstructor::GetTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0 };
    4545
    4646static v8::Handle<v8::Value> V8TestNamedConstructorConstructorCallback(const v8::Arguments& args)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h

    r110537 r110641  
    4949    inline static v8::Handle<v8::Object> wrap(TestNamedConstructor*);
    5050    static void derefObject(void*);
     51    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    5152    static WrapperTypeInfo info;
    5253    static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r110547 r110641  
    7272namespace WebCore {
    7373
    74 WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObject, 0, 0 };
     74WrapperTypeInfo V8TestObj::info = { V8TestObj::GetTemplate, V8TestObj::derefObject, 0, 0, 0 };
    7575
    7676namespace TestObjInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h

    r110537 r110641  
    4343    inline static v8::Handle<v8::Object> wrap(TestObj*);
    4444    static void derefObject(void*);
     45    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4546    static WrapperTypeInfo info;
    4647    static v8::Handle<v8::Value> customMethodCallback(const v8::Arguments&);
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp

    r110537 r110641  
    3737namespace WebCore {
    3838
    39 WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0 };
     39WrapperTypeInfo V8TestSerializedScriptValueInterface::info = { V8TestSerializedScriptValueInterface::GetTemplate, V8TestSerializedScriptValueInterface::derefObject, 0, 0, 0 };
    4040
    4141namespace TestSerializedScriptValueInterfaceInternal {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h

    r110537 r110641  
    4545    inline static v8::Handle<v8::Object> wrap(TestSerializedScriptValueInterface*);
    4646    static void derefObject(void*);
     47    static void visitDOMWrapper(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4748    static WrapperTypeInfo info;
    4849    static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&);
  • trunk/Source/WebCore/bindings/v8/NPV8Object.cpp

    r110537 r110641  
    5454WrapperTypeInfo* npObjectTypeInfo()
    5555{
    56     static WrapperTypeInfo typeInfo = { 0, 0, 0, 0 };
     56    static WrapperTypeInfo typeInfo = { 0, 0, 0, 0, 0 };
    5757    return &typeInfo;
    5858}
  • trunk/Source/WebCore/bindings/v8/V8GCController.cpp

    r110537 r110641  
    337337    void visitDOMWrapper(DOMDataStore* store, void* object, v8::Persistent<v8::Object> wrapper)
    338338    {
     339        WrapperTypeInfo* info = V8DOMWrapper::domWrapperType(wrapper);
     340        if (info->domWrapperVisitorFunction)
     341            info->domWrapperVisitorFunction(store, object, wrapper);
    339342    }
    340343
  • trunk/Source/WebCore/bindings/v8/WrapperTypeInfo.h

    r110537 r110641  
    3737   
    3838    class ActiveDOMObject;
     39    class DOMDataStore;
    3940   
    4041    static const int v8DOMWrapperTypeIndex = 0;
     
    4748    typedef void (*DerefObjectFunction)(void*);
    4849    typedef ActiveDOMObject* (*ToActiveDOMObjectFunction)(v8::Handle<v8::Object>);
     50    typedef void (*DOMWrapperVisitorFunction)(DOMDataStore*, void*, v8::Persistent<v8::Object>);
    4951   
    5052    // This struct provides a way to store a bunch of information that is helpful when unwrapping
     
    9294        const DerefObjectFunction derefObjectFunction;
    9395        const ToActiveDOMObjectFunction toActiveDOMObjectFunction;
     96        const DOMWrapperVisitorFunction domWrapperVisitorFunction;
    9497        const WrapperTypeInfo* parentClass;
    9598    };
  • trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp

    r110537 r110641  
    8585}
    8686
    87 v8::Handle<v8::Value> toV8(DOMStringMap* impl)
    88 {
    89     if (!impl)
    90         return v8::Null();
    91     v8::Handle<v8::Object> wrapper = V8DOMStringMap::wrap(impl);
    92     // Add a hidden reference from the element to the DOMStringMap.
    93     Element* element = impl->element();
    94     if (!wrapper.IsEmpty() && element) {
    95         v8::Handle<v8::Value> elementValue = toV8(element);
    96         if (!elementValue.IsEmpty() && elementValue->IsObject())
    97             elementValue.As<v8::Object>()->SetHiddenValue(V8HiddenPropertyName::domStringMap(), wrapper);
    98     }
    99     return wrapper;
    100 }
    101 
    10287} // namespace WebCore
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp

    r110537 r110641  
    4545namespace WebCore {
    4646
    47 WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, 0, 0 };
     47WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, 0, 0, 0 };
    4848
    4949static v8::Handle<v8::Value> v8HTMLImageElementConstructorCallback(const v8::Arguments& args)
  • trunk/Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp

    r110537 r110641  
    7272}
    7373
    74 v8::Handle<v8::Value> toV8(NamedNodeMap* impl)
    75 {
    76     if (!impl)
    77         return v8::Null();
    78     v8::Handle<v8::Object> wrapper = V8NamedNodeMap::wrap(impl);
    79     // Add a hidden reference from named node map to its owner node.
    80     Element* element = impl->element();
    81     if (!wrapper.IsEmpty() && element)
    82         wrapper->SetHiddenValue(V8HiddenPropertyName::ownerNode(), toV8(element));
    83     return wrapper;
    84 }
    85 
    8674} // namespace WebCore
  • trunk/Source/WebCore/bindings/v8/custom/V8StyleSheetCustom.cpp

    r110537 r110641  
    4444    if (impl->isCSSStyleSheet())
    4545        return toV8(static_cast<CSSStyleSheet*>(impl));
    46     v8::Handle<v8::Object> wrapper = V8StyleSheet::wrap(impl);
    47     // Add a hidden reference from stylesheet object to its owner node.
    48     Node* ownerNode = impl->ownerNode();
    49     if (ownerNode && !wrapper.IsEmpty())
    50         V8DOMWrapper::setNamedHiddenReference(wrapper, "ownerNode", toV8(ownerNode));
    51     return wrapper;
     46    return V8StyleSheet::wrap(impl);
    5247}
    5348
  • trunk/Source/WebCore/css/CSSStyleSheet.idl

    r110537 r110641  
    2323    // Introduced in DOM Level 2:
    2424    interface [
    25         V8CustomToJSObject
     25        V8GenerateIsReachable=ImplOwnerNodeRoot
    2626    ] CSSStyleSheet : StyleSheet {
    2727        readonly attribute CSSRule          ownerRule;
  • trunk/Source/WebCore/css/StyleSheet.idl

    r110537 r110641  
    2727        CustomToJSObject,
    2828        ObjCPolymorphic,
    29         V8DependentLifetime
     29        V8GenerateIsReachable=ImplOwnerNodeRoot
    3030    ] StyleSheet {
    3131        readonly attribute [TreatReturnedNullStringAs=Null] DOMString        type;
  • trunk/Source/WebCore/dom/DOMStringMap.idl

    r110537 r110641  
    2727
    2828    interface [
    29         JSGenerateIsReachable=ImplElementRoot,
     29        GenerateIsReachable=ImplElementRoot,
    3030        NamedGetter,
    3131        CustomDeleteProperty,
    3232        CustomEnumerateProperty,
    33         CustomNamedSetter,
    34         V8CustomToJSObject
     33        CustomNamedSetter
    3534    ] DOMStringMap {
    3635    };
  • trunk/Source/WebCore/dom/NamedNodeMap.idl

    r110537 r110641  
    2222
    2323    interface [
    24         JSGenerateIsReachable=ImplElementRoot,
     24        GenerateIsReachable=ImplElementRoot,
     25        IndexedGetter,
    2526        JSCustomMarkFunction,
    26         IndexedGetter,
    27         NamedGetter,
    28         V8CustomToJSObject
     27        NamedGetter
    2928    ] NamedNodeMap {
    3029
  • trunk/Source/WebCore/html/DOMTokenList.idl

    r110537 r110641  
    2626
    2727    interface [
    28         JSGenerateIsReachable=ImplElementRoot,
    29         IndexedGetter,
    30         V8CustomToJSObject
     28        GenerateIsReachable=ImplElementRoot,
     29        IndexedGetter
    3130    ] DOMTokenList {
    3231        readonly attribute unsigned long length;
  • trunk/Source/WebCore/html/track/TextTrackList.cpp

    r108241 r110641  
    3131
    3232#include "EventNames.h"
     33#include "HTMLMediaElement.h"
    3334#include "LoadableTextTrack.h"
    3435#include "ScriptExecutionContext.h"
  • trunk/Source/WebCore/html/track/TextTrackList.idl

    r110537 r110641  
    3232        EventTarget,
    3333        JSCustomMarkFunction,
    34         JSCustomIsReachable
     34        JSCustomIsReachable,
     35        V8GenerateIsReachable=ImplOwnerRoot
    3536    ] TextTrackList {
    3637        readonly attribute unsigned long length;
Note: See TracChangeset for help on using the changeset viewer.