WebKit Bugzilla
Attachment 341582 Details for
Bug 186102
: [JSC] Remove WeakReferenceHarvester
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186102-20180531025640.patch (text/plain), 19.74 KB, created by
Yusuke Suzuki
on 2018-05-30 10:56:41 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-05-30 10:56:41 PDT
Size:
19.74 KB
patch
obsolete
>Subversion Revision: 232290 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 4714feef5a59263e3c6359d59c3eec11bb8e0424..a50348f3ed5d4ef2e18f308d8f2bb5f6e3e788e2 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,41 @@ >+2018-05-30 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [JSC] Remove WeakReferenceHarvester >+ https://bugs.webkit.org/show_bug.cgi?id=186102 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ After several cleanups, now JSWeakMap becomes the last user of WeakReferenceHarvester. >+ Since JSWeakMap is already managed in IsoSubspace, we can iterate marked JSWeakMap >+ by using IsoSubspace::forEachMarkedCell. >+ >+ This patch removes WeakReferenceHarvester. Instead of managing this linked-list, our >+ Weak Reference Harvester constraint set iterates marked JSWeakMap by using Subspace. >+ >+ Attached microbenchmark does not show any regression. >+ >+ * API/JSAPIWrapperObject.h: >+ * CMakeLists.txt: >+ * JavaScriptCore.xcodeproj/project.pbxproj: >+ * heap/Heap.cpp: >+ (JSC::Heap::endMarking): >+ (JSC::Heap::addCoreConstraints): >+ * heap/Heap.h: >+ * heap/SlotVisitor.cpp: >+ (JSC::SlotVisitor::addWeakReferenceHarvester): Deleted. >+ * heap/SlotVisitor.h: >+ * heap/WeakReferenceHarvester.h: Removed. >+ * runtime/WeakMapImpl.cpp: >+ (JSC::WeakMapImpl<WeakMapBucket>::visitChildren): >+ (JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKey>>::visitWeakReferences): Deleted. >+ (JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKeyValue>>::visitWeakReferences): Deleted. >+ * runtime/WeakMapImpl.h: >+ (JSC::WeakMapImpl::DeadKeyCleaner::target): Deleted. >+ (): Deleted. >+ * runtime/WeakMapImplInlines.h: >+ (JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKey>>::visitWeakReferences): >+ (JSC::WeakMapImpl<WeakMapBucket<WeakMapBucketDataKeyValue>>::visitWeakReferences): >+ > 2018-05-30 Dominik Infuehr <dinfuehr@igalia.com> > > [MIPS] Fix build on MIPS32r1 >diff --git a/Source/JavaScriptCore/API/JSAPIWrapperObject.h b/Source/JavaScriptCore/API/JSAPIWrapperObject.h >index aae5d418a7a32915ca43ec9728f6e80c2a7e7bbe..305fca4ce0b8fe21d6b8384f9627b367905542d9 100644 >--- a/Source/JavaScriptCore/API/JSAPIWrapperObject.h >+++ b/Source/JavaScriptCore/API/JSAPIWrapperObject.h >@@ -29,7 +29,6 @@ > #include "JSBase.h" > #include "JSCPoison.h" > #include "JSDestructibleObject.h" >-#include "WeakReferenceHarvester.h" > #include <wtf/Poisoned.h> > > #if JSC_OBJC_API_ENABLED || defined(JSC_GLIB_API_ENABLED) >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index 47cbe5c92d312b024daadec16ee9d9efac611de2..b7b617b25ed61c632b9f946cbae3b1319d2684e4 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -567,7 +567,6 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS > heap/WeakHandleOwner.h > heap/WeakImpl.h > heap/WeakInlines.h >- heap/WeakReferenceHarvester.h > heap/WeakSet.h > heap/WeakSetInlines.h > >diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >index 29cbab4d3b04b888e0eb5e184055d8d3bbd560db..3f4a2f4b880563a8df847adffa3bbd955ab9732f 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >@@ -150,7 +150,6 @@ > 0F235BE217178E1C00690C7F /* FTLThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BCC17178E1C00690C7F /* FTLThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F235BEC17178E7300690C7F /* DFGOSRExitBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BE817178E7300690C7F /* DFGOSRExitBase.h */; }; > 0F235BEE17178E7300690C7F /* DFGOSRExitPreparation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F235BEA17178E7300690C7F /* DFGOSRExitPreparation.h */; }; >- 0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F24E54117EA9F5900ABB217 /* AssemblyHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53C17EA9F5900ABB217 /* AssemblyHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F24E54217EA9F5900ABB217 /* CCallHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53D17EA9F5900ABB217 /* CCallHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F24E54317EA9F5900ABB217 /* FPRInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F24E53E17EA9F5900ABB217 /* FPRInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -2061,7 +2060,6 @@ > 0F235BE817178E7300690C7F /* DFGOSRExitBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExitBase.h; path = dfg/DFGOSRExitBase.h; sourceTree = "<group>"; }; > 0F235BE917178E7300690C7F /* DFGOSRExitPreparation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGOSRExitPreparation.cpp; path = dfg/DFGOSRExitPreparation.cpp; sourceTree = "<group>"; }; > 0F235BEA17178E7300690C7F /* DFGOSRExitPreparation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExitPreparation.h; path = dfg/DFGOSRExitPreparation.h; sourceTree = "<group>"; }; >- 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakReferenceHarvester.h; sourceTree = "<group>"; }; > 0F24E53B17EA9F5900ABB217 /* AssemblyHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AssemblyHelpers.cpp; sourceTree = "<group>"; }; > 0F24E53C17EA9F5900ABB217 /* AssemblyHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssemblyHelpers.h; sourceTree = "<group>"; }; > 0F24E53D17EA9F5900ABB217 /* CCallHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCallHelpers.h; sourceTree = "<group>"; }; >@@ -4912,9 +4910,9 @@ > 14BD59BF0A3E8F9000BAF59C /* testapi */, > 0FEC85AD1BDB5CF10080FF74 /* testb3 */, > FE533CAC1F217DB40016A1FE /* testmasm */, >+ 79281BDC20B62B3E002E2A60 /* testmem */, > 6511230514046A4C002B101D /* testRegExp */, > 932F5BD90822A1C700736975 /* JavaScriptCore.framework */, >- 79281BDC20B62B3E002E2A60 /* testmem */, > ); > name = Products; > sourceTree = "<group>"; >@@ -5815,7 +5813,6 @@ > 14F7256414EE265E00B1652B /* WeakHandleOwner.h */, > 14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */, > 14BE7D3217135CF400D1807A /* WeakInlines.h */, >- 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */, > 14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */, > 14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */, > 14150132154BB13F005D8C98 /* WeakSetInlines.h */, >@@ -6286,8 +6283,8 @@ > 79ABCC5520B7812600323D5F /* testmem2 */ = { > isa = PBXGroup; > children = ( >- 79ABCC5620B7812600323D5F /* testmem2.m */, > 79ABCC5820B7812600323D5F /* testmem2.1 */, >+ 79ABCC5620B7812600323D5F /* testmem2.m */, > ); > path = testmem2; > sourceTree = "<group>"; >@@ -8365,7 +8362,6 @@ > 0F4C91661C29F4F2004341A6 /* B3OriginDump.h in Headers */, > 0FEC85261BDACDAC0080FF74 /* B3PatchpointSpecial.h in Headers */, > 0FEC85281BDACDAC0080FF74 /* B3PatchpointValue.h in Headers */, >- 0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */, > 799EF7C41C56ED96002B0534 /* B3PCToOriginMap.h in Headers */, > 0FEC852A1BDACDAC0080FF74 /* B3PhaseScope.h in Headers */, > 0F37308D1C0BD29100052BFA /* B3PhiChildren.h in Headers */, >@@ -8493,6 +8489,7 @@ > A7E5A3A81797432D00E893C0 /* CompilationResult.h in Headers */, > 0F4F11E8209BCDAB00709654 /* CompilerTimingScope.h in Headers */, > 0FDCE12A1FAFA85F006F3901 /* CompleteSubspace.h in Headers */, >+ 0FD2FD9420B52BDE00F09441 /* CompleteSubspaceInlines.h in Headers */, > BC18C3F40E16F5CD00B34460 /* Completion.h in Headers */, > 0F6FC751196110A800E1D02D /* ComplexGetStatus.h in Headers */, > 0FDB2CEA174896C7007B3C1B /* ConcurrentJSLock.h in Headers */, >@@ -8990,6 +8987,7 @@ > 0FB467801FDDA6F1003FCB09 /* IsoCellSet.h in Headers */, > 0FB467811FDDA6F7003FCB09 /* IsoCellSetInlines.h in Headers */, > 0FDCE12D1FAFB4E5006F3901 /* IsoSubspace.h in Headers */, >+ 0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */, > 0F5E0FE72086AD480097F0DE /* IsoSubspacePerVM.h in Headers */, > 8B9F6D561D5912FA001C739F /* IterationKind.h in Headers */, > FE4D55B81AE716CA0052E459 /* IterationStatus.h in Headers */, >@@ -9000,7 +8998,6 @@ > BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */, > BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */, > 1429D9300ED22D7000B89619 /* JIT.h in Headers */, >- 0FD2FD9420B52BDE00F09441 /* CompleteSubspaceInlines.h in Headers */, > FE1220271BE7F58C0039E6F2 /* JITAddGenerator.h in Headers */, > 0F75A0662013E4F10038E2CF /* JITAllocator.h in Headers */, > FE3A06B21C10CB8900390FDD /* JITBitAndGenerator.h in Headers */, >@@ -9617,7 +9614,6 @@ > E3A32BC71FC83147007D7E76 /* WeakMapImpl.h in Headers */, > E393ADD81FE702D00022D681 /* WeakMapImplInlines.h in Headers */, > A7CA3AE617DA41AE006538AF /* WeakMapPrototype.h in Headers */, >- 0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */, > 14E84FA114EE1ACC00D6D5D4 /* WeakSet.h in Headers */, > 709FB86A1AE335C60039D069 /* WeakSetConstructor.h in Headers */, > 14150133154BB13F005D8C98 /* WeakSetInlines.h in Headers */, >diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp >index 9a7ca60cc856e7dd20e8187b267e1066361fe69e..02fba6628a7115f27c756d9a0b919cbeebdddc9b 100644 >--- a/Source/JavaScriptCore/heap/Heap.cpp >+++ b/Source/JavaScriptCore/heap/Heap.cpp >@@ -781,7 +781,6 @@ void Heap::endMarking() > }); > > assertMarkStacksEmpty(); >- m_weakReferenceHarvesters.removeAll(); > > RELEASE_ASSERT(m_raceMarkStack->isEmpty()); > >@@ -2716,8 +2715,11 @@ void Heap::addCoreConstraints() > m_constraintSet->add( > "Wrh", "Weak Reference Harvesters", > [this] (SlotVisitor& slotVisitor) { >- for (WeakReferenceHarvester* current = m_weakReferenceHarvesters.head(); current; current = current->next()) >- current->visitWeakReferences(slotVisitor); >+ VM& vm = slotVisitor.vm(); >+ vm.weakMapSpace.forEachMarkedCell( >+ [&] (HeapCell* cell, HeapCell::Kind) { >+ static_cast<JSWeakMap*>(cell)->visitWeakReferences(slotVisitor); >+ }); > }, > ConstraintVolatility::GreyedByMarking); > >diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h >index c8a6f0d64f322a31ebb102c6cc398e50f1c253b8..cffedb762727382b937cad53a3539c7083e9d30e 100644 >--- a/Source/JavaScriptCore/heap/Heap.h >+++ b/Source/JavaScriptCore/heap/Heap.h >@@ -40,7 +40,6 @@ > #include "StructureIDTable.h" > #include "Synchronousness.h" > #include "WeakHandleOwner.h" >-#include "WeakReferenceHarvester.h" > #include <wtf/AutomaticThread.h> > #include <wtf/ConcurrentPtrHashSet.h> > #include <wtf/Deque.h> >@@ -671,8 +670,6 @@ class Heap { > > static const size_t s_blockFragmentLength = 32; > >- ListableHandler<WeakReferenceHarvester>::List m_weakReferenceHarvesters; >- > ParallelHelperClient m_helperClient; > RefPtr<SharedTask<void(SlotVisitor&)>> m_bonusVisitorTask; > >diff --git a/Source/JavaScriptCore/heap/SlotVisitor.cpp b/Source/JavaScriptCore/heap/SlotVisitor.cpp >index 5b0924a846d2ca12344fc537a27fec20590549d4..b89686e545a8e70b289d1b421868e9a82dfd7060 100644 >--- a/Source/JavaScriptCore/heap/SlotVisitor.cpp >+++ b/Source/JavaScriptCore/heap/SlotVisitor.cpp >@@ -753,11 +753,6 @@ void SlotVisitor::donateAndDrain(MonotonicTime timeout) > drain(timeout); > } > >-void SlotVisitor::addWeakReferenceHarvester(WeakReferenceHarvester* weakReferenceHarvester) >-{ >- m_heap.m_weakReferenceHarvesters.addThreadSafe(weakReferenceHarvester); >-} >- > void SlotVisitor::didRace(const VisitRaceKey& race) > { > if (Options::verboseVisitRace()) >diff --git a/Source/JavaScriptCore/heap/SlotVisitor.h b/Source/JavaScriptCore/heap/SlotVisitor.h >index 29fbfacb56234209331bdbf606dfd15c276cc303..e8a27743a6c63b12ad99773abd260d839ad31731 100644 >--- a/Source/JavaScriptCore/heap/SlotVisitor.h >+++ b/Source/JavaScriptCore/heap/SlotVisitor.h >@@ -45,7 +45,6 @@ class MarkedBlock; > class MarkingConstraint; > class MarkingConstraintSolver; > template<typename T> class Weak; >-class WeakReferenceHarvester; > template<typename T, typename Traits> class WriteBarrierBase; > > typedef uint32_t HeapVersion; >@@ -140,8 +139,6 @@ class SlotVisitor { > void reportExternalMemoryVisited(size_t); > #endif > >- void addWeakReferenceHarvester(WeakReferenceHarvester*); >- > void dump(PrintStream&) const; > > bool isBuildingHeapSnapshot() const { return !!m_heapSnapshotBuilder; } >diff --git a/Source/JavaScriptCore/heap/WeakReferenceHarvester.h b/Source/JavaScriptCore/heap/WeakReferenceHarvester.h >deleted file mode 100644 >index 4807e06791ea7a87a6c96e9209b65f00317a7e05..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/heap/WeakReferenceHarvester.h >+++ /dev/null >@@ -1,40 +0,0 @@ >-/* >- * Copyright (C) 2011 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 "ListableHandler.h" >- >-namespace JSC { >- >-class SlotVisitor; >- >-class WeakReferenceHarvester : public ListableHandler<WeakReferenceHarvester> { >-public: >- virtual void visitWeakReferences(SlotVisitor&) = 0; >- >-protected: >- WeakReferenceHarvester() >- { >- } >- >- virtual ~WeakReferenceHarvester() { } >-}; >- >-} // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/WeakMapImpl.cpp b/Source/JavaScriptCore/runtime/WeakMapImpl.cpp >index fc5ebdcc4fa0269223d664478b712232e6c21ab4..0e35a082710bf4b8b5fcad94f3de0490512ec604 100644 >--- a/Source/JavaScriptCore/runtime/WeakMapImpl.cpp >+++ b/Source/JavaScriptCore/runtime/WeakMapImpl.cpp >@@ -45,9 +45,6 @@ void WeakMapImpl<WeakMapBucket>::visitChildren(JSCell* cell, SlotVisitor& visito > WeakMapImpl* thisObject = jsCast<WeakMapImpl*>(cell); > ASSERT_GC_OBJECT_INHERITS(thisObject, info()); > Base::visitChildren(thisObject, visitor); >- >- if (isWeakMap()) >- visitor.addWeakReferenceHarvester(&thisObject->m_deadKeyCleaner); > visitor.reportExtraMemoryVisited(thisObject->m_capacity * sizeof(WeakMapBucket)); > } > >@@ -58,26 +55,6 @@ size_t WeakMapImpl<WeakMapBucket>::estimatedSize(JSCell* cell) > return Base::estimatedSize(thisObject) + (sizeof(WeakMapImpl) - sizeof(Base)) + thisObject->m_capacity * sizeof(WeakMapBucket); > } > >-template <> >-void WeakMapImpl<WeakMapBucket<WeakMapBucketDataKey>>::visitWeakReferences(SlotVisitor&) >-{ >- // Only JSWeakMap needs to harvest value references >-} >- >-template <> >-void WeakMapImpl<WeakMapBucket<WeakMapBucketDataKeyValue>>::visitWeakReferences(SlotVisitor& visitor) >-{ >- auto* buffer = this->buffer(); >- for (uint32_t index = 0; index < m_capacity; ++index) { >- auto* bucket = buffer + index; >- if (bucket->isEmpty() || bucket->isDeleted()) >- continue; >- if (!Heap::isMarked(bucket->key())) >- continue; >- bucket->visitAggregate(visitor); >- } >-} >- > template <typename WeakMapBucket> > template<typename Appender> > void WeakMapImpl<WeakMapBucket>::takeSnapshotInternal(unsigned limit, Appender appender) >diff --git a/Source/JavaScriptCore/runtime/WeakMapImpl.h b/Source/JavaScriptCore/runtime/WeakMapImpl.h >index 1bf6350b08cdd106c7a8b6aee19658e53e879663..ed49f802d34d2dd09f83d8acce9833ffcc03728e 100644 >--- a/Source/JavaScriptCore/runtime/WeakMapImpl.h >+++ b/Source/JavaScriptCore/runtime/WeakMapImpl.h >@@ -309,6 +309,7 @@ class WeakMapImpl : public JSDestructibleObject { > return &vm.weakSetSpace; > } > >+ void visitWeakReferences(SlotVisitor&); > void finalizeUnconditionally(VM&); > > private: >@@ -469,27 +470,10 @@ class WeakMapImpl : public JSDestructibleObject { > template<typename Appender> > void takeSnapshotInternal(unsigned limit, Appender); > >- class DeadKeyCleaner : public WeakReferenceHarvester { >- public: >- WeakMapImpl* target() >- { >- return bitwise_cast<WeakMapImpl*>(bitwise_cast<char*>(this) - OBJECT_OFFSETOF(WeakMapImpl, m_deadKeyCleaner)); >- } >- >- private: >- void visitWeakReferences(SlotVisitor& visitor) override >- { >- target()->visitWeakReferences(visitor); >- } >- }; >- >- void visitWeakReferences(SlotVisitor&); >- > MallocPtr<WeakMapBufferType, JSValueMalloc> m_buffer; > uint32_t m_keyCount; > uint32_t m_deleteCount; > uint32_t m_capacity; >- DeadKeyCleaner m_deadKeyCleaner; > }; > > } // namespace JSC >diff --git a/Source/JavaScriptCore/runtime/WeakMapImplInlines.h b/Source/JavaScriptCore/runtime/WeakMapImplInlines.h >index a7b8b995b1bca6fdeae33561b81554af1fbe136e..530977932a9a478dceb96c19a579087223d4d66a 100644 >--- a/Source/JavaScriptCore/runtime/WeakMapImplInlines.h >+++ b/Source/JavaScriptCore/runtime/WeakMapImplInlines.h >@@ -52,4 +52,24 @@ void WeakMapImpl<WeakMapBucket>::finalizeUnconditionally(VM&) > rehash(RehashMode::RemoveBatching); > } > >+template <> >+inline void WeakMapImpl<WeakMapBucket<WeakMapBucketDataKey>>::visitWeakReferences(SlotVisitor&) >+{ >+ // Only JSWeakMap needs to harvest value references >+} >+ >+template <> >+inline void WeakMapImpl<WeakMapBucket<WeakMapBucketDataKeyValue>>::visitWeakReferences(SlotVisitor& visitor) >+{ >+ auto* buffer = this->buffer(); >+ for (uint32_t index = 0; index < m_capacity; ++index) { >+ auto* bucket = buffer + index; >+ if (bucket->isEmpty() || bucket->isDeleted()) >+ continue; >+ if (!Heap::isMarked(bucket->key())) >+ continue; >+ bucket->visitAggregate(visitor); >+ } >+} >+ > } >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index a68fd29992f9c6928c706f8fdafe7778f9e3a78b..726af0f667e7a33a911dfabefb91579354c52efd 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,12 @@ >+2018-05-30 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ [JSC] Remove WeakReferenceHarvester >+ https://bugs.webkit.org/show_bug.cgi?id=186102 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * microbenchmarks/create-many-weak-map.js: Added. >+ > 2018-05-29 Caitlin Potter <caitp@igalia.com> > > [JSTests] update test262 expectations after r232261 >diff --git a/JSTests/microbenchmarks/create-many-weak-map.js b/JSTests/microbenchmarks/create-many-weak-map.js >new file mode 100644 >index 0000000000000000000000000000000000000000..1d30d123b41b6f67600ec3b17e27821c42f3dc96 >--- /dev/null >+++ b/JSTests/microbenchmarks/create-many-weak-map.js >@@ -0,0 +1,20 @@ >+var root = []; >+ >+function create() >+{ >+ var weakMap = new WeakMap(); >+ for (var i = 0; i < 1e2; ++i) { >+ var key = {}; >+ var value = {}; >+ weakMap.set(key, value); >+ if (i % 10 === 0) >+ root.push(key); >+ } >+} >+ >+for (var i = 0; i < 1e2; ++i) { >+ for (var j = 0; j < 1e2; ++j) { >+ var map = create(); >+ root.push(map); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186102
:
341582
|
341583
|
341842
|
341844