mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8157438: JVMCI: MaterializeVirtualObjectTest fails w/ "CASE: invalidate=true: has no virtual object before"
Reviewed-by: kvn
This commit is contained in:
parent
489b38091e
commit
34c101efc6
1 changed files with 7 additions and 6 deletions
|
@ -75,6 +75,7 @@ public class MaterializeVirtualObjectTest {
|
||||||
private static final Method METHOD;
|
private static final Method METHOD;
|
||||||
private static final ResolvedJavaMethod RESOLVED_METHOD;
|
private static final ResolvedJavaMethod RESOLVED_METHOD;
|
||||||
private static final boolean INVALIDATE;
|
private static final boolean INVALIDATE;
|
||||||
|
private static final int COMPILE_THRESHOLD;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
WB = WhiteBox.getWhiteBox();
|
WB = WhiteBox.getWhiteBox();
|
||||||
|
@ -87,6 +88,9 @@ public class MaterializeVirtualObjectTest {
|
||||||
RESOLVED_METHOD = CTVMUtilities.getResolvedMethod(METHOD);
|
RESOLVED_METHOD = CTVMUtilities.getResolvedMethod(METHOD);
|
||||||
INVALIDATE = Boolean.getBoolean(
|
INVALIDATE = Boolean.getBoolean(
|
||||||
"compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate");
|
"compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate");
|
||||||
|
COMPILE_THRESHOLD = WB.getBooleanVMFlag("TieredCompilation")
|
||||||
|
? CompilerWhiteBoxTest.THRESHOLD
|
||||||
|
: CompilerWhiteBoxTest.THRESHOLD * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -110,15 +114,12 @@ public class MaterializeVirtualObjectTest {
|
||||||
+ " : method unexpectedly compiled");
|
+ " : method unexpectedly compiled");
|
||||||
/* need to trigger compilation by multiple method invocations
|
/* need to trigger compilation by multiple method invocations
|
||||||
in order to have method profile data to be gathered */
|
in order to have method profile data to be gathered */
|
||||||
boolean isTiered = WB.getBooleanVMFlag("TieredCompilation");
|
|
||||||
int COMPILE_THRESHOLD = isTiered ? CompilerWhiteBoxTest.THRESHOLD
|
|
||||||
: CompilerWhiteBoxTest.THRESHOLD * 2;
|
|
||||||
for (int i = 0; i < COMPILE_THRESHOLD; i++) {
|
for (int i = 0; i < COMPILE_THRESHOLD; i++) {
|
||||||
testFrame("someString", i);
|
testFrame("someString", i);
|
||||||
}
|
}
|
||||||
Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName()
|
Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName()
|
||||||
+ "Method unexpectedly not compiled");
|
+ "Method unexpectedly not compiled");
|
||||||
testFrame("someString", CompilerWhiteBoxTest.THRESHOLD);
|
testFrame("someString", COMPILE_THRESHOLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void testFrame(String str, int iteration) {
|
private void testFrame(String str, int iteration) {
|
||||||
|
@ -130,7 +131,7 @@ public class MaterializeVirtualObjectTest {
|
||||||
|
|
||||||
private void check(int iteration) {
|
private void check(int iteration) {
|
||||||
// Materialize virtual objects on last invocation
|
// Materialize virtual objects on last invocation
|
||||||
if (iteration == CompilerWhiteBoxTest.THRESHOLD) {
|
if (iteration == COMPILE_THRESHOLD) {
|
||||||
HotSpotStackFrameReference hsFrame = CompilerToVMHelper
|
HotSpotStackFrameReference hsFrame = CompilerToVMHelper
|
||||||
.getNextStackFrame(/* topmost frame */ null,
|
.getNextStackFrame(/* topmost frame */ null,
|
||||||
new ResolvedJavaMethod[]{
|
new ResolvedJavaMethod[]{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue