Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 508a9fa

Browse files
johnniwinthercommit-bot@chromium.org
authored andcommitted
Work-around called-once imprecision
This avoids (yet another) inconsistency from the imprecision of called once. In this case the inlining of some methods that are called once is dependent on whether we meet their call-site directly or indirectly first, effectively making the inlining decision subject to the enqueuing order. Change-Id: I8d6b9c18fdb82f6d1b566e6bb58344211678daf2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103631 Reviewed-by: Sigmund Cherem <[email protected]>
1 parent bd07889 commit 508a9fa

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pkg/compiler/lib/src/js_model/js_strategy.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,6 @@ class KernelSsaBuilder implements SsaBuilder {
218218
final JsToElementMap _elementMap;
219219
final SourceInformationStrategy _sourceInformationStrategy;
220220

221-
// TODO(johnniwinther,sra): Inlining decisions should not be based on the
222-
// order in which ssa graphs are built.
223221
FunctionInlineCache _inlineCache;
224222

225223
KernelSsaBuilder(this._task, this._options, this._reporter,

pkg/compiler/lib/src/ssa/builder_kernel.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5711,7 +5711,12 @@ class KernelSsaGraphBuilder extends ir.Visitor {
57115711
if (canInline) {
57125712
_inlineCache.markAsInlinable(function, insideLoop: insideLoop);
57135713
} else {
5714-
_inlineCache.markAsNonInlinable(function, insideLoop: insideLoop);
5714+
if (_isFunctionCalledOnce(function)) {
5715+
// TODO(34203): We can't update the decision due to imprecision in
5716+
// the calledOnce data, described in Issue 34203.
5717+
} else {
5718+
_inlineCache.markAsNonInlinable(function, insideLoop: insideLoop);
5719+
}
57155720
}
57165721
}
57175722
return canInline;

0 commit comments

Comments
 (0)