Bug 220718

Summary: [JSC] FTL::prepareOSREntry can clear OSR entry CodeBlock if it is already invalidated
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: New BugsAssignee: 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   
Attachments:
Description Flags
Patch
none
Patch none

Yusuke Suzuki
Reported 2021-01-18 17:19:01 PST
[JSC] FTL::prepareOSREntry can clear OSR entry CodeBlock if it is already invalidated
Attachments
Patch (5.41 KB, patch)
2021-01-18 17:20 PST, Yusuke Suzuki
no flags
Patch (4.67 KB, patch)
2021-01-18 17:21 PST, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2021-01-18 17:20:39 PST
Yusuke Suzuki
Comment 2 2021-01-18 17:20:42 PST
Yusuke Suzuki
Comment 3 2021-01-18 17:21:48 PST
Mark Lam
Comment 4 2021-01-18 19:53:26 PST
Comment on attachment 417854 [details] Patch r=mer
EWS
Comment 5 2021-01-18 21:00:00 PST
Committed r271596: <https://trac.webkit.org/changeset/271596> All reviewed patches have been landed. Closing bug and clearing flags on attachment 417854 [details].
Michael Catanzaro
Comment 6 2021-01-19 10:43:42 PST
This introduced: [621/2299] Building CXX object Source/JavaScriptCore/CMak...criptCore/unified-sources/UnifiedSource-bfc896e1-12.cpp.o In file included from DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-bfc896e1-12.cpp:5: ../../Source/JavaScriptCore/dfg/DFGOperations.cpp: In function ‘char* JSC::DFG::tierUpCommon(JSC::VM&, JSC::CallFrame*, JSC::BytecodeIndex, bool)’: ../../Source/JavaScriptCore/dfg/DFGOperations.cpp:3861:20: warning: unused variable ‘entryBlock’ [-Wunused-variable] 3861 | if (CodeBlock* entryBlock = jitCode->osrEntryBlock()) { | ^~~~~~~~~~ I'm not sure if this trivial fix would be correct: diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp index 85e74d17ece6..45fdcb24f68c 100644 --- a/Source/JavaScriptCore/dfg/DFGOperations.cpp +++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp @@ -3858,7 +3858,7 @@ static char* tierUpCommon(VM& vm, CallFrame* callFrame, BytecodeIndex originByte } else CODEBLOCK_LOG_EVENT(codeBlock, "delayFTLCompile", ("avoiding replacement compile")); - if (CodeBlock* entryBlock = jitCode->osrEntryBlock()) { + if (jitCode->osrEntryBlock()) { if (jitCode->osrEntryRetry < Options::ftlOSREntryRetryThreshold()) { CODEBLOCK_LOG_EVENT(codeBlock, "delayFTLCompile", ("OSR entry failed, OSR entry threshold not met")); jitCode->osrEntryRetry++; Maybe that condition is no longer needed at all now?
Yusuke Suzuki
Comment 7 2021-01-19 15:25:27 PST
(In reply to Michael Catanzaro from comment #6) > This introduced: > > [621/2299] Building CXX object > Source/JavaScriptCore/CMak...criptCore/unified-sources/UnifiedSource- > bfc896e1-12.cpp.o > In file included from > DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-bfc896e1-12.cpp: > 5: > ../../Source/JavaScriptCore/dfg/DFGOperations.cpp: In function ‘char* > JSC::DFG::tierUpCommon(JSC::VM&, JSC::CallFrame*, JSC::BytecodeIndex, bool)’: > ../../Source/JavaScriptCore/dfg/DFGOperations.cpp:3861:20: warning: unused > variable ‘entryBlock’ [-Wunused-variable] > 3861 | if (CodeBlock* entryBlock = jitCode->osrEntryBlock()) { > | ^~~~~~~~~~ > > I'm not sure if this trivial fix would be correct: > > diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp > b/Source/JavaScriptCore/dfg/DFGOperations.cpp > index 85e74d17ece6..45fdcb24f68c 100644 > --- a/Source/JavaScriptCore/dfg/DFGOperations.cpp > +++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp > @@ -3858,7 +3858,7 @@ static char* tierUpCommon(VM& vm, CallFrame* > callFrame, BytecodeIndex originByte > } else > CODEBLOCK_LOG_EVENT(codeBlock, "delayFTLCompile", ("avoiding > replacement compile")); > > - if (CodeBlock* entryBlock = jitCode->osrEntryBlock()) { > + if (jitCode->osrEntryBlock()) { > if (jitCode->osrEntryRetry < Options::ftlOSREntryRetryThreshold()) { > CODEBLOCK_LOG_EVENT(codeBlock, "delayFTLCompile", ("OSR entry > failed, OSR entry threshold not met")); > jitCode->osrEntryRetry++; > > Maybe that condition is no longer needed at all now? That condition is required. if (jitCode->osrEntryBlock()) { is the right change. I'll land it as an unreviewed patch.
Yusuke Suzuki
Comment 8 2021-01-19 15:27:15 PST
Note You need to log in before you can comment on or make changes to this bug.