Title: [114034] trunk/Source/WebCore
Revision
114034
Author
[email protected]
Date
2012-04-12 14:11:37 -0700 (Thu, 12 Apr 2012)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114033 => 114034)


--- trunk/Source/WebCore/ChangeLog	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/ChangeLog	2012-04-12 21:11:37 UTC (rev 114034)
@@ -1,3 +1,44 @@
+2012-04-12  Adam Klein  <[email protected]>
+
+        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):
+
 2012-04-12  David Hyatt  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=83817

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-04-12 21:11:37 UTC (rev 114034)
@@ -3070,7 +3070,7 @@
     my $className = shift;
     my $nativeType = shift;
 
-    my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName);
+    my $domMapName = GetDomMapName($dataNode, $interfaceName);
     my $forceNewObjectInput = IsDOMNodeType($interfaceName) ? ", bool forceNewObject" : "";
     my $forceNewObjectCall = IsDOMNodeType($interfaceName) ? ", forceNewObject" : "";
     my $wrapSlowArgumentType = GetPassRefPtrType($nativeType);
@@ -3159,7 +3159,7 @@
 END
     }
     push(@implContent, <<END);
-    ${domMapFunction}.set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperFor${domMapName}(impl, wrapperHandle);
     return wrapper;
 }
 END

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -132,7 +132,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -188,7 +188,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -122,7 +122,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -157,7 +157,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -185,7 +185,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -317,7 +317,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getActiveDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -122,7 +122,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -166,7 +166,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getActiveDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -134,7 +134,7 @@
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
     wrapperHandle.SetWrapperClassId(v8DOMSubtreeClassId);
-    getDOMNodeMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMNode(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -2171,7 +2171,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp (114033 => 114034)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp	2012-04-12 21:09:48 UTC (rev 114033)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp	2012-04-12 21:11:37 UTC (rev 114034)
@@ -288,7 +288,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
+    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
     return wrapper;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to