hotspot/test/compiler/6934604/TestByteBoxing.java
author kvn
Wed, 08 May 2013 15:08:01 -0700
changeset 17383 3665c0901a0d
permissions -rw-r--r--
6934604: enable parts of EliminateAutoBox by default Summary: Resurrected autobox elimination code and enabled part of it by default. Reviewed-by: roland, twisti
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17383
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     1
/*
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     4
 *
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     8
 *
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    13
 * accompanied this code).
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    14
 *
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    18
 *
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    21
 * questions.
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    22
 */
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    23
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    24
/*
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    25
 * @test
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    26
 * @bug 6934604
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    27
 * @summary enable parts of EliminateAutoBox by default
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    28
 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox TestByteBoxing
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    29
 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    30
 * -XX:CompileCommand=exclude,TestByteBoxing.dummy -XX:CompileCommand=exclude,TestByteBoxing.foo -XX:CompileCommand=exclude,TestByteBoxing.foob TestByteBoxing
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    31
 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    32
 * -XX:CompileCommand=exclude,TestByteBoxing.dummy -XX:CompileCommand=exclude,TestByteBoxing.foo -XX:CompileCommand=exclude,TestByteBoxing.foob TestByteBoxing
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    33
 *
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    34
 */
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    35
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    36
public class TestByteBoxing {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    37
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    38
  static final Byte ibc = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    39
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    40
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    41
  // Non-inlined methods to test deoptimization info
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    42
  static void dummy()      { }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    43
  static byte foo(byte i)  { return i; }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    44
  static Byte foob(byte i) { return Byte.valueOf(i); }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    45
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    46
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    47
  static byte simple(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    48
    Byte ib = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    49
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    50
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    51
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    52
  static byte simpleb(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    53
    Byte ib = Byte.valueOf(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    54
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    55
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    56
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    57
  static byte simplec() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    58
    Byte ib = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    59
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    60
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    61
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    62
  static byte simplef(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    63
    Byte ib = foob(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    64
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    65
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    66
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    67
  static byte simplep(Byte ib) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    68
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    69
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    70
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    71
  static byte simple2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    72
    Byte ib1 = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    73
    Byte ib2 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    74
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    75
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    76
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    77
  static byte simpleb2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    78
    Byte ib1 = Byte.valueOf(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    79
    Byte ib2 = Byte.valueOf((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    80
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    81
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    82
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    83
  static byte simplem2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    84
    Byte ib1 = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    85
    Byte ib2 = Byte.valueOf((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    86
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    87
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    88
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    89
  static byte simplep2(byte i, Byte ib1) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    90
    Byte ib2 = Byte.valueOf((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    91
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    92
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    93
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    94
  static byte simplec2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    95
    Byte ib1 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    96
    Byte ib2 = Byte.valueOf((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    97
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    98
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    99
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   100
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   101
  static byte test(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   102
    Byte ib = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   103
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   104
      ib = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   105
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   106
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   107
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   108
  static byte testb(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   109
    Byte ib = i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   110
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   111
      ib = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   112
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   113
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   114
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   115
  static byte testm(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   116
    Byte ib = i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   117
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   118
      ib = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   119
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   120
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   121
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   122
  static byte testp(byte i, Byte ib) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   123
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   124
      ib = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   125
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   126
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   127
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   128
  static byte testc(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   129
    Byte ib = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   130
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   131
      ib = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   132
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   133
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   134
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   135
  static byte test2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   136
    Byte ib1 = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   137
    Byte ib2 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   138
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   139
      ib1 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   140
      ib2 = new Byte((byte)(i+2));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   141
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   142
    return (byte)(ib1+ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   143
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   144
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   145
  static byte testb2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   146
    Byte ib1 = i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   147
    Byte ib2 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   148
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   149
      ib1 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   150
      ib2 = (byte)(i+2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   151
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   152
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   153
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   154
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   155
  static byte testm2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   156
    Byte ib1 = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   157
    Byte ib2 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   158
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   159
      ib1 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   160
      ib2 = (byte)(i+2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   161
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   162
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   163
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   164
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   165
  static byte testp2(byte i, Byte ib1) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   166
    Byte ib2 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   167
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   168
      ib1 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   169
      ib2 = (byte)(i+2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   170
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   171
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   172
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   173
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   174
  static byte testc2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   175
    Byte ib1 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   176
    Byte ib2 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   177
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   178
      ib1 = (byte)(ibc+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   179
      ib2 = (byte)(i+2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   180
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   181
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   182
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   183
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   184
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   185
  static byte sum(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   186
    byte result = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   187
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   188
        result += i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   189
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   190
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   191
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   192
  static byte sumb(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   193
    Byte result = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   194
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   195
        result = (byte)(result + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   196
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   197
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   198
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   199
  static byte sumc(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   200
    Byte result = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   201
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   202
        result = (byte)(result + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   203
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   204
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   205
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   206
  static byte sumf(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   207
    Byte result = foob((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   208
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   209
        result = (byte)(result + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   210
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   211
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   212
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   213
  static byte sump(byte[] a, Byte result) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   214
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   215
        result = (byte)(result + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   216
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   217
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   218
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   219
  static byte sum2(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   220
    byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   221
    byte result2 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   222
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   223
        result1 += i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   224
        result2 += i + 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   225
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   226
    return (byte)(result1 + result2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   227
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   228
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   229
  static byte sumb2(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   230
    Byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   231
    Byte result2 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   232
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   233
        result1 = (byte)(result1 + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   234
        result2 = (byte)(result2 + i + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   235
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   236
    return (byte)(result1 + result2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   237
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   238
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   239
  static byte summ2(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   240
    Byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   241
    Byte result2 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   242
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   243
        result1 = (byte)(result1 + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   244
        result2 = (byte)(result2 + new Byte((byte)(i + 1)));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   245
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   246
    return (byte)(result1 + result2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   247
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   248
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   249
  static byte sump2(byte[] a, Byte result2) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   250
    Byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   251
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   252
        result1 = (byte)(result1 + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   253
        result2 = (byte)(result2 + i + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   254
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   255
    return (byte)(result1 + result2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   256
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   257
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   258
  static byte sumc2(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   259
    Byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   260
    Byte result2 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   261
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   262
        result1 = (byte)(result1 + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   263
        result2 = (byte)(result2 + i + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   264
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   265
    return (byte)(result1 + result2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   266
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   267
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   268
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   269
  static byte remi_sum() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   270
    Byte j = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   271
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   272
      j = new Byte((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   273
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   274
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   275
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   276
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   277
  static byte remi_sumb() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   278
    Byte j = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   279
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   280
      j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   281
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   282
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   283
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   284
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   285
  static byte remi_sumf() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   286
    Byte j = foob((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   287
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   288
      j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   289
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   290
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   291
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   292
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   293
  static byte remi_sump(Byte j) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   294
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   295
      j = new Byte((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   296
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   297
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   298
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   299
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   300
  static byte remi_sumc() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   301
    Byte j = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   302
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   303
      j = (byte)(j + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   304
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   305
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   306
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   307
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   308
  static byte remi_sum2() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   309
    Byte j1 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   310
    Byte j2 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   311
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   312
      j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   313
      j2 = new Byte((byte)(j2 + 2));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   314
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   315
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   316
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   317
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   318
  static byte remi_sumb2() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   319
    Byte j1 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   320
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   321
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   322
      j1 = (byte)(j1 + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   323
      j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   324
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   325
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   326
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   327
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   328
  static byte remi_summ2() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   329
    Byte j1 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   330
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   331
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   332
      j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   333
      j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   334
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   335
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   336
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   337
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   338
  static byte remi_sump2(Byte j1) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   339
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   340
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   341
      j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   342
      j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   343
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   344
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   345
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   346
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   347
  static byte remi_sumc2() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   348
    Byte j1 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   349
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   350
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   351
      j1 = (byte)(j1 + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   352
      j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   353
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   354
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   355
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   356
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   357
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   358
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   359
  // Safepointa and debug info for deoptimization
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   360
  static byte simple_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   361
    Byte ib = new Byte(foo(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   362
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   363
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   364
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   365
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   366
  static byte simpleb_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   367
    Byte ib = Byte.valueOf(foo(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   368
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   369
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   370
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   371
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   372
  static byte simplef_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   373
    Byte ib = foob(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   374
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   375
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   376
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   377
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   378
  static byte simplep_deop(Byte ib) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   379
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   380
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   381
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   382
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   383
  static byte simplec_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   384
    Byte ib = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   385
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   386
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   387
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   388
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   389
  static byte test_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   390
    Byte ib = new Byte(foo(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   391
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   392
      ib = foo((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   393
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   394
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   395
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   396
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   397
  static byte testb_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   398
    Byte ib = foo(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   399
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   400
      ib = foo((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   401
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   402
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   403
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   404
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   405
  static byte testf_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   406
    Byte ib = foob(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   407
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   408
      ib = foo((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   409
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   410
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   411
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   412
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   413
  static byte testp_deop(byte i, Byte ib) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   414
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   415
      ib = foo((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   416
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   417
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   418
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   419
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   420
  static byte testc_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   421
    Byte ib = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   422
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   423
      ib = foo((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   424
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   425
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   426
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   427
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   428
  static byte sum_deop(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   429
    byte result = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   430
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   431
        result += foo(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   432
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   433
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   434
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   435
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   436
  static byte sumb_deop(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   437
    Byte result = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   438
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   439
        result = (byte)(result + foo(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   440
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   441
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   442
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   443
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   444
  static byte sumf_deop(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   445
    Byte result = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   446
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   447
        result = (byte)(result + foob(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   448
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   449
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   450
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   451
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   452
  static byte sump_deop(byte[] a, Byte result) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   453
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   454
        result = (byte)(result + foob(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   455
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   456
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   457
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   458
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   459
  static byte sumc_deop(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   460
    Byte result = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   461
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   462
        result = (byte)(result + foo(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   463
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   464
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   465
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   466
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   467
  static byte remi_sum_deop() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   468
    Byte j = new Byte(foo((byte)1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   469
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   470
      j = new Byte(foo((byte)(j + 1)));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   471
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   472
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   473
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   474
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   475
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   476
  static byte remi_sumb_deop() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   477
    Byte j = Byte.valueOf(foo((byte)1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   478
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   479
      j = foo((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   480
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   481
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   482
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   483
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   484
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   485
  static byte remi_sumf_deop() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   486
    Byte j = foob((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   487
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   488
      j = foo((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   489
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   490
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   491
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   492
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   493
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   494
  static byte remi_sump_deop(Byte j) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   495
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   496
      j = foo((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   497
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   498
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   499
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   500
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   501
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   502
  static byte remi_sumc_deop() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   503
    Byte j = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   504
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   505
      j = foo((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   506
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   507
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   508
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   509
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   510
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   511
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   512
  // Conditional increment
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   513
  static byte remi_sum_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   514
    Byte j = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   515
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   516
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   517
        j = new Byte((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   518
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   519
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   520
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   521
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   522
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   523
  static byte remi_sumb_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   524
    Byte j = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   525
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   526
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   527
        j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   528
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   529
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   530
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   531
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   532
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   533
  static byte remi_sumf_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   534
    Byte j = foob((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   535
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   536
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   537
        j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   538
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   539
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   540
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   541
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   542
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   543
  static byte remi_sump_cond(Byte j) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   544
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   545
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   546
        j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   547
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   548
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   549
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   550
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   551
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   552
  static byte remi_sumc_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   553
    Byte j = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   554
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   555
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   556
        j = (byte)(j + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   557
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   558
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   559
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   560
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   561
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   562
  static byte remi_sum2_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   563
    Byte j1 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   564
    Byte j2 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   565
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   566
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   567
        j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   568
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   569
        j2 = new Byte((byte)(j2 + 2));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   570
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   571
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   572
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   573
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   574
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   575
  static byte remi_sumb2_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   576
    Byte j1 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   577
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   578
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   579
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   580
        j1 = (byte)(j1 + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   581
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   582
        j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   583
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   584
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   585
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   586
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   587
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   588
  static byte remi_summ2_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   589
    Byte j1 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   590
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   591
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   592
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   593
        j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   594
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   595
        j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   596
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   597
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   598
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   599
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   600
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   601
  static byte remi_sump2_cond(Byte j1) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   602
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   603
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   604
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   605
        j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   606
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   607
        j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   608
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   609
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   610
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   611
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   612
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   613
  static byte remi_sumc2_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   614
    Byte j1 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   615
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   616
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   617
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   618
        j1 = (byte)(j1 + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   619
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   620
        j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   621
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   622
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   623
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   624
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   625
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   626
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   627
  public static void main(String[] args) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   628
    final int ntests = 70;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   629
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   630
    String[] test_name = new String[] {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   631
        "simple",      "simpleb",      "simplec",      "simplef",      "simplep",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   632
        "simple2",     "simpleb2",     "simplec2",     "simplem2",     "simplep2",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   633
        "simple_deop", "simpleb_deop", "simplec_deop", "simplef_deop", "simplep_deop",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   634
        "test",        "testb",        "testc",        "testm",        "testp",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   635
        "test2",       "testb2",       "testc2",       "testm2",       "testp2",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   636
        "test_deop",   "testb_deop",   "testc_deop",   "testf_deop",   "testp_deop",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   637
        "sum",         "sumb",         "sumc",         "sumf",         "sump",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   638
        "sum2",        "sumb2",        "sumc2",        "summ2",        "sump2",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   639
        "sum_deop",    "sumb_deop",    "sumc_deop",    "sumf_deop",    "sump_deop",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   640
        "remi_sum",       "remi_sumb",       "remi_sumc",       "remi_sumf",       "remi_sump",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   641
        "remi_sum2",      "remi_sumb2",      "remi_sumc2",      "remi_summ2",      "remi_sump2",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   642
        "remi_sum_deop",  "remi_sumb_deop",  "remi_sumc_deop",  "remi_sumf_deop",  "remi_sump_deop",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   643
        "remi_sum_cond",  "remi_sumb_cond",  "remi_sumc_cond",  "remi_sumf_cond",  "remi_sump_cond",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   644
        "remi_sum2_cond", "remi_sumb2_cond", "remi_sumc2_cond", "remi_summ2_cond", "remi_sump2_cond"
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   645
    };
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   646
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   647
    final int[] val = new int[] {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   648
      -5488, -5488, 12000, -5488, -5488,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   649
       1024,  1024, -5552,  1024,  1024,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   650
      -5488, -5488, 12000, -5488, -5488,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   651
        512,   512,  6256,   512,   512,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   652
      13024, 13024, -5584, 13024, 13024,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   653
        512,   512,  6256,   512,   512,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   654
         45,    45,    45,    45,    45,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   655
         66,    66,    66,    66,    66,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   656
         45,    45,    45,    45,    45,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   657
        -23,   -23,   -23,   -23,   -23,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   658
        -70,   -70,   -70,   -70,   -70,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   659
        -23,   -23,   -23,   -23,   -23,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   660
        -11,   -11,   -11,   -11,   -11,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   661
        -34,   -34,   -34,   -34,   -34
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   662
    };
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   663
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   664
    int[] res = new int[ntests];
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   665
    for (int i = 0; i < ntests; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   666
      res[i] = 0;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   667
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   668
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   669
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   670
    for (int i = 0; i < 12000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   671
      res[0] += simple((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   672
      res[1] += simpleb((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   673
      res[2] += simplec();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   674
      res[3] += simplef((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   675
      res[4] += simplep((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   676
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   677
      res[5] += simple2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   678
      res[6] += simpleb2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   679
      res[7] += simplec2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   680
      res[8] += simplem2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   681
      res[9] += simplep2((byte)i, (byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   682
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   683
      res[10] += simple_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   684
      res[11] += simpleb_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   685
      res[12] += simplec_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   686
      res[13] += simplef_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   687
      res[14] += simplep_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   688
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   689
      res[15] += test((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   690
      res[16] += testb((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   691
      res[17] += testc((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   692
      res[18] += testm((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   693
      res[19] += testp((byte)i, (byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   694
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   695
      res[20] += test2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   696
      res[21] += testb2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   697
      res[22] += testc2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   698
      res[23] += testm2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   699
      res[24] += testp2((byte)i, (byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   700
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   701
      res[25] += test_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   702
      res[26] += testb_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   703
      res[27] += testc_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   704
      res[28] += testf_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   705
      res[29] += testp_deop((byte)i, (byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   706
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   707
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   708
    byte[] ia = new byte[1000];
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   709
    for (int i = 0; i < 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   710
      ia[i] = (byte)i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   711
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   712
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   713
    for (int i = 0; i < 100; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   714
      res[30] = sum(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   715
      res[31] = sumb(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   716
      res[32] = sumc(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   717
      res[33] = sumf(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   718
      res[34] = sump(ia, (byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   719
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   720
      res[35] = sum2(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   721
      res[36] = sumb2(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   722
      res[37] = sumc2(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   723
      res[38] = summ2(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   724
      res[39] = sump2(ia, (byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   725
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   726
      res[40] = sum_deop(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   727
      res[41] = sumb_deop(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   728
      res[42] = sumc_deop(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   729
      res[43] = sumf_deop(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   730
      res[44] = sump_deop(ia, (byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   731
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   732
      res[45] = remi_sum();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   733
      res[46] = remi_sumb();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   734
      res[47] = remi_sumc();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   735
      res[48] = remi_sumf();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   736
      res[49] = remi_sump((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   737
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   738
      res[50] = remi_sum2();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   739
      res[51] = remi_sumb2();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   740
      res[52] = remi_sumc2();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   741
      res[53] = remi_summ2();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   742
      res[54] = remi_sump2((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   743
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   744
      res[55] = remi_sum_deop();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   745
      res[56] = remi_sumb_deop();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   746
      res[57] = remi_sumc_deop();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   747
      res[58] = remi_sumf_deop();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   748
      res[59] = remi_sump_deop((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   749
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   750
      res[60] = remi_sum_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   751
      res[61] = remi_sumb_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   752
      res[62] = remi_sumc_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   753
      res[63] = remi_sumf_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   754
      res[64] = remi_sump_cond((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   755
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   756
      res[65] = remi_sum2_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   757
      res[66] = remi_sumb2_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   758
      res[67] = remi_sumc2_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   759
      res[68] = remi_summ2_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   760
      res[69] = remi_sump2_cond((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   761
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   762
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   763
    int failed = 0;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   764
    for (int i = 0; i < ntests; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   765
      if (res[i] != val[i]) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   766
        System.err.println(test_name[i] + ": " + res[i] + " != " + val[i]);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   767
        failed++;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   768
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   769
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   770
    if (failed > 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   771
      System.err.println("Failed " + failed + " tests.");
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   772
      throw new InternalError();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   773
    } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   774
      System.out.println("Passed.");
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   775
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   776
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   777
}