Title: [89236] trunk/Source/WebCore
Revision
89236
Author
[email protected]
Date
2011-06-20 02:36:13 -0700 (Mon, 20 Jun 2011)

Log Message

2011-06-19  Mads Ager  <[email protected]>

        Reviewed by Adam Barth.

        [V8] Fix WebGL bindings for subarrays
        https://bugs.webkit.org/show_bug.cgi?id=62864

        Mark WebGL subarrays as independent of other DOM objects in the
        V8 bindings. This allows us to clean them up independently which
        greatly improves performance.

        * bindings/v8/V8Proxy.h:
        (WebCore::toV8Independent):
        * bindings/v8/custom/V8ArrayBufferViewCustom.h:
        (WebCore::constructWebGLArrayWithArrayBufferArgument):
        (WebCore::constructWebGLArray):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (89235 => 89236)


--- trunk/Source/WebCore/ChangeLog	2011-06-20 09:18:38 UTC (rev 89235)
+++ trunk/Source/WebCore/ChangeLog	2011-06-20 09:36:13 UTC (rev 89236)
@@ -1,3 +1,20 @@
+2011-06-19  Mads Ager  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        [V8] Fix WebGL bindings for subarrays
+        https://bugs.webkit.org/show_bug.cgi?id=62864
+
+        Mark WebGL subarrays as independent of other DOM objects in the
+        V8 bindings. This allows us to clean them up independently which
+        greatly improves performance.
+
+        * bindings/v8/V8Proxy.h:
+        (WebCore::toV8Independent):
+        * bindings/v8/custom/V8ArrayBufferViewCustom.h:
+        (WebCore::constructWebGLArrayWithArrayBufferArgument):
+        (WebCore::constructWebGLArray):
+
 2011-06-20  Yuta Kitamura  <[email protected]>
 
         Unreviewed build fix for Chromium Clang builders.

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.h (89235 => 89236)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.h	2011-06-20 09:18:38 UTC (rev 89235)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.h	2011-06-20 09:36:13 UTC (rev 89236)
@@ -412,10 +412,18 @@
         return v8::Undefined();
     }
 
-    template <class T> inline v8::Handle<v8::Object> toV8(PassRefPtr<T> object, v8::Local<v8::Object> holder)
+    enum IndependentMode {
+        MarkIndependent,
+        DoNotMarkIndependent
+    };
+
+    template <class T> inline v8::Handle<v8::Object> toV8(PassRefPtr<T> object, v8::Local<v8::Object> holder, IndependentMode independent = DoNotMarkIndependent)
     {
         object->ref();
-        V8DOMWrapper::setJSWrapperForDOMObject(object.get(), v8::Persistent<v8::Object>::New(holder));
+        v8::Persistent<v8::Object> handle = v8::Persistent<v8::Object>::New(holder);
+        if (independent == MarkIndependent)
+            handle.MarkIndependent();
+        V8DOMWrapper::setJSWrapperForDOMObject(object.get(), handle);
         return holder;
     }
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h (89235 => 89236)


--- trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h	2011-06-20 09:18:38 UTC (rev 89235)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h	2011-06-20 09:36:13 UTC (rev 89236)
@@ -72,7 +72,7 @@
     V8DOMWrapper::setDOMWrapper(args.Holder(), type, array.get());
     if (hasIndexer)
         args.Holder()->SetIndexedPropertiesToExternalArrayData(array.get()->baseAddress(), arrayType, array.get()->length());
-    return toV8(array.release(), args.Holder());
+    return toV8(array.release(), args.Holder(), MarkIndependent);
 }
 
 // Template function used by the ArrayBufferView*Constructor callbacks.
@@ -98,7 +98,7 @@
         // Do not call SetIndexedPropertiesToExternalArrayData on this
         // object. Not only is there no point from a performance
         // perspective, but doing so causes errors in the subset() case.
-        return toV8(array.release(), args.Holder());
+        return toV8(array.release(), args.Holder(), MarkIndependent);
     }
 
     // Supported constructors:
@@ -157,7 +157,7 @@
     // Transform the holder into a wrapper object for the array.
     V8DOMWrapper::setDOMWrapper(args.Holder(), type, array.get());
     args.Holder()->SetIndexedPropertiesToExternalArrayData(array.get()->baseAddress(), arrayType, array.get()->length());
-    return toV8(array.release(), args.Holder());
+    return toV8(array.release(), args.Holder(), MarkIndependent);
 }
 
 template <class CPlusPlusArrayType, class _javascript_WrapperArrayType>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to