[v8] persistent handle dispose before last use
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 14:15:53 +0000 (14:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 14:15:53 +0000 (14:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109927

Patch by Dan Carney <dcarney@google.com> on 2013-02-15
Reviewed by Jochen Eisinger.

No new tests. No change in functionality.

* bindings/v8/ScriptWrappable.h:
(WebCore::ScriptWrappable::weakCallback):

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/ScriptWrappable.h

index c100385..8b6cca0 100644 (file)
@@ -1,3 +1,15 @@
+2013-02-15  Dan Carney  <dcarney@google.com>
+
+        [v8] persistent handle dispose before last use
+        https://bugs.webkit.org/show_bug.cgi?id=109927
+
+        Reviewed by Jochen Eisinger.
+
+        No new tests. No change in functionality.
+
+        * bindings/v8/ScriptWrappable.h:
+        (WebCore::ScriptWrappable::weakCallback):
+
 2013-02-15  Keishi Hattori  <keishi@webkit.org>
 
         PagePopupController.formatMonth should support short month format
index c38b8c2..cb372ec 100644 (file)
@@ -85,13 +85,13 @@ private:
         ASSERT(value->IsObject());
         v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(value);
         ASSERT(key->wrapper() == wrapper);
-        key->disposeWrapper(value, isolate);
 
         // Note: |object| might not be equal to |key|, e.g., if ScriptWrappable isn't a left-most base class.
         void* object = toNative(wrapper);
         WrapperTypeInfo* info = toWrapperTypeInfo(wrapper);
         ASSERT(info->derefObjectFunction);
 
+        key->disposeWrapper(value, isolate);
         // FIXME: I noticed that 50%~ of minor GC cycle times can be consumed
         // inside key->deref(), which causes Node destructions. We should
         // make Node destructions incremental.