Title: [135341] trunk/Source/WTF
Revision
135341
Author
fpi...@apple.com
Date
2012-11-20 18:34:46 -0800 (Tue, 20 Nov 2012)

Log Message

DFG should be able to cache closure calls
https://bugs.webkit.org/show_bug.cgi?id=102662

Reviewed by Gavin Barraclough.

Added support to the meta allocator for easily querying whether an address falls within
a certain allocated chunk. Also added a useful debug routine to SentinelLinkedList,
which can be used to check if a node is on a particular list.

* wtf/MetaAllocatorHandle.h:
(MetaAllocatorHandle):
(WTF::MetaAllocatorHandle::containsIntegerAddress):
(WTF::MetaAllocatorHandle::contains):
* wtf/SentinelLinkedList.h:
(SentinelLinkedList):
(WTF::::isOnList):
(WTF):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (135340 => 135341)


--- trunk/Source/WTF/ChangeLog	2012-11-21 02:32:58 UTC (rev 135340)
+++ trunk/Source/WTF/ChangeLog	2012-11-21 02:34:46 UTC (rev 135341)
@@ -1,3 +1,23 @@
+2012-11-19  Filip Pizlo  <fpi...@apple.com>
+
+        DFG should be able to cache closure calls
+        https://bugs.webkit.org/show_bug.cgi?id=102662
+
+        Reviewed by Gavin Barraclough.
+
+        Added support to the meta allocator for easily querying whether an address falls within
+        a certain allocated chunk. Also added a useful debug routine to SentinelLinkedList,
+        which can be used to check if a node is on a particular list.
+
+        * wtf/MetaAllocatorHandle.h:
+        (MetaAllocatorHandle):
+        (WTF::MetaAllocatorHandle::containsIntegerAddress):
+        (WTF::MetaAllocatorHandle::contains):
+        * wtf/SentinelLinkedList.h:
+        (SentinelLinkedList):
+        (WTF::::isOnList):
+        (WTF):
+
 2012-11-19  Laszlo Gombos  <l.gom...@samsung.com>
 
         Remove ReadWriteLock

Modified: trunk/Source/WTF/wtf/MetaAllocatorHandle.h (135340 => 135341)


--- trunk/Source/WTF/wtf/MetaAllocatorHandle.h	2012-11-21 02:32:58 UTC (rev 135340)
+++ trunk/Source/WTF/wtf/MetaAllocatorHandle.h	2012-11-21 02:34:46 UTC (rev 135341)
@@ -69,6 +69,16 @@
     {
         return m_sizeInBytes;
     }
+    
+    bool containsIntegerAddress(uintptr_t address) const
+    {
+        return address - startAsInteger() < sizeInBytes();
+    }
+    
+    bool contains(void* address) const
+    {
+        return containsIntegerAddress(reinterpret_cast<uintptr_t>(address));
+    }
         
     WTF_EXPORT_PRIVATE void shrink(size_t newSizeInBytes);
     

Modified: trunk/Source/WTF/wtf/SentinelLinkedList.h (135340 => 135341)


--- trunk/Source/WTF/wtf/SentinelLinkedList.h	2012-11-21 02:32:58 UTC (rev 135340)
+++ trunk/Source/WTF/wtf/SentinelLinkedList.h	2012-11-21 02:34:46 UTC (rev 135341)
@@ -83,6 +83,8 @@
 
     void push(T*);
     static void remove(T*);
+    
+    bool isOnList(T*);
 
     iterator begin();
     iterator end();
@@ -152,8 +154,21 @@
     node->setNext(0);
 }
 
+template <typename T, typename RawNode> inline bool SentinelLinkedList<T, RawNode>::isOnList(T* node)
+{
+    if (!node->isOnList())
+        return false;
+    
+    for (T* iter = begin(); iter != end(); iter = iter->next()) {
+        if (iter == node)
+            return true;
+    }
+    
+    return false;
 }
 
+}
+
 using WTF::BasicRawSentinelNode;
 using WTF::SentinelLinkedList;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to