RESOLVED FIXED 189156
[JSC] Clean up StructureStubClearingWatchpoint
https://bugs.webkit.org/show_bug.cgi?id=189156
Summary [JSC] Clean up StructureStubClearingWatchpoint
Yusuke Suzuki
Reported 2018-08-30 09:02:32 PDT
[JSC] Clean up StructureStubClearingWatchpoint
Attachments
Patch (5.13 KB, patch)
2018-08-30 09:03 PDT, Yusuke Suzuki
no flags
Patch (5.06 KB, patch)
2018-08-31 23:20 PDT, Yusuke Suzuki
saam: review+
Yusuke Suzuki
Comment 1 2018-08-30 09:03:52 PDT
Saam Barati
Comment 2 2018-08-30 13:23:57 PDT
Comment on attachment 348502 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348502&action=review > Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.h:-96 > - std::unique_ptr<StructureStubClearingWatchpoint> m_head; Was there a reason for the old code?
Yusuke Suzuki
Comment 3 2018-08-31 02:21:29 PDT
Comment on attachment 348502 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348502&action=review >> Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.h:-96 >> - std::unique_ptr<StructureStubClearingWatchpoint> m_head; > > Was there a reason for the old code? I can't see any reason. Vector<StructureStubClearingWatchpoint> is bad since each StructureStubClearingWatchpoint address can be changed. But Vector<std::unique_ptr<StructureStubClearingWatchpoint>> is enough.
Saam Barati
Comment 4 2018-08-31 11:44:48 PDT
Comment on attachment 348502 [details] Patch Maybe the linked list uses less memory on average for common programs?
Yusuke Suzuki
Comment 5 2018-08-31 23:16:23 PDT
(In reply to Saam Barati from comment #4) > Comment on attachment 348502 [details] > Patch > > Maybe the linked list uses less memory on average for common programs? In the Vector<> case, we can drop a link in StructureStubClearingWatchpoint instead of allocating storage for Vector. The memory consumption is so-so, larger in Vector case due to unused memory allocation for storages, or larger in linked-list case due to the representation of the enlarged objects in bmalloc (it depends on whether the given object size would fit to the bmalloc's segregated heap). We can use Bag<> here, it does not change memory usage. Changed.
Yusuke Suzuki
Comment 6 2018-08-31 23:19:50 PDT
(In reply to Yusuke Suzuki from comment #5) > (In reply to Saam Barati from comment #4) > > Comment on attachment 348502 [details] > > Patch > > > > Maybe the linked list uses less memory on average for common programs? > > In the Vector<> case, we can drop a link in StructureStubClearingWatchpoint > instead of allocating storage for Vector. > The memory consumption is so-so, larger in Vector case due to unused memory > allocation for storages, or larger in linked-list case due to the > representation of the enlarged objects in bmalloc (it depends on whether the > given object size would fit to the bmalloc's segregated heap). > We can use Bag<> here, it does not change memory usage. Changed. If allocations of this watchpoint in this vector/bag is so many, SegmentedVector<> can improve memory usage more. In the meantime, I'll use bag.
Yusuke Suzuki
Comment 7 2018-08-31 23:20:12 PDT
Yusuke Suzuki
Comment 8 2018-09-06 12:00:47 PDT
Ping?
Saam Barati
Comment 9 2018-09-06 12:50:21 PDT
Comment on attachment 348708 [details] Patch r=me
Yusuke Suzuki
Comment 10 2018-09-06 21:23:55 PDT
(In reply to Saam Barati from comment #9) > Comment on attachment 348708 [details] > Patch > > r=me Thanks!
Yusuke Suzuki
Comment 11 2018-09-06 21:24:24 PDT
Radar WebKit Bug Importer
Comment 12 2018-09-06 21:25:32 PDT
Note You need to log in before you can comment on or make changes to this bug.