Title: [124977] trunk/Source/WebCore
Revision
124977
Author
hara...@chromium.org
Date
2012-08-07 21:01:25 -0700 (Tue, 07 Aug 2012)

Log Message

[V8] StringCache::m_lastStringImpl and StringCache::m_lastV8String should be in sync
https://bugs.webkit.org/show_bug.cgi?id=93065

Reviewed by Eric Seidel.

StringCache::m_lastStringImpl caches a StringImpl that was accessed most
recently. StringCache::m_lastV8String caches Persistent<String> corresponding
to the StringImpl. Hence m_lastStringImpl and m_lastV8String should be in sync.

However, StringCache::remove() breaks the sync. StringCache::remove() clears
m_lastStringImpl but does not clear m_lastV8String. As far as I analyze the code,
this won't cause any problem, but we should fix it just in case.

No tests. No change in behavior.

* bindings/v8/V8Binding.cpp:
(WebCore::StringCache::remove):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124976 => 124977)


--- trunk/Source/WebCore/ChangeLog	2012-08-08 03:48:25 UTC (rev 124976)
+++ trunk/Source/WebCore/ChangeLog	2012-08-08 04:01:25 UTC (rev 124977)
@@ -1,3 +1,23 @@
+2012-08-07  Kentaro Hara  <hara...@chromium.org>
+
+        [V8] StringCache::m_lastStringImpl and StringCache::m_lastV8String should be in sync
+        https://bugs.webkit.org/show_bug.cgi?id=93065
+
+        Reviewed by Eric Seidel.
+
+        StringCache::m_lastStringImpl caches a StringImpl that was accessed most
+        recently. StringCache::m_lastV8String caches Persistent<String> corresponding
+        to the StringImpl. Hence m_lastStringImpl and m_lastV8String should be in sync.
+
+        However, StringCache::remove() breaks the sync. StringCache::remove() clears
+        m_lastStringImpl but does not clear m_lastV8String. As far as I analyze the code,
+        this won't cause any problem, but we should fix it just in case.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8Binding.cpp:
+        (WebCore::StringCache::remove):
+
 2012-08-07  Hayato Ito  <hay...@chromium.org>
 
         Don't re-use the same EventDispatcher instance to dispatch events.

Modified: trunk/Source/WebCore/bindings/v8/V8ValueCache.cpp (124976 => 124977)


--- trunk/Source/WebCore/bindings/v8/V8ValueCache.cpp	2012-08-08 03:48:25 UTC (rev 124976)
+++ trunk/Source/WebCore/bindings/v8/V8ValueCache.cpp	2012-08-08 04:01:25 UTC (rev 124977)
@@ -55,8 +55,10 @@
     m_stringCache.remove(stringImpl);
     // Make sure that already disposed m_lastV8String is not used in
     // StringCache::v8ExternalString().
-    if (m_lastStringImpl.get() == stringImpl)
+    if (m_lastStringImpl.get() == stringImpl) {
         m_lastStringImpl = 0;
+        m_lastV8String.Clear();
+    }
 }
 
 v8::Local<v8::String> StringCache::v8ExternalStringSlow(StringImpl* stringImpl, v8::Isolate* isolate)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to