Name: viR10068 Date: 11/13/2003
The JVM (1.5.0-beta-b28) accepts class v49:0 with
low = 0x80000000 for tableswitch instruction.
Note, the JVM rejects this class file if CF version < 49:0.
The new JCK tests are failed due to this error:
# vm/instr/tableswitch/tableswitch003/tableswitch00310m1t/tableswitch00310m1t.html
The test source:
--------------------- test12_49.jasm ---------------------------
public class test12_49 version 49:0 {
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
stack 3 locals 2
{
iconst_0;
bytecode 170; // tableswitch
nop; nop; // padding
bytecode 0,0,0,19; // default target == L16
bytecode 0x80,0x00,0x00,0x00;
bytecode 0,0,0,0;
bytecode 0,0,0,19;
L16: locals_map class "[Ljava/lang/String;", class java/io/PrintStream;
iconst_0;
ireturn;
}
}
--------------------- test12_45.jasm ---------------------------
public class test12_45 version 45:3 {
public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
stack 3 locals 2
{
iconst_0;
bytecode 170; // tableswitch
nop; nop; // padding
bytecode 0,0,0,19; // default target == L16
bytecode 0x80,0x00,0x00,0x00;
bytecode 0,0,0,0;
bytecode 0,0,0,19;
L16: locals_map class "[Ljava/lang/String;", class java/io/PrintStream;
iconst_0;
ireturn;
}
}
----------------------------------------------------------------
The execution log:
% jdk1.5.0-b28/solaris-sparc/bin/java -showversion -Xfuture test12_49
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b28)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b28, mixed mode)
Exception in thread "main" java.lang.NoSuchMethodError: main
% jdk1.5.0-b28/solaris-sparc/bin/java -showversion -Xfuture test12_45
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b28)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b28, mixed mode)
Exception in thread "main" java.lang.VerifyError: (class: test12_45, method: run
signature: ([Ljava/lang/String;Ljava/io/PrintStream;)I) Illegal instruction found at
offset 1
%
======================================================================