-
Notifications
You must be signed in to change notification settings - Fork 49
DFG: stop rooting m_mustHandleValues from the concurrent compiler plan #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pin/4895f45d
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,6 +160,23 @@ | |
| ASSERT(m_vm); | ||
| if (m_recordedStatuses) | ||
| m_recordedStatuses->finalizeWithoutDeleting(*m_vm); | ||
|
|
||
| // m_mustHandleValues was snapshot from the triggering frame's live locals | ||
| // so the compiler can seed OSR-entry predictions. It is not a reason to | ||
| // keep those objects alive on its own: the DFG phases that read it all | ||
| // treat nullopt as "unknown", so any entry that nothing else marked can be | ||
| // dropped here (compiler threads are suspended for the duration of GC). | ||
| cleanMustHandleValuesIfNecessary(); | ||
| { | ||
| Locker locker { m_mustHandleValueCleaningLock }; | ||
| for (unsigned i = m_mustHandleValues.size(); i--;) { | ||
| std::optional<JSValue>& value = m_mustHandleValues[i]; | ||
| if (!value || !*value || !value->isCell()) | ||
| continue; | ||
| if (!m_vm->heap.isMarked(value->asCell())) | ||
| value = std::nullopt; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| void Plan::notifyReady() | ||
|
|
@@ -658,12 +675,13 @@ | |
| if (!Base::checkLivenessAndVisitChildren(visitor)) | ||
| return false; | ||
|
|
||
| // m_mustHandleValues is not visited here. It holds whatever JSValues were | ||
| // live in the frame at the tier-up point, purely to seed OSR-entry | ||
| // predictions; rooting them would keep arbitrary user objects alive for the | ||
| // life of a concurrent compile. finalizeInGC() nulls entries that nothing | ||
| // else marked, and every reader (PredictionInjection, CFA injectOSR, | ||
| // TypeCheckHoisting) already skips nullopt. | ||
| cleanMustHandleValuesIfNecessary(); | ||
|
Check warning on line 684 in Source/JavaScriptCore/dfg/DFGPlan.cpp
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 nit: now that Extended reasoning...What changedThe earlier review round noted that the Why it is now deadThere are exactly three call sites for
Site (3) no longer has a local consumer: nothing in Why it is harmless
Step-by-step walkthrough
Why it's worth mentioningThe call sits directly under a six-line comment whose thesis is " Suggested fixDelete the |
||
| for (unsigned i = m_mustHandleValues.size(); i--;) { | ||
| std::optional<JSValue> value = m_mustHandleValues[i]; | ||
| if (value) | ||
| visitor.appendUnbarriered(value.value()); | ||
| } | ||
|
|
||
| if (m_recordedStatuses) { | ||
| m_recordedStatuses->visitAggregate(visitor); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.