Title: [235776] trunk/Source/_javascript_Core
Revision
235776
Author
[email protected]
Date
2018-09-06 21:24:19 -0700 (Thu, 06 Sep 2018)

Log Message

[JSC] Clean up StructureStubClearingWatchpoint
https://bugs.webkit.org/show_bug.cgi?id=189156

Reviewed by Saam Barati.

Cleaning up StructureStubClearingWatchpoint by holding StructureStubClearingWatchpoint in Bag
in WatchpointsOnStructureStubInfo. This removes hacky linked list code for StructureStubClearingWatchpoint.

* bytecode/StructureStubClearingWatchpoint.cpp:
(JSC::WatchpointsOnStructureStubInfo::addWatchpoint):
(JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint): Deleted.
(JSC::StructureStubClearingWatchpoint::push): Deleted.
(JSC::WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo): Deleted.
* bytecode/StructureStubClearingWatchpoint.h:
(JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (235775 => 235776)


--- trunk/Source/_javascript_Core/ChangeLog	2018-09-07 03:04:53 UTC (rev 235775)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-09-07 04:24:19 UTC (rev 235776)
@@ -1,3 +1,21 @@
+2018-08-31  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Clean up StructureStubClearingWatchpoint
+        https://bugs.webkit.org/show_bug.cgi?id=189156
+
+        Reviewed by Saam Barati.
+
+        Cleaning up StructureStubClearingWatchpoint by holding StructureStubClearingWatchpoint in Bag
+        in WatchpointsOnStructureStubInfo. This removes hacky linked list code for StructureStubClearingWatchpoint.
+
+        * bytecode/StructureStubClearingWatchpoint.cpp:
+        (JSC::WatchpointsOnStructureStubInfo::addWatchpoint):
+        (JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint): Deleted.
+        (JSC::StructureStubClearingWatchpoint::push): Deleted.
+        (JSC::WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo): Deleted.
+        * bytecode/StructureStubClearingWatchpoint.h:
+        (JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):
+
 2018-09-06  Michael Saboff  <[email protected]>
 
         Improper speculation type for Math.pow(NaN, 0) in Abstract Interpreter

Modified: trunk/Source/_javascript_Core/bytecode/StructureStubClearingWatchpoint.cpp (235775 => 235776)


--- trunk/Source/_javascript_Core/bytecode/StructureStubClearingWatchpoint.cpp	2018-09-07 03:04:53 UTC (rev 235775)
+++ trunk/Source/_javascript_Core/bytecode/StructureStubClearingWatchpoint.cpp	2018-09-07 04:24:19 UTC (rev 235776)
@@ -34,20 +34,6 @@
 
 namespace JSC {
 
-StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint()
-{
-    for (auto current = WTFMove(m_next); current; current = WTFMove(current->m_next)) { }
-}
-
-StructureStubClearingWatchpoint* StructureStubClearingWatchpoint::push(
-    const ObjectPropertyCondition& key,
-    WatchpointsOnStructureStubInfo& holder,
-    std::unique_ptr<StructureStubClearingWatchpoint>& head)
-{
-    head = std::make_unique<StructureStubClearingWatchpoint>(key, holder, WTFMove(head));
-    return head.get();
-}
-
 void StructureStubClearingWatchpoint::fireInternal(VM& vm, const FireDetail&)
 {
     if (!m_key || !m_key.isWatchable(PropertyCondition::EnsureWatchability)) {
@@ -68,13 +54,9 @@
     m_key.object()->structure(vm)->addTransitionWatchpoint(this);
 }
 
-WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo()
-{
-}
-
 StructureStubClearingWatchpoint* WatchpointsOnStructureStubInfo::addWatchpoint(const ObjectPropertyCondition& key)
 {
-    return StructureStubClearingWatchpoint::push(key, *this, m_head);
+    return m_watchpoints.add(key, *this);
 }
 
 StructureStubClearingWatchpoint* WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint(

Modified: trunk/Source/_javascript_Core/bytecode/StructureStubClearingWatchpoint.h (235775 => 235776)


--- trunk/Source/_javascript_Core/bytecode/StructureStubClearingWatchpoint.h	2018-09-07 03:04:53 UTC (rev 235775)
+++ trunk/Source/_javascript_Core/bytecode/StructureStubClearingWatchpoint.h	2018-09-07 04:24:19 UTC (rev 235776)
@@ -30,6 +30,7 @@
 
 #if ENABLE(JIT)
 
+#include <wtf/Bag.h>
 #include <wtf/FastMalloc.h>
 #include <wtf/Noncopyable.h>
 
@@ -45,20 +46,11 @@
 public:
     StructureStubClearingWatchpoint(
         const ObjectPropertyCondition& key,
-        WatchpointsOnStructureStubInfo& holder,
-        std::unique_ptr<StructureStubClearingWatchpoint> next)
+        WatchpointsOnStructureStubInfo& holder)
         : m_key(key)
         , m_holder(holder)
-        , m_next(WTFMove(next))
     {
     }
-    
-    virtual ~StructureStubClearingWatchpoint();
-    
-    static StructureStubClearingWatchpoint* push(
-        const ObjectPropertyCondition& key,
-        WatchpointsOnStructureStubInfo& holder,
-        std::unique_ptr<StructureStubClearingWatchpoint>& head);
 
 protected:
     void fireInternal(VM&, const FireDetail&) override;
@@ -66,7 +58,6 @@
 private:
     ObjectPropertyCondition m_key;
     WatchpointsOnStructureStubInfo& m_holder;
-    std::unique_ptr<StructureStubClearingWatchpoint> m_next;
 };
 
 class WatchpointsOnStructureStubInfo {
@@ -79,8 +70,6 @@
     {
     }
     
-    ~WatchpointsOnStructureStubInfo();
-    
     StructureStubClearingWatchpoint* addWatchpoint(const ObjectPropertyCondition& key);
     
     static StructureStubClearingWatchpoint* ensureReferenceAndAddWatchpoint(
@@ -93,7 +82,7 @@
 private:
     CodeBlock* m_codeBlock;
     StructureStubInfo* m_stubInfo;
-    std::unique_ptr<StructureStubClearingWatchpoint> m_head;
+    Bag<StructureStubClearingWatchpoint> m_watchpoints;
 };
 
 } // namespace JSC
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to