Skip to content

Commit 72963bf

Browse files
mkustermannCommit Queue
authored andcommitted
[dart2wasm] Fix inlining issue after introducing unchecked entrypoints
The dart2wasm compiler has a very crude way of avoiding recursive inlining: It checks whether the target to be called is currently in the inlining stack. Though it does so based on [Member]s instead of [Reference]s or other abstraction. Make the recursive inlining detection not check when it's about to consider the body function for inlining, as the recursion detection is sufficient for the checked/unchecked entry functions. => This recovers some regressions accidentally introduced when splitting functions into checked/unchecked entry functions that call body functions. Change-Id: Ic32a8ac93edbda8c8be4eae0c5e416c4ea9bc3fe Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408181 Commit-Queue: Martin Kustermann <[email protected]> Reviewed-by: Ömer Ağacan <[email protected]>
1 parent e05a423 commit 72963bf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/dart2wasm/lib/translator.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,10 +1520,16 @@ class Translator with KernelNodes {
15201520
if (membersContainingInnerFunctions.contains(member)) return false;
15211521
if (membersBeingGenerated.contains(member)) {
15221522
// Guard against recursive inlining.
1523+
//
15231524
// Though we allow inlining calls to constructor initializer & body
15241525
// functions while generating the constructor.
1526+
//
1527+
// We also allow inlining calls to the member body functions as any
1528+
// recursive inlining would call to checked or unchecked entry which would
1529+
// disallow it.
15251530
if (!target.isInitializerReference &&
1526-
!target.isConstructorBodyReference) {
1531+
!target.isConstructorBodyReference &&
1532+
!target.isBodyReference) {
15271533
return false;
15281534
}
15291535
}

0 commit comments

Comments
 (0)