< prev index next >

test/compiler/eliminateAutobox/TestShortBoxing.java

Print this page




   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 TestShortBoxing


  29  * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
  30  * -XX:CompileCommand=exclude,TestShortBoxing.dummy -XX:CompileCommand=exclude,TestShortBoxing.foo -XX:CompileCommand=exclude,TestShortBoxing.foob TestShortBoxing



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


  34  */


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




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


< prev index next >