RESOLVED FIXED 230357
Improve access case printing and show inline capacity for structures
https://bugs.webkit.org/show_bug.cgi?id=230357
Summary Improve access case printing and show inline capacity for structures
Justin Michaud
Reported 2021-09-16 10:02:01 PDT
Improve access case printing and show inline capacity for structures
Attachments
Patch (12.07 KB, patch)
2021-09-16 10:03 PDT, Justin Michaud
ews-feeder: commit-queue-
How it looks (88.37 KB, image/png)
2021-09-16 10:07 PDT, Justin Michaud
no flags
Patch (12.10 KB, patch)
2021-09-16 10:25 PDT, Justin Michaud
no flags
Patch (12.06 KB, patch)
2021-09-16 16:05 PDT, Justin Michaud
ews-feeder: commit-queue-
Patch (12.10 KB, patch)
2021-09-16 16:31 PDT, Justin Michaud
no flags
Patch (11.53 KB, patch)
2021-09-16 16:47 PDT, Justin Michaud
no flags
Patch (10.74 KB, patch)
2021-09-16 16:51 PDT, Justin Michaud
no flags
Justin Michaud
Comment 1 2021-09-16 10:03:41 PDT
Justin Michaud
Comment 2 2021-09-16 10:06:13 PDT
Comment on attachment 438361 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=438361&action=review > Source/JavaScriptCore/heap/Heap.cpp:1497 > if (UNLIKELY(m_verifier)) { This is better because the gc verifier crashes before you see the heap verifier output
Justin Michaud
Comment 3 2021-09-16 10:07:06 PDT
Created attachment 438363 [details] How it looks ^ how it looks
Justin Michaud
Comment 4 2021-09-16 10:25:45 PDT
Justin Michaud
Comment 5 2021-09-16 16:05:50 PDT
Justin Michaud
Comment 6 2021-09-16 16:31:05 PDT
Saam Barati
Comment 7 2021-09-16 16:39:13 PDT
Comment on attachment 438416 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=438416&action=review > Source/JavaScriptCore/runtime/Structure.cpp:1327 > + "/", (uint32_t)(reinterpret_cast<uintptr_t>(sid)), ", ", I feel like "(uint32_t)(reinterpret_cast<uintptr_t>(sid))" can just be "id()" :-) I think that reinterpret_cast is just there to print as hex? Which is kinda silly. We should eventually just make a hex printer that doesn't require a pointer. Also, do we really need to print the structure id int both as hex and as base 10?
Yusuke Suzuki
Comment 8 2021-09-16 16:39:41 PDT
Comment on attachment 438416 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=438416&action=review > Source/JavaScriptCore/runtime/JSCJSValue.cpp:309 > + out.print("Symbol: ", RawPointer(asCell()), " (", jsCast<Symbol*>(asCell())->description(), ")"); Symbol::description returns String held by Symbol. So, this function is not safe to be called concurrently. Since dump can be called concurrently (e.g. from DFG compiler thread), we cannot use it. >> Source/JavaScriptCore/runtime/Structure.cpp:1327 >> + auto* sid = reinterpret_cast<void*>(id()); >> + out.print(RawPointer(this), ":[", RawPointer(sid), >> + "/", (uint32_t)(reinterpret_cast<uintptr_t>(sid)), ", ", > > I feel like "(uint32_t)(reinterpret_cast<uintptr_t>(sid))" can just be "id()" :-) > > I think that reinterpret_cast is just there to print as hex? Which is kinda silly. We should eventually just make a hex printer that doesn't require a pointer. > > Also, do we really need to print the structure id int both as hex and as base 10? What is the difference between sid and this reinterpret_casted sid?
Saam Barati
Comment 9 2021-09-16 16:40:34 PDT
Comment on attachment 438416 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=438416&action=review >>> Source/JavaScriptCore/runtime/Structure.cpp:1327 >>> + "/", (uint32_t)(reinterpret_cast<uintptr_t>(sid)), ", ", >> >> I feel like "(uint32_t)(reinterpret_cast<uintptr_t>(sid))" can just be "id()" :-) >> >> I think that reinterpret_cast is just there to print as hex? Which is kinda silly. We should eventually just make a hex printer that doesn't require a pointer. >> >> Also, do we really need to print the structure id int both as hex and as base 10? > > What is the difference between sid and this reinterpret_casted sid? actually, I don't really mind printing it both as hex/base 10. I'll leave it up to you what to do. My preference might actually be base 10 only.
Justin Michaud
Comment 10 2021-09-16 16:42:56 PDT
> I feel like "(uint32_t)(reinterpret_cast<uintptr_t>(sid))" can just be > "id()" :-) I thought that too, but it fails on 32 bit because it is actually a Structure* there. > > I think that reinterpret_cast is just there to print as hex? Which is kinda > silly. We should eventually just make a hex printer that doesn't require a > pointer. yeah > Also, do we really need to print the structure id int both as hex and as > base 10? We don't *need* to, but I found it helpful because we sometimes print our literals in the assembly code as decimal. We use all three, (hex id, pointer, decimal), it sucks. > What is the difference between sid and this reinterpret_casted sid? base 10 / 16
Justin Michaud
Comment 11 2021-09-16 16:47:04 PDT
Mark Lam
Comment 12 2021-09-16 16:48:05 PDT
Comment on attachment 438416 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=438416&action=review > Source/JavaScriptCore/heap/Heap.cpp:1501 > - if (UNLIKELY(Options::verifyGC())) > - verifyGC(); > - > if (UNLIKELY(m_verifier)) { > m_verifier->gatherLiveCells(HeapVerifier::Phase::AfterMarking); > m_verifier->verify(HeapVerifier::Phase::AfterMarking); > } > > + if (UNLIKELY(Options::verifyGC())) > + verifyGC(); > + You should do this change in a separate patch. It's unrelated, and seems random that it should be included here. The ChangeLog also makes no mention of it. > Source/JavaScriptCore/runtime/Structure.cpp:1325 > + auto* sid = reinterpret_cast<void*>(id()); Let's call this structureID to make it clear what it is. > Source/JavaScriptCore/runtime/Structure.cpp:1329 > + outOfLineSize(), "/", outOfLineCapacity(), "){"); nit: space between ) and { ?
Justin Michaud
Comment 13 2021-09-16 16:51:55 PDT
Justin Michaud
Comment 14 2021-09-16 16:53:08 PDT
(In reply to Mark Lam from comment #12) > Comment on attachment 438416 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=438416&action=review > > > Source/JavaScriptCore/heap/Heap.cpp:1501 > > - if (UNLIKELY(Options::verifyGC())) > > - verifyGC(); > > - > > if (UNLIKELY(m_verifier)) { > > m_verifier->gatherLiveCells(HeapVerifier::Phase::AfterMarking); > > m_verifier->verify(HeapVerifier::Phase::AfterMarking); > > } > > > > + if (UNLIKELY(Options::verifyGC())) > > + verifyGC(); > > + > > You should do this change in a separate patch. It's unrelated, and seems > random that it should be included here. The ChangeLog also makes no mention > of it. > > > Source/JavaScriptCore/runtime/Structure.cpp:1325 > > + auto* sid = reinterpret_cast<void*>(id()); > > Let's call this structureID to make it clear what it is. > > > Source/JavaScriptCore/runtime/Structure.cpp:1329 > > + outOfLineSize(), "/", outOfLineCapacity(), "){"); > > nit: space between ) and { ? done / done / intentional :)
EWS
Comment 15 2021-09-17 08:58:17 PDT
Committed r282664 (241805@main): <https://commits.webkit.org/241805@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 438420 [details].
Radar WebKit Bug Importer
Comment 16 2021-09-17 08:59:16 PDT
Note You need to log in before you can comment on or make changes to this bug.