// Load store elimination used to remove the InstanceFieldSet, thinking // that the UnresolvedInstanceFieldGet was not related. However inlining // can put you in a situation where the UnresolvedInstanceFieldGet resolves // to the same field as the one in InstanceFieldSet. So the InstanceFieldSet // must be preserved.
// Load store elimination will eliminate the first InstanceFieldGet because // it simply follows an InstanceFieldSet. It must however not eliminate the second // InstanceFieldGet, as the UnresolvedInstanceFieldSet might resolve to the same // field.
/// CHECK-START: void Main.instanceFieldTest2() load_store_elimination (after) /// CHECK: InstanceFieldSet /// CHECK-NOT: InstanceFieldGet /// CHECK: UnresolvedInstanceFieldSet /// CHECK: InstanceFieldGet publicstaticvoid instanceFieldTest2() {
SubFoo sf = new SubFoo();
Foo f = sf;
f.iField = 42; int a = f.iField;
sf.iField = 43;
a = f.iField; if (a != 43) { thrownew Error("Expected 43, got " + a);
}
}
class Foo { publicint iField; publicstaticint sField;
}
// We make SubFoo implement an unresolved interface, so the SubFoo // shall be unresolved and all field accesses through SubFoo shall // yield unresolved field access HIR. class SubFoo extends Foo implements MissingInterface {
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.