Changeset 114034 in webkit


Ignore:
Timestamp:
Apr 12, 2012 2:11:37 PM (12 years ago)
Author:
adamk@chromium.org
Message:

Always set V8 wrappers via V8DOMWrapper::setJSWrapperFor* instead of WeakReferenceMap::set()
https://bugs.webkit.org/show_bug.cgi?id=82256

Reviewed by Kentaro Hara.

This is an attempt to reland r112318, which was rolled out due to suspicion of OOM issues.

I've landed the refactoring bits of r112318 as separate changes,
so that this patch contains only the change in which map setter is called.

Binding tests have been updated with new output.

  • bindings/scripts/CodeGeneratorV8.pm:

(GenerateToV8Converters): Call appropriate V8DOMWrapper::setJSWrapperFor*
to set up wrapper mapping and remove call to leakRef() which is handled
in V8DOMWrapper.

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

(WebCore::V8Float64Array::wrapSlow):

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

(WebCore::V8TestActiveDOMObject::wrapSlow):

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

(WebCore::V8TestCustomNamedGetter::wrapSlow):

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

(WebCore::V8TestEventConstructor::wrapSlow):

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

(WebCore::V8TestEventTarget::wrapSlow):

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

(WebCore::V8TestInterface::wrapSlow):

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

(WebCore::V8TestMediaQueryListListener::wrapSlow):

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

(WebCore::V8TestNamedConstructor::wrapSlow):

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

(WebCore::V8TestNode::wrapSlow):

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

(WebCore::V8TestObj::wrapSlow):

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

(WebCore::V8TestSerializedScriptValueInterface::wrapSlow):

Location:
trunk/Source/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r114032 r114034  
     12012-04-12  Adam Klein  <adamk@chromium.org>
     2
     3        Always set V8 wrappers via V8DOMWrapper::setJSWrapperFor* instead of WeakReferenceMap::set()
     4        https://bugs.webkit.org/show_bug.cgi?id=82256
     5
     6        Reviewed by Kentaro Hara.
     7
     8        This is an attempt to reland r112318, which was rolled out due to suspicion of OOM issues.
     9
     10        I've landed the refactoring bits of r112318 as separate changes,
     11        so that this patch contains only the change in which map setter is called.
     12
     13        Binding tests have been updated with new output.
     14
     15        * bindings/scripts/CodeGeneratorV8.pm:
     16        (GenerateToV8Converters): Call appropriate V8DOMWrapper::setJSWrapperFor*
     17        to set up wrapper mapping and remove call to leakRef() which is handled
     18        in V8DOMWrapper.
     19        * bindings/scripts/test/V8/V8Float64Array.cpp:
     20        (WebCore::V8Float64Array::wrapSlow):
     21        * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
     22        (WebCore::V8TestActiveDOMObject::wrapSlow):
     23        * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
     24        (WebCore::V8TestCustomNamedGetter::wrapSlow):
     25        * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
     26        (WebCore::V8TestEventConstructor::wrapSlow):
     27        * bindings/scripts/test/V8/V8TestEventTarget.cpp:
     28        (WebCore::V8TestEventTarget::wrapSlow):
     29        * bindings/scripts/test/V8/V8TestInterface.cpp:
     30        (WebCore::V8TestInterface::wrapSlow):
     31        * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
     32        (WebCore::V8TestMediaQueryListListener::wrapSlow):
     33        * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
     34        (WebCore::V8TestNamedConstructor::wrapSlow):
     35        * bindings/scripts/test/V8/V8TestNode.cpp:
     36        (WebCore::V8TestNode::wrapSlow):
     37        * bindings/scripts/test/V8/V8TestObj.cpp:
     38        (WebCore::V8TestObj::wrapSlow):
     39        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
     40        (WebCore::V8TestSerializedScriptValueInterface::wrapSlow):
     41
    1422012-04-12  David Hyatt  <hyatt@apple.com>
    243
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r113959 r114034  
    30713071    my $nativeType = shift;
    30723072
    3073     my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName);
     3073    my $domMapName = GetDomMapName($dataNode, $interfaceName);
    30743074    my $forceNewObjectInput = IsDOMNodeType($interfaceName) ? ", bool forceNewObject" : "";
    30753075    my $forceNewObjectCall = IsDOMNodeType($interfaceName) ? ", forceNewObject" : "";
     
    31603160    }
    31613161    push(@implContent, <<END);
    3162     ${domMapFunction}.set(impl.leakRef(), wrapperHandle);
     3162    V8DOMWrapper::setJSWrapperFor${domMapName}(impl, wrapperHandle);
    31633163    return wrapper;
    31643164}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp

    r113959 r114034  
    133133    if (!hasDependentLifetime)
    134134        wrapperHandle.MarkIndependent();
    135     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     135    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
    136136    return wrapper;
    137137}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp

    r113959 r114034  
    189189    if (!hasDependentLifetime)
    190190        wrapperHandle.MarkIndependent();
    191     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     191    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
    192192    return wrapper;
    193193}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp

    r113959 r114034  
    123123    if (!hasDependentLifetime)
    124124        wrapperHandle.MarkIndependent();
    125     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     125    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
    126126    return wrapper;
    127127}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp

    r113959 r114034  
    158158    if (!hasDependentLifetime)
    159159        wrapperHandle.MarkIndependent();
    160     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     160    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
    161161    return wrapper;
    162162}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp

    r113959 r114034  
    186186    if (!hasDependentLifetime)
    187187        wrapperHandle.MarkIndependent();
    188     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     188    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
    189189    return wrapper;
    190190}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp

    r113959 r114034  
    318318    if (!hasDependentLifetime)
    319319        wrapperHandle.MarkIndependent();
    320     getActiveDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     320    V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapperHandle);
    321321    return wrapper;
    322322}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp

    r113959 r114034  
    123123    if (!hasDependentLifetime)
    124124        wrapperHandle.MarkIndependent();
    125     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     125    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
    126126    return wrapper;
    127127}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp

    r113959 r114034  
    167167    if (!hasDependentLifetime)
    168168        wrapperHandle.MarkIndependent();
    169     getActiveDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     169    V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapperHandle);
    170170    return wrapper;
    171171}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp

    r113881 r114034  
    135135        wrapperHandle.MarkIndependent();
    136136    wrapperHandle.SetWrapperClassId(v8DOMSubtreeClassId);
    137     getDOMNodeMap().set(impl.leakRef(), wrapperHandle);
     137    V8DOMWrapper::setJSWrapperForDOMNode(impl, wrapperHandle);
    138138    return wrapper;
    139139}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r113959 r114034  
    21722172    if (!hasDependentLifetime)
    21732173        wrapperHandle.MarkIndependent();
    2174     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     2174    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
    21752175    return wrapper;
    21762176}
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp

    r113959 r114034  
    289289    if (!hasDependentLifetime)
    290290        wrapperHandle.MarkIndependent();
    291     getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     291    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
    292292    return wrapper;
    293293}
Note: See TracChangeset for help on using the changeset viewer.