< prev index next >

test/compiler/eliminateAutobox/TestByteBoxing.java

Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke


   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  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 
  24 /*
  25  * @test
  26  * @bug 6934604
  27  * @summary enable parts of EliminateAutoBox by default
  28  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestByteBoxing
  29  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
  30  * -XX:CompileCommand=exclude,TestByteBoxing.dummy -XX:CompileCommand=exclude,TestByteBoxing.foo -XX:CompileCommand=exclude,TestByteBoxing.foob TestByteBoxing





  31  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
  32  * -XX:CompileCommand=exclude,TestByteBoxing.dummy -XX:CompileCommand=exclude,TestByteBoxing.foo -XX:CompileCommand=exclude,TestByteBoxing.foob TestByteBoxing
  33  *


  34  */
  35 


  36 public class TestByteBoxing {
  37 
  38   static final Byte ibc = new Byte((byte)1);
  39 
  40   //===============================================
  41   // Non-inlined methods to test deoptimization info
  42   static void dummy()      { }
  43   static byte foo(byte i)  { return i; }
  44   static Byte foob(byte i) { return Byte.valueOf(i); }
  45 
  46 
  47   static byte simple(byte i) {
  48     Byte ib = new Byte(i);
  49     return ib;
  50   }
  51 
  52   static byte simpleb(byte i) {
  53     Byte ib = Byte.valueOf(i);
  54     return ib;
  55   }




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  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 
  24 /*
  25  * @test
  26  * @bug 6934604
  27  *

  28  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
  29  *                   compiler.eliminateAutobox.TestByteBoxing
  30  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
  31  *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::dummy
  32  *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foo
  33  *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foob
  34  *                   compiler.eliminateAutobox.TestByteBoxing
  35  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
  36  *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::dummy
  37  *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foo
  38  *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foob
  39  *                   compiler.eliminateAutobox.TestByteBoxing
  40  */
  41 
  42 package compiler.eliminateAutobox;
  43 
  44 public class TestByteBoxing {
  45 
  46   static final Byte ibc = new Byte((byte)1);
  47 
  48   //===============================================
  49   // Non-inlined methods to test deoptimization info
  50   static void dummy()      { }
  51   static byte foo(byte i)  { return i; }
  52   static Byte foob(byte i) { return Byte.valueOf(i); }
  53 
  54 
  55   static byte simple(byte i) {
  56     Byte ib = new Byte(i);
  57     return ib;
  58   }
  59 
  60   static byte simpleb(byte i) {
  61     Byte ib = Byte.valueOf(i);
  62     return ib;
  63   }


< prev index next >