Get rid of UnconditionalFinalizers and WeakReferenceHarvesters
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jun 2018 07:42:43 +0000 (07:42 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Jun 2018 07:42:43 +0000 (07:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180248

Reviewed by Sam Weinig.

As a final step, this patch removes ListableHandler from JSC.
Nobody uses UnconditionalFinalizers and WeakReferenceHarvesters now.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/Heap.h:
* heap/ListableHandler.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232463 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/ListableHandler.h [deleted file]

index cdecabd..a64fa1a 100644 (file)
@@ -538,7 +538,6 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
     heap/IsoSubspaceInlines.h
     heap/IsoSubspacePerVM.h
     heap/LargeAllocation.h
-    heap/ListableHandler.h
     heap/LocalAllocator.h
     heap/LocalAllocatorInlines.h
     heap/LockDuringMarking.h
index 9db39aa..ebaa4bf 100644 (file)
@@ -1,3 +1,18 @@
+2018-06-04  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        Get rid of UnconditionalFinalizers and WeakReferenceHarvesters
+        https://bugs.webkit.org/show_bug.cgi?id=180248
+
+        Reviewed by Sam Weinig.
+
+        As a final step, this patch removes ListableHandler from JSC.
+        Nobody uses UnconditionalFinalizers and WeakReferenceHarvesters now.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * heap/Heap.h:
+        * heap/ListableHandler.h: Removed.
+
 2018-06-03  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         LayoutTests/fast/css/parsing-css-matches-7.html always abandons its Document (disabling JIT fixes it)
index 63e5a14..2b5b397 100644 (file)
                0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A451460CBAB00131F8F /* ValueRecovery.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A4A1460CD6B00131F8F /* DataFormat.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0F431738146BAC69007E3890 /* ListableHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F431736146BAC65007E3890 /* ListableHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0F4570391BE44C910062A629 /* AirEliminateDeadCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4570371BE44C910062A629 /* AirEliminateDeadCode.h */; };
                0F45703D1BE45F0A0062A629 /* AirReportUsedRegisters.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F45703B1BE45F0A0062A629 /* AirReportUsedRegisters.h */; };
                0F4570411BE584CA0062A629 /* B3TimingScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F45703F1BE584CA0062A629 /* B3TimingScope.h */; };
                0F426A461460CBAB00131F8F /* VirtualRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualRegister.h; sourceTree = "<group>"; };
                0F426A4A1460CD6B00131F8F /* DataFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataFormat.h; sourceTree = "<group>"; };
                0F42B3C0201EB50900357031 /* Allocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Allocator.cpp; sourceTree = "<group>"; };
-               0F431736146BAC65007E3890 /* ListableHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListableHandler.h; sourceTree = "<group>"; };
                0F4570361BE44C910062A629 /* AirEliminateDeadCode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirEliminateDeadCode.cpp; path = b3/air/AirEliminateDeadCode.cpp; sourceTree = "<group>"; };
                0F4570371BE44C910062A629 /* AirEliminateDeadCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AirEliminateDeadCode.h; path = b3/air/AirEliminateDeadCode.h; sourceTree = "<group>"; };
                0F45703A1BE45F0A0062A629 /* AirReportUsedRegisters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AirReportUsedRegisters.cpp; path = b3/air/AirReportUsedRegisters.cpp; sourceTree = "<group>"; };
                                0F766D2A15A8CC34008F363E /* JITStubRoutineSet.h */,
                                0F070A451D543A89006E7232 /* LargeAllocation.cpp */,
                                0F070A461D543A89006E7232 /* LargeAllocation.h */,
-                               0F431736146BAC65007E3890 /* ListableHandler.h */,
                                0F75A059200D25F00038E2CF /* LocalAllocator.cpp */,
                                0F75A057200D25F00038E2CF /* LocalAllocator.h */,
                                0F75A05A200D25F00038E2CF /* LocalAllocatorInlines.h */,
                                BC18C4310E16F5CD00B34460 /* Lexer.h in Headers */,
                                BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */,
                                86D3B3C310159D7F002865E7 /* LinkBuffer.h in Headers */,
-                               0F431738146BAC69007E3890 /* ListableHandler.h in Headers */,
                                A7E2EA6B0FB460CF00601F06 /* LiteralParser.h in Headers */,
                                70DE9A091BE7D69E005D89D9 /* LLIntAssembly.h in Headers */,
                                0F0FC45A14BD15F500B81154 /* LLIntCallLinkInfo.h in Headers */,
index 3efd201..c1e6314 100644 (file)
@@ -32,7 +32,6 @@
 #include "HandleSet.h"
 #include "HeapFinalizerCallback.h"
 #include "HeapObserver.h"
-#include "ListableHandler.h"
 #include "MarkedBlock.h"
 #include "MarkedSpace.h"
 #include "MutatorState.h"
diff --git a/Source/JavaScriptCore/heap/ListableHandler.h b/Source/JavaScriptCore/heap/ListableHandler.h
deleted file mode 100644 (file)
index 23205c1..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *  Copyright (C) 2011-2016 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#pragma once
-
-#include <stdint.h>
-#include <wtf/Lock.h>
-#include <wtf/Noncopyable.h>
-
-namespace JSC {
-
-class Heap;
-class SlotVisitor;
-
-template<typename T>
-class ListableHandler {
-    WTF_MAKE_NONCOPYABLE(ListableHandler);
-
-public:    
-    bool isOnList() const
-    {
-        return m_nextAndFlag & 1;
-    }
-    
-protected:
-    ListableHandler()
-        : m_nextAndFlag(0)
-    {
-    }
-    
-    virtual ~ListableHandler() { }
-    
-    T* next() const
-    {
-        return reinterpret_cast<T*>(m_nextAndFlag & ~1);
-    }
-
-private:
-    // Allow these classes to use ListableHandler::List.
-    friend class Heap;
-    friend class SlotVisitor;
-    
-    class List {
-        WTF_MAKE_NONCOPYABLE(List);
-    public:
-        List()
-            : m_first(0)
-        {
-        }
-        
-        void addThreadSafe(T* handler)
-        {
-            LockHolder locker(&m_lock);
-            addNotThreadSafe(handler);
-        }
-        
-        bool hasNext()
-        {
-            return !!m_first;
-        }
-        
-        T* head()
-        {
-            return m_first;
-        }
-        
-        T* removeNext()
-        {
-            T* current = m_first;
-            T* next = current->next();
-            current->m_nextAndFlag = 0;
-            m_first = next;
-            return current;
-        }
-        
-        void removeAll()
-        {
-            while (hasNext())
-                removeNext();
-        }
-        
-    private:
-        void addNotThreadSafe(T* handler)
-        {
-            if (handler->m_nextAndFlag & 1)
-                return;
-            handler->m_nextAndFlag = reinterpret_cast<uintptr_t>(m_first) | 1;
-            m_first = handler;
-        }
-        
-        Lock m_lock;
-        T* m_first;
-    };
-    
-    uintptr_t m_nextAndFlag;
-};
-
-} // namespace JSC