privatestaticint willInline(int a, int b) { return a & b;
}
staticint[] a = newint[4]; staticint field = 42;
publicstaticvoid main(String[] args) throws Exception { // The order of optimizations that would lead to the problem was: // 1) Inlining of `willInline`. // 2) Bounds check elimination inserting a deopt at a[0] and removing the HBoundsCheck. // 3) Instruction simplifier simpilifying the inlined willInline to just `field`. // // At this point, if the environment of the HDeoptimization instruction was // just a pointer to the one in a[0], the uses lists would have not been updated // and the HBoundsCheck being dead code after the HDeoptimization, the simplifcation // at step 3) would not updated that environment. int inEnv = willInline(field, field); int doAdds = a[0] + a[1] + a[2] + a[3];
if (inEnv != 42) { thrownew Error("Expected 42");
}
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.