[V8] neuterBinding should remember the type of its argument
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2012 02:31:55 +0000 (02:31 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2012 02:31:55 +0000 (02:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=101413

Reviewed by Kentaro Hara.

This is a small part of the patch in
https://bugs.webkit.org/show_bug.cgi?id=101110 that we can land
separately to try to tease out what is causing the memory regression.

* bindings/v8/SerializedScriptValue.cpp:
(WebCore):
(WebCore::neuterBinding):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133708 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/SerializedScriptValue.cpp

index 516ae93..032b1fe 100644 (file)
@@ -1,3 +1,18 @@
+2012-11-06  Adam Barth  <abarth@webkit.org>
+
+        [V8] neuterBinding should remember the type of its argument
+        https://bugs.webkit.org/show_bug.cgi?id=101413
+
+        Reviewed by Kentaro Hara.
+
+        This is a small part of the patch in
+        https://bugs.webkit.org/show_bug.cgi?id=101110 that we can land
+        separately to try to tease out what is causing the memory regression.
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore):
+        (WebCore::neuterBinding):
+
 2012-11-06  Alexey Proskuryakov  <ap@apple.com>
 
         Clean up which storage cookie jar functions use
index 0f60421..5b6c398 100644 (file)
@@ -2206,13 +2206,14 @@ SerializedScriptValue::SerializedScriptValue()
 {
 }
 
-static void neuterBinding(void* domObject) 
+template<typename T>
+inline void neuterBinding(T* object) 
 {
     Vector<DOMDataStore*>& allStores = V8PerIsolateData::current()->allStores();
     for (size_t i = 0; i < allStores.size(); i++) {
-        v8::Handle<v8::Object> obj = allStores[i]->domObjectMap().get(domObject);
-        if (!obj.IsEmpty())
-            obj->SetIndexedPropertiesToExternalArrayData(0, v8::kExternalByteArray, 0);
+        v8::Handle<v8::Object> wrapper = allStores[i]->domObjectMap().get(object);
+        if (!wrapper.IsEmpty())
+            wrapper->SetIndexedPropertiesToExternalArrayData(0, v8::kExternalByteArray, 0);
     }
 }