[dart2js] Temporarily disable inlining of methods with labeled statements

Bug: 51646
Bug: 51652
Change-Id: I3d7a722420a6ead288e19ed7a5fc017b32d6a545
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287300
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
Stephen Adams 2023-03-08 04:13:38 +00:00 committed by Commit Queue
parent 49a3fb4f96
commit 66e4f27384
2 changed files with 16 additions and 1 deletions

View file

@ -7149,6 +7149,7 @@ class InlineData {
bool hasArgumentDefaulting = false;
bool hasCast = false;
bool hasIf = false;
bool hasLabel = false; // TODO(51652): Remove when inlining works with labels.
List<int> argumentCounts = [];
int regularNodeCount = 0;
int callCount = 0;
@ -7178,6 +7179,7 @@ class InlineData {
regularNodeCount - 1 > maxInliningNodes) {
return 'too many nodes (${regularNodeCount - 1}>$maxInliningNodes)';
}
if (hasLabel) return 'has label';
return null;
}
@ -7213,6 +7215,7 @@ class InlineData {
} else if (isConstructor) {
return 'constructor';
}
if (hasLabel) return 'has label';
for (int count in argumentCounts) {
if (count > argumentCount) {
return 'increasing arguments';
@ -7298,6 +7301,11 @@ class InlineData {
sb.write('hasIf');
comma = ',';
}
if (hasLabel) {
sb.write(comma);
sb.write('hasLabel');
comma = ',';
}
if (argumentCounts.isNotEmpty) {
sb.write(comma);
sb.write('argumentCounts={${argumentCounts.join(',')}}');
@ -7593,6 +7601,13 @@ class InlineWeeder extends ir.Visitor<void> with ir.VisitorVoidMixin {
node.visitChildren(this);
}
@override
visitLabeledStatement(ir.LabeledStatement node) {
registerRegularNode();
data.hasLabel = true;
node.visitChildren(this);
}
@override
visitBlock(ir.Block node) {
registerRegularNode();

View file

@ -9,7 +9,7 @@ main() {
switchThrowing();
}
/*member: switchThrowing:[]*/
/*member: switchThrowing:has label*/
@pragma('dart2js:noInline')
switchThrowing() {
switch (0) {