[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

ggaren at apple.com ggaren at apple.com
Sun Feb 20 23:37:03 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit eda35d367dda40ded16bbe19880cb3b652e7a47c
Author: ggaren at apple.com <ggaren at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jan 22 06:45:13 2011 +0000

    A few of Maciej's review suggestions for my last patch.
    https://bugs.webkit.org/show_bug.cgi?id=52946
    
    Rubber-stamped by Maciej Stachowiak.
    
    SunSpider reports no change.
    
    * runtime/MachineStackMarker.cpp:
    (JSC::swapIfBackwards): Added a helper function for handling platforms
    where the stack can grow in any direction.
    
    (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
    (JSC::MachineStackMarker::markOtherThreadConservatively): Use the helper
    function.
    
    (JSC::isPointerAligned): Use "!" instead of "==0" because a robot told me to.
    
    (JSC::MachineStackMarker::markConservatively): Changed to use a more
    standard looping idiom, and to use the helper function above.
    
    * runtime/MarkedSpace.h:
    (JSC::MarkedSpace::isCellAligned): Use "!" instead of "==0" because a robot told me to.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76430 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 40bf8e8..ea93c00 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,5 +1,30 @@
 2011-01-21  Geoffrey Garen  <ggaren at apple.com>
 
+        Rubber-stamped by Maciej Stachowiak.
+
+        A few of Maciej's review suggestions for my last patch.
+        https://bugs.webkit.org/show_bug.cgi?id=52946        
+
+        SunSpider reports no change.
+
+        * runtime/MachineStackMarker.cpp:
+        (JSC::swapIfBackwards): Added a helper function for handling platforms
+        where the stack can grow in any direction.
+
+        (JSC::MachineStackMarker::markCurrentThreadConservativelyInternal):
+        (JSC::MachineStackMarker::markOtherThreadConservatively): Use the helper
+        function.
+
+        (JSC::isPointerAligned): Use "!" instead of "==0" because a robot told me to.
+
+        (JSC::MachineStackMarker::markConservatively): Changed to use a more
+        standard looping idiom, and to use the helper function above.
+
+        * runtime/MarkedSpace.h:
+        (JSC::MarkedSpace::isCellAligned): Use "!" instead of "==0" because a robot told me to.
+
+2011-01-21  Geoffrey Garen  <ggaren at apple.com>
+
         Reviewed by Maciej Stachowiak.
 
         Cleaned up some conservative marking code.
diff --git a/Source/JavaScriptCore/runtime/MachineStackMarker.cpp b/Source/JavaScriptCore/runtime/MachineStackMarker.cpp
index 4e3408d..b7b71ed 100644
--- a/Source/JavaScriptCore/runtime/MachineStackMarker.cpp
+++ b/Source/JavaScriptCore/runtime/MachineStackMarker.cpp
@@ -135,6 +135,18 @@ static inline PlatformThread getCurrentPlatformThread()
 #endif
 }
 
+static inline void swapIfBackwards(void*& begin, void*& end)
+{
+#if OS(WINCE)
+    if (begin <= end)
+        return;
+    swap(begin, end);
+#else
+UNUSED_PARAM(begin);
+UNUSED_PARAM(end);
+#endif
+}
+
 void MachineStackMarker::makeUsableFromMultipleThreads()
 {
     if (m_currentThreadRegistrar)
@@ -196,7 +208,10 @@ void MachineStackMarker::unregisterThread()
 
 void NEVER_INLINE MachineStackMarker::markCurrentThreadConservativelyInternal(ConservativeSet& conservativeSet)
 {
-    markConservatively(conservativeSet, m_heap->globalData()->stack().current(), m_heap->globalData()->stack().origin());
+    void* begin = m_heap->globalData()->stack().current();
+    void* end = m_heap->globalData()->stack().origin();
+    swapIfBackwards(begin, end);
+    markConservatively(conservativeSet, begin, end);
 }
 
 #if COMPILER(GCC)
@@ -361,7 +376,9 @@ void MachineStackMarker::markOtherThreadConservatively(ConservativeSet& conserva
     markConservatively(conservativeSet, static_cast<void*>(&regs), static_cast<void*>(reinterpret_cast<char*>(&regs) + regSize));
 
     void* stackPointer = otherThreadStackPointer(regs);
-    markConservatively(conservativeSet, stackPointer, thread->stackBase);
+    void* stackBase = thread->stackBase;
+    swapIfBackwards(stackPointer, stackBase);
+    markConservatively(conservativeSet, stackPointer, stackBase);
 
     resumeThread(thread->platformThread);
 }
@@ -399,33 +416,20 @@ void MachineStackMarker::markMachineStackConservatively(ConservativeSet& conserv
 
 inline bool isPointerAligned(void* p)
 {
-    return (((intptr_t)(p) & (sizeof(char*) - 1)) == 0);
+    return !((intptr_t)(p) & (sizeof(char*) - 1));
 }
 
 void MachineStackMarker::markConservatively(ConservativeSet& conservativeSet, void* start, void* end)
 {
-#if OS(WINCE)
-    if (start > end) {
-        void* tmp = start;
-        start = end;
-        end = tmp;
-    }
-#else
     ASSERT(start <= end);
-#endif
-
     ASSERT((static_cast<char*>(end) - static_cast<char*>(start)) < 0x1000000);
     ASSERT(isPointerAligned(start));
     ASSERT(isPointerAligned(end));
 
-    char** p = static_cast<char**>(start);
-    char** e = static_cast<char**>(end);
-
-    while (p != e) {
-        char* x = *p++;
-        if (!m_heap->contains(x))
+    for (char** it = static_cast<char**>(start); it != static_cast<char**>(end); ++it) {
+        if (!m_heap->contains(*it))
             continue;
-        conservativeSet.add(reinterpret_cast<JSCell*>(x));
+        conservativeSet.add(reinterpret_cast<JSCell*>(*it));
     }
 }
 
diff --git a/Source/JavaScriptCore/runtime/MarkedSpace.h b/Source/JavaScriptCore/runtime/MarkedSpace.h
index 6357664..1e23f19 100644
--- a/Source/JavaScriptCore/runtime/MarkedSpace.h
+++ b/Source/JavaScriptCore/runtime/MarkedSpace.h
@@ -219,11 +219,11 @@ namespace JSC {
     }
 
     // Cell size needs to be a power of two for isPossibleCell to be valid.
-    COMPILE_ASSERT(sizeof(CollectorCell) % 2 == 0, Collector_cell_size_is_power_of_two);
+    COMPILE_ASSERT(!(sizeof(CollectorCell) % 2), Collector_cell_size_is_power_of_two);
 
     inline bool MarkedSpace::isCellAligned(void *p)
     {
-        return (((intptr_t)(p) & CELL_MASK) == 0);
+        return !((intptr_t)(p) & CELL_MASK);
     }
 
     inline bool MarkedSpace::isPossibleCell(void* p)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list