Compile the test program below with jikes and run with a fastdebug build with those options
java -server -Xcomp -XX:CompileOnly=ArrayClone.clone ArrayClone
You will see this assertion failure.
VM option 'CompileOnly=ArrayClone.clone'
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/ciObject.hpp:182
#
# HotSpot Virtual Machine Error, assertion failure
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Server VM (1.4.1-internal-debug compiled mode)
#
# assert(is_instance_klass(), "bad cast")
#
# Error ID: /jle_extra/jpe_dev/mma/j2se/sol/1.4.2_08/hotspot/src/share/vm/ci/ciObject.hpp, 182 [ Patched ]
#
# Problematic Thread: prio=5 tid=0x00124308 nid=0x8 runnable
#
The test program:
class ArrayClone implements Cloneable {
private transient double[] _values;
public ArrayClone(int count) {
_values = new double[count];
}
public Object clone() {
try {
// make a deep copy
ArrayClone c = (ArrayClone)super.clone();
c._values = (double[])this._values.clone();
return c;
} catch (Throwable t) {
t.printStackTrace();
}
return null;
}
public static void main(String args[]) {
ArrayClone ac = new ArrayClone(12);
ArrayClone ac2 = (ArrayClone)ac.clone();
System.err.println(ac);
System.err.println(ac2);
}
}
###@###.### 2005-05-17 18:30:58 GMT
java -server -Xcomp -XX:CompileOnly=ArrayClone.clone ArrayClone
You will see this assertion failure.
VM option 'CompileOnly=ArrayClone.clone'
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc: SuppressErrorAt=/ciObject.hpp:182
#
# HotSpot Virtual Machine Error, assertion failure
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Server VM (1.4.1-internal-debug compiled mode)
#
# assert(is_instance_klass(), "bad cast")
#
# Error ID: /jle_extra/jpe_dev/mma/j2se/sol/1.4.2_08/hotspot/src/share/vm/ci/ciObject.hpp, 182 [ Patched ]
#
# Problematic Thread: prio=5 tid=0x00124308 nid=0x8 runnable
#
The test program:
class ArrayClone implements Cloneable {
private transient double[] _values;
public ArrayClone(int count) {
_values = new double[count];
}
public Object clone() {
try {
// make a deep copy
ArrayClone c = (ArrayClone)super.clone();
c._values = (double[])this._values.clone();
return c;
} catch (Throwable t) {
t.printStackTrace();
}
return null;
}
public static void main(String args[]) {
ArrayClone ac = new ArrayClone(12);
ArrayClone ac2 = (ArrayClone)ac.clone();
System.err.println(ac);
System.err.println(ac2);
}
}
###@###.### 2005-05-17 18:30:58 GMT
- relates to
-
JDK-4962591 CI assumes all classes in methodref are ciInstanceKlass
-
- Resolved
-