publicclass Main { publicstaticint[] bar(int[] a) {
a[0] = 0;
a[1] = 0;
a[2] = 0; // Up to this point, we record that the lower bound (inclusive) is 3. // The next instruction will record that the lower bound is 5. // The deoptimization code used to assume the lower bound has // to be the one it will add for the deoptimization check (here, it // would be 3). returnnewint[a.length - 5];
}
publicstaticint[] foo(int[] a) {
a[0] = 0;
a[1] = 0;
a[2] = 0; // Up to this point, we record that the lower bound (inclusive) is 3. // The next instruction will record that the lower bound is 1. // The deoptimization code used to assume the lower bound has // to be the one it will add for the deoptimization check (here, it // would be 3). returnnewint[a.length - 1];
}
publicstaticvoid main(String[] args) { int[] a = newint[5]; int[] result = bar(a); if (result.length != 0) { thrownew Error("Expected 0, got " + result.length);
}
result = foo(a); if (result.length != 4) { thrownew Error("Expected 5, got " + result.length);
}
}
}
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.