Skip to content

Commit 8e8cccb

Browse files
committed
[JSC] PutStackSinking should run only when ArgumentsElimination did some job
https://bugs.webkit.org/show_bug.cgi?id=328249 rdar://190551802 Reviewed by Keith Miller. PutStackSinking is running twice just to catch ArgumentsElimination's new PutStacks. First one makes ArgumentsElimination encouraged, and ArgumentsElimination generates PutStacks and then next PutStackSinking does further sinking. But the second run is meaningless if ArgumentsElimination did nothing. This patch skips the second PutStackSinking when ArgumentsElimination didn't change anything. * Source/JavaScriptCore/dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): Canonical link: https://commits.webkit.org/324298@main
1 parent d68d875 commit 8e8cccb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎Source/JavaScriptCore/dfg/DFGPlan.cpp‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,13 @@ Plan::CompilationPath Plan::compileInThreadImpl()
379379
// Ideally, these would be run to fixpoint with the object allocation sinking phase.
380380
if (Options::usePutStackSinking())
381381
RUN_PHASE(performPutStackSinking);
382+
changed = false;
382383
RUN_PHASE(performArgumentsElimination);
383-
if (Options::usePutStackSinking())
384-
RUN_PHASE(performPutStackSinking);
384+
// Only run if performArgumentsElimination did something.
385+
if (changed) {
386+
if (Options::usePutStackSinking())
387+
RUN_PHASE(performPutStackSinking);
388+
}
385389

386390
RUN_PHASE(performConstantHoisting);
387391
RUN_PHASE(performGlobalCSE);

0 commit comments

Comments
 (0)