Bug 238535

Summary: [JSC] Store CodeBlock in caller side
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, mark.lam, mcatanzaro, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=238956
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
saam: review+
Patch
none
Patch none

Yusuke Suzuki
Reported 2022-03-29 20:12:43 PDT
Let's not store it in the callee side since the caller typically already knows well about it. It makes unlinked code simpler.
Attachments
Patch (43.71 KB, patch)
2022-03-29 20:21 PDT, Yusuke Suzuki
no flags
Patch (47.64 KB, patch)
2022-03-30 02:14 PDT, Yusuke Suzuki
no flags
Patch (47.52 KB, patch)
2022-03-30 03:47 PDT, Yusuke Suzuki
no flags
Patch (47.58 KB, patch)
2022-03-30 11:29 PDT, Yusuke Suzuki
no flags
Patch (53.22 KB, patch)
2022-03-30 14:44 PDT, Yusuke Suzuki
no flags
Patch (53.25 KB, patch)
2022-03-30 19:03 PDT, Yusuke Suzuki
no flags
Patch (53.24 KB, patch)
2022-03-30 21:14 PDT, Yusuke Suzuki
no flags
Patch (60.64 KB, patch)
2022-03-31 18:29 PDT, Yusuke Suzuki
ews-feeder: commit-queue-
Patch (60.65 KB, patch)
2022-03-31 19:02 PDT, Yusuke Suzuki
no flags
Patch (71.14 KB, patch)
2022-03-31 20:39 PDT, Yusuke Suzuki
no flags
Patch (72.68 KB, patch)
2022-03-31 23:27 PDT, Yusuke Suzuki
no flags
Patch (70.58 KB, patch)
2022-04-01 13:24 PDT, Yusuke Suzuki
no flags
Patch (71.04 KB, patch)
2022-04-01 22:35 PDT, Yusuke Suzuki
no flags
Patch (73.04 KB, patch)
2022-04-04 15:37 PDT, Yusuke Suzuki
saam: review+
Patch (72.71 KB, patch)
2022-04-04 19:14 PDT, Yusuke Suzuki
no flags
Patch (72.65 KB, patch)
2022-04-04 20:19 PDT, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2022-03-29 20:21:36 PDT
Yusuke Suzuki
Comment 2 2022-03-30 02:14:29 PDT
Yusuke Suzuki
Comment 3 2022-03-30 03:47:21 PDT
Yusuke Suzuki
Comment 4 2022-03-30 11:29:01 PDT
Yusuke Suzuki
Comment 5 2022-03-30 14:44:48 PDT
Yusuke Suzuki
Comment 6 2022-03-30 19:03:52 PDT
Yusuke Suzuki
Comment 7 2022-03-30 21:14:26 PDT
Yusuke Suzuki
Comment 8 2022-03-31 18:29:43 PDT
Yusuke Suzuki
Comment 9 2022-03-31 19:02:13 PDT
Yusuke Suzuki
Comment 10 2022-03-31 20:39:23 PDT
Yusuke Suzuki
Comment 11 2022-03-31 23:27:24 PDT
Yusuke Suzuki
Comment 12 2022-04-01 13:24:14 PDT
Yusuke Suzuki
Comment 13 2022-04-01 22:35:06 PDT
Yusuke Suzuki
Comment 14 2022-04-04 15:37:02 PDT
Saam Barati
Comment 15 2022-04-04 18:39:01 PDT
Comment on attachment 456642 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456642&action=review r=me > Source/JavaScriptCore/ChangeLog:9 > + This helps unlinked Baseline and DFG since we no longer need to load CodeBlock from callee via costly dependent loads: unlinked ones and LLInt > Source/JavaScriptCore/jit/JIT.cpp:754 > +#if ASSERT_ENABLED > + probeDebug([=](Probe::Context& ctx) { > + CodeBlock* codeBlock = ctx.fp<CallFrame*>()->codeBlock(); > + if (codeBlock->jitType() != JITType::BaselineJIT) { > + dataLogLn("FP ", RawPointer(ctx.fp<CallFrame*>())); > + RELEASE_ASSERT_NOT_REACHED(); > + } > + }); > +#endif Why do we only do this release assert for function code? It should always be correct. Same for DFG/FTL > Source/JavaScriptCore/runtime/FunctionExecutable.h:302 > + return 0; can you RELEASE_ASSERT_NOT_REACHED here?
Saam Barati
Comment 16 2022-04-04 18:39:56 PDT
Comment on attachment 456642 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456642&action=review >> Source/JavaScriptCore/jit/JIT.cpp:754 >> +#endif > > Why do we only do this release assert for function code? It should always be correct. Same for DFG/FTL My unlinked baseline patch might've done things this way. But I think it's worth doing always.
Yusuke Suzuki
Comment 17 2022-04-04 19:11:53 PDT
Comment on attachment 456642 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=456642&action=review Thank you! >> Source/JavaScriptCore/ChangeLog:9 >> + This helps unlinked Baseline and DFG since we no longer need to load CodeBlock from callee via costly dependent loads: unlinked ones > > and LLInt Fixed. >>> Source/JavaScriptCore/jit/JIT.cpp:754 >>> +#endif >> >> Why do we only do this release assert for function code? It should always be correct. Same for DFG/FTL > > My unlinked baseline patch might've done things this way. But I think it's worth doing always. Sounds good! Changed. >> Source/JavaScriptCore/runtime/FunctionExecutable.h:302 >> + return 0; > > can you RELEASE_ASSERT_NOT_REACHED here? Nice, fixed.
Yusuke Suzuki
Comment 18 2022-04-04 19:14:14 PDT
Yusuke Suzuki
Comment 19 2022-04-04 20:19:49 PDT
Yusuke Suzuki
Comment 20 2022-04-04 21:10:49 PDT
Radar WebKit Bug Importer
Comment 21 2022-04-04 21:11:18 PDT
Michael Catanzaro
Comment 22 2022-04-07 13:20:18 PDT
This broke s390x, see bug #238956
Note You need to log in before you can comment on or make changes to this bug.