Title: [197774] trunk/Source/_javascript_Core
Revision
197774
Author
akl...@apple.com
Date
2016-03-08 09:57:08 -0800 (Tue, 08 Mar 2016)

Log Message

WeakBlock::visit() should check for a WeakHandleOwner before consulting mark bits.
<https://webkit.org/b/155154>

Reviewed by Darin Adler.

Reorder the checks in WeakBlock::visit() so we don't look at the mark bits in MarkedBlock
unless the current WeakImpl has a WeakHandleOwner we need to consult.

I was originally hoping to make an optimization that could skip over entire WeakBlocks
if they didn't have a single WeakHandleOwner, but it turns out that scenario is not as
common as I suspected.

* heap/WeakBlock.cpp:
(JSC::WeakBlock::visit):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (197773 => 197774)


--- trunk/Source/_javascript_Core/ChangeLog	2016-03-08 17:55:01 UTC (rev 197773)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-03-08 17:57:08 UTC (rev 197774)
@@ -1,3 +1,20 @@
+2016-03-08  Andreas Kling  <akl...@apple.com>
+
+        WeakBlock::visit() should check for a WeakHandleOwner before consulting mark bits.
+        <https://webkit.org/b/155154>
+
+        Reviewed by Darin Adler.
+
+        Reorder the checks in WeakBlock::visit() so we don't look at the mark bits in MarkedBlock
+        unless the current WeakImpl has a WeakHandleOwner we need to consult.
+
+        I was originally hoping to make an optimization that could skip over entire WeakBlocks
+        if they didn't have a single WeakHandleOwner, but it turns out that scenario is not as
+        common as I suspected.
+
+        * heap/WeakBlock.cpp:
+        (JSC::WeakBlock::visit):
+
 2016-03-07  Saam barati  <sbar...@apple.com>
 
         [ES6] Implement revocable proxies

Modified: trunk/Source/_javascript_Core/heap/WeakBlock.cpp (197773 => 197774)


--- trunk/Source/_javascript_Core/heap/WeakBlock.cpp	2016-03-08 17:55:01 UTC (rev 197773)
+++ trunk/Source/_javascript_Core/heap/WeakBlock.cpp	2016-03-08 17:57:08 UTC (rev 197774)
@@ -114,14 +114,14 @@
         if (weakImpl->state() != WeakImpl::Live)
             continue;
 
+        WeakHandleOwner* weakHandleOwner = weakImpl->weakHandleOwner();
+        if (!weakHandleOwner)
+            continue;
+
         const JSValue& jsValue = weakImpl->jsValue();
         if (m_markedBlock->isMarkedOrNewlyAllocated(jsValue.asCell()))
             continue;
 
-        WeakHandleOwner* weakHandleOwner = weakImpl->weakHandleOwner();
-        if (!weakHandleOwner)
-            continue;
-
         if (!weakHandleOwner->isReachableFromOpaqueRoots(Handle<Unknown>::wrapSlot(&const_cast<JSValue&>(jsValue)), weakImpl->context(), visitor))
             continue;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to