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
The VM potentially skips some method invocations #44342
Comments
//cc @crelier @alexmarkov |
I modified the repro in
I kept the prints to identify which version of
The first 2 calls are always made to I did not look at the code emitted for the string interpolation, but the issue must hide in there. |
FWIW, I used |
If I do not apply your patch, but add this code instead, the test fails when run without any optimizations (i.e using
The test prints:
I assume that it is the correct behavior, since you write that the test is a false positive and should be failing. Now, if I let optimizations kick in, the code throws The optimized graph looks like this:
I do not think inlining or CHA are the culprits. However, you can see that the first call to Not being familiar with our various code optimization passes, I cannot point to the bug or where things go wrong. Maybe @alexmarkov can have a look? |
The first optimized version of Later, constant instance of class The problem is that Small repro: class A {
const A();
void foo() {
}
void bar() {
foo();
}
}
class B extends A {
}
class C extends A {
const C();
void foo() {
print('OK');
}
}
A x = B();
A y = const C();
main(List<String> args) {
for (int i = 0; i < 30000; ++i) {
x.bar(); // Optimize A.bar() with inlined A.foo().
}
y.bar(); // Should print 'OK'.
} The correct behavior of this example is to print Finalization of classes of constants was broken in b387ebc (it worked at previous revision ba459f9). @aam |
Thanks for fixing the bug! |
Steps to reproduce:
out/ReleaseX64/dart pkg/front_end/test/fasta/type_inference/type_schema_environment_nnbd_test.dart
.pkg/kernel/lib/src/replacement_visitor.dart
, methodvisitInterfaceType
(close to line 135).It seems that the invocation of
visitNullability
is skipped when not present in the debug output.The text was updated successfully, but these errors were encountered: