Title: [231534] trunk/Source/_javascript_Core
Revision
231534
Author
msab...@apple.com
Date
2018-05-08 18:11:40 -0700 (Tue, 08 May 2018)

Log Message

Replace multiple Watchpoint Set fireAll() methods with templates
https://bugs.webkit.org/show_bug.cgi?id=185456

Reviewed by Saam Barati.

Refactored to minimize duplicate code.

* bytecode/Watchpoint.h:
(JSC::WatchpointSet::fireAll):
(JSC::InlineWatchpointSet::fireAll):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (231533 => 231534)


--- trunk/Source/_javascript_Core/ChangeLog	2018-05-09 00:41:51 UTC (rev 231533)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-05-09 01:11:40 UTC (rev 231534)
@@ -1,3 +1,16 @@
+2018-05-08  Michael Saboff  <msab...@apple.com>
+
+        Replace multiple Watchpoint Set fireAll() methods with templates
+        https://bugs.webkit.org/show_bug.cgi?id=185456
+
+        Reviewed by Saam Barati.
+
+        Refactored to minimize duplicate code.
+
+        * bytecode/Watchpoint.h:
+        (JSC::WatchpointSet::fireAll):
+        (JSC::InlineWatchpointSet::fireAll):
+
 2018-05-08  Filip Pizlo  <fpi...@apple.com>
 
         DFG::FlowMap::resize() shouldn't resize the shadow map unless we're in SSA

Modified: trunk/Source/_javascript_Core/bytecode/Watchpoint.h (231533 => 231534)


--- trunk/Source/_javascript_Core/bytecode/Watchpoint.h	2018-05-09 00:41:51 UTC (rev 231533)
+++ trunk/Source/_javascript_Core/bytecode/Watchpoint.h	2018-05-09 01:11:40 UTC (rev 231534)
@@ -153,28 +153,15 @@
         m_state = IsWatched;
         WTF::storeStoreFence();
     }
-    
-    void fireAll(VM& vm, const FireDetail& detail)
+
+    template <typename T>
+    void fireAll(VM& vm, T& fireDetails)
     {
         if (LIKELY(m_state != IsWatched))
             return;
-        fireAllSlow(vm, detail);
+        fireAllSlow(vm, fireDetails);
     }
-    
-    void fireAll(VM& vm, DeferredWatchpointFire* deferredWatchpoints)
-    {
-        if (LIKELY(m_state != IsWatched))
-            return;
-        fireAllSlow(vm, deferredWatchpoints);
-    }
 
-    void fireAll(VM& vm, const char* reason)
-    {
-        if (LIKELY(m_state != IsWatched))
-            return;
-        fireAllSlow(vm, reason);
-    }
-    
     void touch(VM& vm, const FireDetail& detail)
     {
         if (state() == ClearWatchpoint)
@@ -210,7 +197,7 @@
     int8_t* addressOfSetIsNotEmpty() { return &m_setIsNotEmpty; }
     
     JS_EXPORT_PRIVATE void fireAllSlow(VM&, const FireDetail&); // Call only if you've checked isWatched.
-    JS_EXPORT_PRIVATE void fireAllSlow(VM&, DeferredWatchpointFire* deferredWatchpoints);
+    JS_EXPORT_PRIVATE void fireAllSlow(VM&, DeferredWatchpointFire* deferredWatchpoints); // Ditto.
     JS_EXPORT_PRIVATE void fireAllSlow(VM&, const char* reason); // Ditto.
     
 private:
@@ -306,11 +293,12 @@
         ASSERT(decodeState(m_data) != IsInvalidated);
         m_data = encodeState(IsWatched);
     }
-    
-    void fireAll(VM& vm, const FireDetail& detail)
+
+    template <typename T>
+    void fireAll(VM& vm, T fireDetails)
     {
         if (isFat()) {
-            fat()->fireAll(vm, detail);
+            fat()->fireAll(vm, fireDetails);
             return;
         }
         if (decodeState(m_data) == ClearWatchpoint)
@@ -318,18 +306,6 @@
         m_data = encodeState(IsInvalidated);
         WTF::storeStoreFence();
     }
-    
-    void fireAll(VM& vm, DeferredWatchpointFire* deferred)
-    {
-        if (isFat()) {
-            fat()->fireAll(vm, deferred);
-            return;
-        }
-        if (decodeState(m_data) == ClearWatchpoint)
-            return;
-        m_data = encodeState(IsInvalidated);
-        WTF::storeStoreFence();
-    }
 
     void invalidate(VM& vm, const FireDetail& detail)
     {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to