< prev index next >

test/runtime/valhalla/valuetypes/VboxUnbox.java

Print this page
rev 10541 : remove -Xint from runtime tests + force TieredCompilation off


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package runtime.valhalla.valuetypes;
  24 
  25 import java.lang.invoke.*;
  26 import jdk.experimental.value.*;
  27 
  28 import static jdk.test.lib.Asserts.*;
  29 
  30 /*
  31  * @test VboxUnbox
  32  * @summary Exercise vbox & vunbox bytecodes
  33  * @library /testlibrary /
  34  * @build runtime.valhalla.valuetypes.ValueCapableClass
  35  * @run main/othervm -Xint -noverify runtime.valhalla.valuetypes.VboxUnbox
  36  *
  37  * To dump generated byte-code, add "-Dvalhalla.dumpIsolatedMethodClasses=/tmp/foo"
  38  */
  39 public class VboxUnbox {
  40 
  41     public static void main(String[] args) {
  42         testCorrectBoxing();
  43         testIncorrectBoxing();
  44     }
  45 
  46     public static void testCorrectBoxing() {
  47         Class<?> vcc = ValueCapableClass.class;
  48         Class<?> dvt = ValueType.forClass(vcc).valueClass();
  49 
  50         MethodHandle newDvt = newDvtMh(dvt);
  51         MethodHandle box = boxMh(dvt, vcc);
  52         MethodHandle unbox = unboxMh(vcc, dvt);
  53 
  54         ValueCapableClass newObject = ValueCapableClass.create(3, (short)7, (short)11);
  55         ValueCapableClass newBoxed = null;




  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 package runtime.valhalla.valuetypes;
  24 
  25 import java.lang.invoke.*;
  26 import jdk.experimental.value.*;
  27 
  28 import static jdk.test.lib.Asserts.*;
  29 
  30 /*
  31  * @test VboxUnbox
  32  * @summary Exercise vbox & vunbox bytecodes
  33  * @library /testlibrary /
  34  * @build runtime.valhalla.valuetypes.ValueCapableClass
  35  * @run main/othervm -noverify runtime.valhalla.valuetypes.VboxUnbox
  36  *
  37  * To dump generated byte-code, add "-Dvalhalla.dumpIsolatedMethodClasses=/tmp/foo"
  38  */
  39 public class VboxUnbox {
  40 
  41     public static void main(String[] args) {
  42         testCorrectBoxing();
  43         testIncorrectBoxing();
  44     }
  45 
  46     public static void testCorrectBoxing() {
  47         Class<?> vcc = ValueCapableClass.class;
  48         Class<?> dvt = ValueType.forClass(vcc).valueClass();
  49 
  50         MethodHandle newDvt = newDvtMh(dvt);
  51         MethodHandle box = boxMh(dvt, vcc);
  52         MethodHandle unbox = unboxMh(vcc, dvt);
  53 
  54         ValueCapableClass newObject = ValueCapableClass.create(3, (short)7, (short)11);
  55         ValueCapableClass newBoxed = null;


< prev index next >