Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
CodeBlock should have a more explicit "strongly referenced" state
https://bugs.webkit.org/show_bug.cgi?id=148714 Reviewed by Filip Pizlo. Previously, CodeBlock had a "may be executing" bit, which was used by both the stack visitor and the compiler to indicate "this CodeBlock must not jettison itself". Now, CodeBlock has an explicit "is strongly referenced" bit to do the same. For now, there is no behavior change. In future, I will use the "is strongly referenced" bit to indicate the set of all references that cause a CodeBlock not to jettison itself. Strong references and stack references will be different because: (1) A stack reference requires a write barrier at the end of GC (since CodeBlocks only barrier themselves on function entry, and GC will clear that barrier); but a strong reference does not need or want a write barrier at the end of GC. (2) Visiting more heap objects might reveal more strong references but, by definition, it cannot reveal more stack references. Also, this patch adds an explicit mark clearing phase for compiler CodeBlocks, which does the work that would normally be done by a write barrier. A compiler CodeBlock can't rely on a normal write barrier because the compiler writes to CodeBlocks without invoking a write barrier, and because the CodeBlock write barrier operates on an executable, but an in-flight compilation is not pointed to by any executable. This bug does not appear to be noticeable in the current system, but I will probably make it noticeable. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::CodeBlock::shouldImmediatelyAssumeLivenessDuringScan): (JSC::CodeBlock::isKnownToBeLiveDuringGC): * bytecode/CodeBlock.h: (JSC::ExecState::uncheckedR): (JSC::CodeBlockSet::clearMarks): (JSC::CodeBlockSet::mark): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::key): (JSC::DFG::Plan::clearCodeBlockMarks): (JSC::DFG::Plan::checkLivenessAndVisitChildren): * dfg/DFGPlan.h: * dfg/DFGWorklist.cpp: (JSC::DFG::Worklist::completeAllPlansForVM): (JSC::DFG::Worklist::clearCodeBlockMarks): (JSC::DFG::Worklist::suspendAllThreads): (JSC::DFG::Worklist::visitWeakReferences): (JSC::DFG::completeAllPlansForVM): (JSC::DFG::clearCodeBlockMarks): * dfg/DFGWorklist.h: (JSC::DFG::worklistForIndexOrNull): * heap/CodeBlockSet.cpp: (JSC::CodeBlockSet::clearMarksForFullCollection): (JSC::CodeBlockSet::clearMarksForEdenCollection): (JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced): (JSC::CodeBlockSet::traceMarked): (JSC::CodeBlockSet::rememberCurrentlyExecutingCodeBlocks): * heap/CodeBlockSet.h: * heap/Heap.cpp: (JSC::Heap::markRoots): Canonical link: https://commits.webkit.org/166835@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
586a41e
commit 09630dbfcc1c0312b1dc9e4af6f93dcbef98aca0
Showing
10 changed files
with
137 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters