< prev index next >
test/compiler/c2/Test6851282.java
Print this page
*** 25,41 ****
/**
* @test
* @bug 6851282
* @summary JIT miscompilation results in null entry in array when using CompressedOops
*
! * @run main/othervm/timeout=600 -Xmx256m -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops Test
*/
import java.util.ArrayList;
import java.util.List;
! public class Test {
void foo(A a, A[] as) {
for (A a1 : as) {
B[] filtered = a.c(a1);
for (B b : filtered) {
if (b == null) {
--- 25,44 ----
/**
* @test
* @bug 6851282
* @summary JIT miscompilation results in null entry in array when using CompressedOops
*
! * @run main/othervm/timeout=600 -Xmx256m -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops
! * compiler.c2.Test6851282
*/
+ package compiler.c2;
+
import java.util.ArrayList;
import java.util.List;
! public class Test6851282 {
void foo(A a, A[] as) {
for (A a1 : as) {
B[] filtered = a.c(a1);
for (B b : filtered) {
if (b == null) {
*** 52,66 ****
List<B> bs = new ArrayList<B>();
for (int j = i; j < i + 1000; j++)
bs.add(new B(j));
as.add(new A(bs.toArray(new B[0])));
}
! new Test().foo(as.get(0), as.subList(1, as.size()).toArray(new A[0]));
}
- }
! class A {
final B[] bs;
public A(B[] bs) {
this.bs = bs;
}
--- 55,68 ----
List<B> bs = new ArrayList<B>();
for (int j = i; j < i + 1000; j++)
bs.add(new B(j));
as.add(new A(bs.toArray(new B[0])));
}
! new Test6851282().foo(as.get(0), as.subList(1, as.size()).toArray(new A[0]));
}
! static class A {
final B[] bs;
public A(B[] bs) {
this.bs = bs;
}
*** 74,86 ****
}
return false;
}
});
}
! }
! class BoxedArray<T> {
private final T[] array;
BoxedArray(T[] array) {
this.array = array;
--- 76,88 ----
}
return false;
}
});
}
! }
! static class BoxedArray<T> {
private final T[] array;
BoxedArray(T[] array) {
this.array = array;
*** 107,124 ****
}
i += 1;
}
return result;
}
! }
! interface Function<T, R> {
R apply(T arg);
! }
! class B {
final int d;
public B(int d) {
this.d = d;
}
}
--- 109,128 ----
}
i += 1;
}
return result;
}
! }
! static interface Function<T, R> {
R apply(T arg);
! }
! static class B {
final int d;
+
public B(int d) {
this.d = d;
}
+ }
}
< prev index next >