# HG changeset patch # User Doug Simon # Date 1387533453 -3600 # Node ID 1d53e766f71a99ec0ee529693e9d86d856c8f811 # Parent 7c694e3e97e540ef4e9b836ee3bca5e51dd335a8 added more tests for GETFIELD diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_b.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_b.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_b extends JTTTest { + + static class FieldHolder { + FieldHolder(byte field) { + this.field = field; + } + + private byte field; + } + + public static byte test(FieldHolder object) { + return object.field; + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder((byte) 0)); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder(Byte.MAX_VALUE)); + } + + @Test + public void run2() throws Throwable { + runTest("test", new FieldHolder(Byte.MIN_VALUE)); + } +} diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_c.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_c.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_c extends JTTTest { + + static class FieldHolder { + FieldHolder(char field) { + this.field = field; + } + + private char field; + } + + public static char test(FieldHolder object) { + return object.field; + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder('A')); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder(Character.MAX_VALUE)); + } + + @Test + public void run2() throws Throwable { + runTest("test", new FieldHolder(Character.MIN_VALUE)); + } +} diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_d.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_d.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_d extends JTTTest { + + static class FieldHolder { + FieldHolder(double field) { + this.field = field; + } + + private double field; + } + + public static double test(FieldHolder object) { + return object.field; + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder(0.0D)); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder(Double.MAX_VALUE)); + } + + @Test + public void run2() throws Throwable { + runTest("test", new FieldHolder(Double.MIN_VALUE)); + } +} diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_f.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_f.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_f extends JTTTest { + + static class FieldHolder { + FieldHolder(float field) { + this.field = field; + } + + private float field; + } + + public static float test(FieldHolder object) { + return object.field; + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder(0.0F)); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder(Float.MAX_VALUE)); + } + + @Test + public void run2() throws Throwable { + runTest("test", new FieldHolder(Float.MIN_VALUE)); + } +} diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_i.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_i.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_i extends JTTTest { + + static class FieldHolder { + FieldHolder(int field) { + this.field = field; + } + + private int field; + } + + public static int test(FieldHolder object) { + return object.field; + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder(0)); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder(Integer.MAX_VALUE)); + } + + @Test + public void run2() throws Throwable { + runTest("test", new FieldHolder(Integer.MIN_VALUE)); + } +} diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_l.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_l.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_l extends JTTTest { + + static class FieldHolder { + FieldHolder(long field) { + this.field = field; + } + + private long field; + } + + public static long test(FieldHolder object) { + return object.field; + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder(0)); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder(Long.MAX_VALUE)); + } + + @Test + public void run2() throws Throwable { + runTest("test", new FieldHolder(Long.MIN_VALUE)); + } +} diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_o.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_o.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_o extends JTTTest { + + static class FieldHolder { + FieldHolder(Object field) { + this.field = field; + } + + private Object field; + } + + public static Object test(FieldHolder object) { + return object.field == null ? null : object.field.getClass(); + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder(null)); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder("field")); + } + +} diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_s.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_s.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_s extends JTTTest { + + static class FieldHolder { + FieldHolder(short field) { + this.field = field; + } + + private short field; + } + + public static short test(FieldHolder object) { + return object.field; + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder((short) 0)); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder(Short.MAX_VALUE)); + } + + @Test + public void run2() throws Throwable { + runTest("test", new FieldHolder(Short.MIN_VALUE)); + } +} diff -r 7c694e3e97e5 -r 1d53e766f71a graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_z.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_getfield_z.java Fri Dec 20 10:57:33 2013 +0100 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.jtt.bytecode; + +import com.oracle.graal.jtt.*; +import org.junit.*; + +public class BC_getfield_z extends JTTTest { + + static class FieldHolder { + FieldHolder(boolean field) { + this.field = field; + } + + private boolean field; + } + + public static boolean test(FieldHolder object) { + return object.field; + } + + @Test + public void run0() throws Throwable { + runTest("test", new FieldHolder(true)); + } + + @Test + public void run1() throws Throwable { + runTest("test", new FieldHolder(false)); + } + +}