-
Type:
Sub-task
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: repo-valhalla
-
Component/s: hotspot
-
None
For the following test case (after JDK-8222717 is fixed) when a C2-compiled method calls a C1-compiled method, and the latter throws an exception, stack unwinding is broken and somehow we executed the "test47_value = 666" line, but with a wrong RSP so we get a crash there.
---------
// C2->C1 invokestatic, make sure stack walking works (with static variable)
@Test(compLevel = C2)
public void test47(int n) {
try {
test47_helper(floatPointField, 1, 2, 3, 4, 5);
test47_value = 666;
} catch (MyRuntimeException e) {
// expected;
}
test47_value = n;
}
@DontInline
@ForceCompile(compLevel = C1)
private static float test47_helper(FloatPoint fp, int a1, int a2, int a3, int a4, int a5) {
test47_thrower();
return 0.0f;
}
@DontInline @DontCompile
private static void test47_thrower() {
MyRuntimeException e = new MyRuntimeException("This exception should have been caught!");
checkStackTrace(e, "test47_thrower", "test47_helper", "test47", "test47_verifier");
throw e;
}
static int test47_value = 999;
@DontCompile
public void test47_verifier(boolean warmup) {
int count = warmup ? 1 : 5;
for (int i=0; i<count; i++) { // need a loop to test inline cache
test47_value = 777 + i;
test47(i);
// FIXMEJDK-8222908 Asserts.assertEQ(test47_value, i);
}
}
---------
// C2->C1 invokestatic, make sure stack walking works (with static variable)
@Test(compLevel = C2)
public void test47(int n) {
try {
test47_helper(floatPointField, 1, 2, 3, 4, 5);
test47_value = 666;
} catch (MyRuntimeException e) {
// expected;
}
test47_value = n;
}
@DontInline
@ForceCompile(compLevel = C1)
private static float test47_helper(FloatPoint fp, int a1, int a2, int a3, int a4, int a5) {
test47_thrower();
return 0.0f;
}
@DontInline @DontCompile
private static void test47_thrower() {
MyRuntimeException e = new MyRuntimeException("This exception should have been caught!");
checkStackTrace(e, "test47_thrower", "test47_helper", "test47", "test47_verifier");
throw e;
}
static int test47_value = 999;
@DontCompile
public void test47_verifier(boolean warmup) {
int count = warmup ? 1 : 5;
for (int i=0; i<count; i++) { // need a loop to test inline cache
test47_value = 777 + i;
test47(i);
// FIXME
}
}