Bug 204149

Summary: [JSC] BlockDirectory's bits should be compact
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, benjamin, cdumez, cmarcelo, dbates, ews-watchlist, gyuyoung.kim, keith_miller, mark.lam, msaboff, rmorisset, ryuan.choi, saam, sergio, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch rmorisset: review+

Yusuke Suzuki
Reported 2019-11-13 02:26:05 PST
...
Attachments
Patch (22.95 KB, patch)
2019-11-13 02:30 PST, Yusuke Suzuki
no flags
Patch (27.02 KB, patch)
2019-11-13 02:55 PST, Yusuke Suzuki
no flags
Patch (28.21 KB, patch)
2019-11-13 03:03 PST, Yusuke Suzuki
no flags
Patch (28.04 KB, patch)
2019-11-13 03:15 PST, Yusuke Suzuki
no flags
Patch (28.06 KB, patch)
2019-11-13 03:23 PST, Yusuke Suzuki
no flags
Patch (48.26 KB, patch)
2019-11-13 13:53 PST, Yusuke Suzuki
no flags
Patch (50.78 KB, patch)
2019-11-13 14:12 PST, Yusuke Suzuki
no flags
Patch (58.24 KB, patch)
2019-11-13 14:52 PST, Yusuke Suzuki
no flags
Patch (58.67 KB, patch)
2019-11-13 16:02 PST, Yusuke Suzuki
no flags
Patch (60.48 KB, patch)
2019-11-13 16:31 PST, Yusuke Suzuki
no flags
Patch (60.48 KB, patch)
2019-11-13 16:49 PST, Yusuke Suzuki
no flags
Patch (60.57 KB, patch)
2019-11-13 16:56 PST, Yusuke Suzuki
no flags
Patch (61.74 KB, patch)
2019-11-13 17:03 PST, Yusuke Suzuki
no flags
Patch (62.20 KB, patch)
2019-11-13 17:14 PST, Yusuke Suzuki
no flags
Patch (63.71 KB, patch)
2019-11-13 17:49 PST, Yusuke Suzuki
no flags
Patch (63.72 KB, patch)
2019-11-13 18:01 PST, Yusuke Suzuki
rmorisset: review+
Yusuke Suzuki
Comment 1 2019-11-13 02:30:18 PST
Yusuke Suzuki
Comment 2 2019-11-13 02:55:36 PST
Yusuke Suzuki
Comment 3 2019-11-13 03:03:25 PST
Yusuke Suzuki
Comment 4 2019-11-13 03:15:58 PST
Yusuke Suzuki
Comment 5 2019-11-13 03:23:19 PST
Mark Lam
Comment 6 2019-11-13 09:39:29 PST
Comment on attachment 383447 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383447&action=review > Source/JavaScriptCore/heap/BlockDirectory.cpp:351 > + [&] (auto, const char* name) { Are you intentionally passing by value here?
Yusuke Suzuki
Comment 7 2019-11-13 12:35:08 PST
Comment on attachment 383447 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383447&action=review >> Source/JavaScriptCore/heap/BlockDirectory.cpp:351 >> + [&] (auto, const char* name) { > > Are you intentionally passing by value here? Yes, this should be BlockDirectoryBitVectorRef. But I'm planning to change this to BlockDirectoryBitVectorRef to make it explicit.
Yusuke Suzuki
Comment 8 2019-11-13 12:51:06 PST
Comment on attachment 383447 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383447&action=review >>> Source/JavaScriptCore/heap/BlockDirectory.cpp:351 >>> + [&] (auto, const char* name) { >> >> Are you intentionally passing by value here? > > Yes, this should be BlockDirectoryBitVectorRef. But I'm planning to change this to BlockDirectoryBitVectorRef to make it explicit. Ah, we cannot. Each bitvector has different type.
Yusuke Suzuki
Comment 9 2019-11-13 13:53:31 PST
Created attachment 383492 [details] Patch WIP
Yusuke Suzuki
Comment 10 2019-11-13 14:12:05 PST
Created attachment 383495 [details] Patch WIP
Yusuke Suzuki
Comment 11 2019-11-13 14:52:40 PST
Created attachment 383500 [details] Patch WIP
Yusuke Suzuki
Comment 12 2019-11-13 16:02:13 PST
Yusuke Suzuki
Comment 13 2019-11-13 16:31:11 PST
Created attachment 383514 [details] Patch WIP
Yusuke Suzuki
Comment 14 2019-11-13 16:49:36 PST
Yusuke Suzuki
Comment 15 2019-11-13 16:56:12 PST
Yusuke Suzuki
Comment 16 2019-11-13 17:03:06 PST
Yusuke Suzuki
Comment 17 2019-11-13 17:14:01 PST
Yusuke Suzuki
Comment 18 2019-11-13 17:49:43 PST
Yusuke Suzuki
Comment 19 2019-11-13 18:01:42 PST
Robin Morisset
Comment 20 2019-11-13 18:36:59 PST
Comment on attachment 383532 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383532&action=review r=me > Source/JavaScriptCore/heap/BlockDirectoryBits.h:156 > + for (unsigned i = BlockDirectoryBitVectorView<kind>::arrayLength(); i--;) Is there a reason for the previous function using Base::arrayLength() while this one is using BlockDirectoryBitVectorView<kind>::arrayLength() ? > Source/JavaScriptCore/heap/BlockDirectoryBits.h:191 > + BlockDirectoryBitVectorRef<Kind::capitalBitName> lowerBitName() \ I don't think this function is useful as long as you have the one above. Either delete it, or make it return a const BlockDirectoryBitVectorRef<Kind::capitalBitName>
Yusuke Suzuki
Comment 21 2019-11-13 19:00:42 PST
Comment on attachment 383532 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383532&action=review Thanks! >> Source/JavaScriptCore/heap/BlockDirectoryBits.h:156 >> + for (unsigned i = BlockDirectoryBitVectorView<kind>::arrayLength(); i--;) > > Is there a reason for the previous function using Base::arrayLength() while this one is using BlockDirectoryBitVectorView<kind>::arrayLength() ? No reason. Thanks, fixed. >> Source/JavaScriptCore/heap/BlockDirectoryBits.h:191 >> + BlockDirectoryBitVectorRef<Kind::capitalBitName> lowerBitName() \ > > I don't think this function is useful as long as you have the one above. > Either delete it, or make it return a const BlockDirectoryBitVectorRef<Kind::capitalBitName> Yeah, removing View version, since Ref one is used to modify the bits.
Yusuke Suzuki
Comment 22 2019-11-13 19:08:07 PST
Comment on attachment 383532 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383532&action=review >>> Source/JavaScriptCore/heap/BlockDirectoryBits.h:191 >>> + BlockDirectoryBitVectorRef<Kind::capitalBitName> lowerBitName() \ >> >> I don't think this function is useful as long as you have the one above. >> Either delete it, or make it return a const BlockDirectoryBitVectorRef<Kind::capitalBitName> > > Yeah, removing View version, since Ref one is used to modify the bits. I tried removing this but it brings much complexity like implementing `bool operator[] const`. For now, I'll just keep it since it just works anyway :)
Yusuke Suzuki
Comment 23 2019-11-14 01:37:16 PST
Radar WebKit Bug Importer
Comment 24 2019-11-14 01:38:17 PST
Note You need to log in before you can comment on or make changes to this bug.