publicstaticint foo1() { int b = bar();
doNothing(b == 42); // This second `b == 42` will be GVN'ed away. if (b == 42) {
inIf(); return b;
} return0;
}
publicstaticint foo2() { int b = bar();
doNothing(b == 41); // This second `b == 41` will be GVN'ed away. if (b == 41) {
inIf(); return0;
} return b;
}
publicstaticboolean $noinline$intEq0(int x) { return x == 0;
}
publicstaticboolean $noinline$intNe0(int x) { return x != 0;
}
publicstaticboolean $noinline$longEq0(long x) { return x == 0;
}
publicstaticboolean $noinline$longNe0(long x) { return x != 0;
}
publicstaticboolean $noinline$longEqCst(long x) { return x == 0x0123456789ABCDEFL;
}
publicstaticboolean $noinline$longNeCst(long x) { return x != 0x0123456789ABCDEFL;
}
// The purpose of this method is to test code generation for a materialized // HCondition that is not equality or inequality, and that has one boolean // input. That can't be done directly, so we have to rely on the instruction // simplifier to transform the control-flow graph appropriately. publicstaticboolean $noinline$booleanCondition(boolean in) { int value = in ? 1 : 0;
// Calling a non-inlineable method that uses `value` as well prevents a // transformation of the return value into `false`.
$noinline$intNe0(value); return value > 127;
}
publicstaticvoid main(String[] args) {
System.out.println("foo1"); int res = foo1(); if (res != 42) { thrownew Error("Unexpected return value for foo1: " + res + ", expected 42.");
}
System.out.println("foo2");
res = foo2(); if (res != 42) { thrownew Error("Unexpected return value for foo2: " + res + ", expected 42.");
}
for (int i = 0; i < long_inputs.length; i++) {
assertEqual(long_ne_cst_expected[i], $noinline$longNeCst(long_inputs[i]));
}
}
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.14Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 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.