test/hotspot/jtreg/compiler/eliminateAutobox/TestByteBoxing.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 40059 hotspot/test/compiler/eliminateAutobox/TestByteBoxing.java@c2304140ed64
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
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
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    27
 *
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    28
 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    29
 *                   compiler.eliminateAutobox.TestByteBoxing
17383
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    30
 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:+EliminateAutoBox
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    31
 *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::dummy
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    32
 *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foo
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    33
 *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foob
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    34
 *                   compiler.eliminateAutobox.TestByteBoxing
17383
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    35
 * @run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-EliminateAutoBox
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    36
 *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::dummy
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    37
 *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foo
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    38
 *                   -XX:CompileCommand=exclude,compiler.eliminateAutobox.TestByteBoxing::foob
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    39
 *                   compiler.eliminateAutobox.TestByteBoxing
17383
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
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    42
package compiler.eliminateAutobox;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    43
17383
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    44
public class TestByteBoxing {
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
  static final Byte ibc = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    47
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    48
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    49
  // Non-inlined methods to test deoptimization info
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    50
  static void dummy()      { }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    51
  static byte foo(byte i)  { return i; }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    52
  static Byte foob(byte i) { return Byte.valueOf(i); }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    53
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    54
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    55
  static byte simple(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    56
    Byte ib = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    57
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    58
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    59
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    60
  static byte simpleb(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    61
    Byte ib = Byte.valueOf(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    62
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    63
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    64
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    65
  static byte simplec() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    66
    Byte ib = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    67
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    68
  }
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
  static byte simplef(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    71
    Byte ib = foob(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    72
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    73
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    74
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    75
  static byte simplep(Byte ib) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    76
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    77
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    78
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    79
  static byte simple2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    80
    Byte ib1 = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    81
    Byte ib2 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    82
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    83
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    84
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    85
  static byte simpleb2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    86
    Byte ib1 = Byte.valueOf(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    87
    Byte ib2 = Byte.valueOf((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    88
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    89
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    90
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    91
  static byte simplem2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    92
    Byte ib1 = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    93
    Byte ib2 = Byte.valueOf((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    94
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    95
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    96
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    97
  static byte simplep2(byte i, Byte ib1) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    98
    Byte ib2 = Byte.valueOf((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
    99
    return (byte)(ib1 + ib2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   102
  static byte simplec2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   103
    Byte ib1 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   104
    Byte ib2 = Byte.valueOf((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   105
    return (byte)(ib1 + ib2);
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
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   109
  static byte test(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   110
    Byte ib = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   111
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   112
      ib = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   113
    return ib;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   116
  static byte testb(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   117
    Byte ib = i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   118
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   119
      ib = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   120
    return ib;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   123
  static byte testm(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   124
    Byte ib = i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   125
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   126
      ib = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   127
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   128
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   129
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   130
  static byte testp(byte i, Byte ib) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   131
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   132
      ib = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   133
    return ib;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   136
  static byte testc(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   137
    Byte ib = ibc;
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
      ib = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   140
    return ib;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   143
  static byte test2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   144
    Byte ib1 = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   145
    Byte ib2 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   146
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   147
      ib1 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   148
      ib2 = new Byte((byte)(i+2));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   149
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   150
    return (byte)(ib1+ib2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   153
  static byte testb2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   154
    Byte ib1 = i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   155
    Byte ib2 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   156
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   157
      ib1 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   158
      ib2 = (byte)(i+2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   159
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   160
    return (byte)(ib1 + ib2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   163
  static byte testm2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   164
    Byte ib1 = new Byte(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   165
    Byte ib2 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   166
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   167
      ib1 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   168
      ib2 = (byte)(i+2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   169
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   170
    return (byte)(ib1 + ib2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   171
  }
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
  static byte testp2(byte i, Byte ib1) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   174
    Byte ib2 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   175
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   176
      ib1 = new Byte((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   177
      ib2 = (byte)(i+2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   178
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   179
    return (byte)(ib1 + ib2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   182
  static byte testc2(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   183
    Byte ib1 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   184
    Byte ib2 = (byte)(i+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   185
    if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   186
      ib1 = (byte)(ibc+1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   187
      ib2 = (byte)(i+2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   188
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   189
    return (byte)(ib1 + ib2);
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
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   193
  static byte sum(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   194
    byte result = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   195
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   196
        result += i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   197
    return result;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   200
  static byte sumb(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   201
    Byte result = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   202
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   203
        result = (byte)(result + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   204
    return result;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   207
  static byte sumc(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   208
    Byte result = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   209
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   210
        result = (byte)(result + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   211
    return result;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   214
  static byte sumf(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   215
    Byte result = foob((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   216
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   217
        result = (byte)(result + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   218
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   219
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   220
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   221
  static byte sump(byte[] a, Byte result) {
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
        result = (byte)(result + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   224
    return result;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   227
  static byte sum2(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   228
    byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   229
    byte result2 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   230
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   231
        result1 += i;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   232
        result2 += i + 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   233
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   234
    return (byte)(result1 + result2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   237
  static byte sumb2(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   238
    Byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   239
    Byte result2 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   240
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   241
        result1 = (byte)(result1 + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   242
        result2 = (byte)(result2 + i + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   243
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   244
    return (byte)(result1 + result2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   247
  static byte summ2(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   248
    Byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   249
    Byte result2 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   250
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   251
        result1 = (byte)(result1 + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   252
        result2 = (byte)(result2 + new Byte((byte)(i + 1)));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   253
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   254
    return (byte)(result1 + result2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   255
  }
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
  static byte sump2(byte[] a, Byte result2) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   258
    Byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   259
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   260
        result1 = (byte)(result1 + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   261
        result2 = (byte)(result2 + i + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   262
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   263
    return (byte)(result1 + result2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   266
  static byte sumc2(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   267
    Byte result1 = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   268
    Byte result2 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   269
    for (Byte i : a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   270
        result1 = (byte)(result1 + i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   271
        result2 = (byte)(result2 + i + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   272
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   273
    return (byte)(result1 + result2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   274
  }
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_sum() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   278
    Byte j = new Byte((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 = new Byte((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_sumb() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   286
    Byte j = Byte.valueOf((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_sumf() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   294
    Byte j = foob((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   295
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   296
      j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   297
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   298
    return j;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   301
  static byte remi_sump(Byte j) {
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 = new Byte((byte)(j + 1));
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_sumc() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   309
    Byte j = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   310
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   311
      j = (byte)(j + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   312
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   313
    return j;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   316
  static byte remi_sum2() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   317
    Byte j1 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   318
    Byte j2 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   319
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   320
      j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   321
      j2 = new Byte((byte)(j2 + 2));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   322
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   323
    return (byte)(j1 + j2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   326
  static byte remi_sumb2() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   327
    Byte j1 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   328
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   329
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   330
      j1 = (byte)(j1 + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   331
      j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   332
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   333
    return (byte)(j1 + j2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   336
  static byte remi_summ2() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   337
    Byte j1 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   338
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   339
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   340
      j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   341
      j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   342
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   343
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   344
  }
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
  static byte remi_sump2(Byte j1) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   347
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   348
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   349
      j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   350
      j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   351
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   352
    return (byte)(j1 + j2);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   355
  static byte remi_sumc2() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   356
    Byte j1 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   357
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   358
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   359
      j1 = (byte)(j1 + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   360
      j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   361
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   362
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   363
  }
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
  //===============================================
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   367
  // Safepointa and debug info for deoptimization
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   368
  static byte simple_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   369
    Byte ib = new Byte(foo(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   370
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   371
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   372
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   373
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   374
  static byte simpleb_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   375
    Byte ib = Byte.valueOf(foo(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   376
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   377
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   378
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   379
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   380
  static byte simplef_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   381
    Byte ib = foob(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   382
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   383
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   384
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   385
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   386
  static byte simplep_deop(Byte ib) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   387
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   388
    return ib;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   389
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   390
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   391
  static byte simplec_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   392
    Byte ib = ibc;
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 test_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   398
    Byte ib = new Byte(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 testb_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   406
    Byte ib = foo(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 testf_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   414
    Byte ib = foob(i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   415
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   416
      ib = foo((byte)(i+1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   417
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   418
    return ib;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   421
  static byte testp_deop(byte i, Byte ib) {
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 testc_deop(byte i) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   429
    Byte ib = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   430
    if ((i&1) == 0)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   431
      ib = foo((byte)(i+1));
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 ib;
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 sum_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 += 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 sumb_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 + foo(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 sumf_deop(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   453
    Byte result = 1;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   454
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   455
        result = (byte)(result + foob(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   456
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   457
    return result;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   460
  static byte sump_deop(byte[] a, Byte result) {
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 + foob(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 sumc_deop(byte[] a) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   468
    Byte result = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   469
    for (Byte i : a)
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   470
        result = (byte)(result + foo(i));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   471
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   472
    return result;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   473
  }
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
  static byte remi_sum_deop() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   476
    Byte j = new Byte(foo((byte)1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   477
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   478
      j = new Byte(foo((byte)(j + 1)));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   479
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   480
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   481
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   482
  }
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
  static byte remi_sumb_deop() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   485
    Byte j = Byte.valueOf(foo((byte)1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   486
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   487
      j = foo((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   488
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   489
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   490
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   491
  }
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
  static byte remi_sumf_deop() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   494
    Byte j = foob((byte)1);
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_sump_deop(Byte j) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   503
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   504
      j = foo((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   505
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   506
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   507
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   508
  }
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
  static byte remi_sumc_deop() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   511
    Byte j = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   512
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   513
      j = foo((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   514
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   515
    dummy();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   516
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   517
  }
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
  // Conditional increment
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   521
  static byte remi_sum_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   522
    Byte j = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   523
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   524
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   525
        j = new Byte((byte)(j + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   526
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   527
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   528
    return j;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   531
  static byte remi_sumb_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   532
    Byte j = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   533
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   534
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   535
        j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   536
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   537
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   538
    return j;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   541
  static byte remi_sumf_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   542
    Byte j = foob((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   543
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   544
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   545
        j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   546
      }
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
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   549
  }
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
  static byte remi_sump_cond(Byte j) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   552
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   553
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   554
        j = (byte)(j + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   555
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   556
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   557
    return j;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   560
  static byte remi_sumc_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   561
    Byte j = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   562
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   563
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   564
        j = (byte)(j + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   565
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   566
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   567
    return j;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   568
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   569
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   570
  static byte remi_sum2_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   571
    Byte j1 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   572
    Byte j2 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   573
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   574
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   575
        j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   576
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   577
        j2 = new Byte((byte)(j2 + 2));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   578
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   579
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   580
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   581
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   582
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   583
  static byte remi_sumb2_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   584
    Byte j1 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   585
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   586
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   587
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   588
        j1 = (byte)(j1 + 1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   589
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   590
        j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   591
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   592
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   593
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   594
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   595
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   596
  static byte remi_summ2_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   597
    Byte j1 = new Byte((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   598
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   599
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   600
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   601
        j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   602
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   603
        j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   604
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   605
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   606
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   607
  }
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
  static byte remi_sump2_cond(Byte j1) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   610
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   611
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   612
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   613
        j1 = new Byte((byte)(j1 + 1));
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   614
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   615
        j2 = (byte)(j2 + 2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   616
      }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   617
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   618
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   619
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   620
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   621
  static byte remi_sumc2_cond() {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   622
    Byte j1 = ibc;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   623
    Byte j2 = Byte.valueOf((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   624
    for (int i = 0; i< 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   625
      if ((i&1) == 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   626
        j1 = (byte)(j1 + ibc);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   627
      } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   628
        j2 = (byte)(j2 + 2);
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
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   631
    return (byte)(j1 + j2);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   632
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   633
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   634
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   635
  public static void main(String[] args) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   636
    final int ntests = 70;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   637
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   638
    String[] test_name = new String[] {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   639
        "simple",      "simpleb",      "simplec",      "simplef",      "simplep",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   640
        "simple2",     "simpleb2",     "simplec2",     "simplem2",     "simplep2",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   641
        "simple_deop", "simpleb_deop", "simplec_deop", "simplef_deop", "simplep_deop",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   642
        "test",        "testb",        "testc",        "testm",        "testp",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   643
        "test2",       "testb2",       "testc2",       "testm2",       "testp2",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   644
        "test_deop",   "testb_deop",   "testc_deop",   "testf_deop",   "testp_deop",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   645
        "sum",         "sumb",         "sumc",         "sumf",         "sump",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   646
        "sum2",        "sumb2",        "sumc2",        "summ2",        "sump2",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   647
        "sum_deop",    "sumb_deop",    "sumc_deop",    "sumf_deop",    "sump_deop",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   648
        "remi_sum",       "remi_sumb",       "remi_sumc",       "remi_sumf",       "remi_sump",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   649
        "remi_sum2",      "remi_sumb2",      "remi_sumc2",      "remi_summ2",      "remi_sump2",
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   650
        "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
   651
        "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
   652
        "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
   653
    };
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   654
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   655
    final int[] val = new int[] {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   656
      -5488, -5488, 12000, -5488, -5488,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   657
       1024,  1024, -5552,  1024,  1024,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   658
      -5488, -5488, 12000, -5488, -5488,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   659
        512,   512,  6256,   512,   512,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   660
      13024, 13024, -5584, 13024, 13024,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   661
        512,   512,  6256,   512,   512,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   662
         45,    45,    45,    45,    45,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   663
         66,    66,    66,    66,    66,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   664
         45,    45,    45,    45,    45,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   665
        -23,   -23,   -23,   -23,   -23,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   666
        -70,   -70,   -70,   -70,   -70,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   667
        -23,   -23,   -23,   -23,   -23,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   668
        -11,   -11,   -11,   -11,   -11,
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   669
        -34,   -34,   -34,   -34,   -34
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   670
    };
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   671
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   672
    int[] res = new int[ntests];
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   673
    for (int i = 0; i < ntests; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   674
      res[i] = 0;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   675
    }
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   678
    for (int i = 0; i < 12000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   679
      res[0] += simple((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   680
      res[1] += simpleb((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   681
      res[2] += simplec();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   682
      res[3] += simplef((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   683
      res[4] += simplep((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   684
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   685
      res[5] += simple2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   686
      res[6] += simpleb2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   687
      res[7] += simplec2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   688
      res[8] += simplem2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   689
      res[9] += simplep2((byte)i, (byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   690
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   691
      res[10] += simple_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   692
      res[11] += simpleb_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   693
      res[12] += simplec_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   694
      res[13] += simplef_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   695
      res[14] += simplep_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   696
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   697
      res[15] += test((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   698
      res[16] += testb((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   699
      res[17] += testc((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   700
      res[18] += testm((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   701
      res[19] += testp((byte)i, (byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   702
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   703
      res[20] += test2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   704
      res[21] += testb2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   705
      res[22] += testc2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   706
      res[23] += testm2((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   707
      res[24] += testp2((byte)i, (byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   708
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   709
      res[25] += test_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   710
      res[26] += testb_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   711
      res[27] += testc_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   712
      res[28] += testf_deop((byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   713
      res[29] += testp_deop((byte)i, (byte)i);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   714
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   715
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   716
    byte[] ia = new byte[1000];
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   717
    for (int i = 0; i < 1000; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   718
      ia[i] = (byte)i;
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   721
    for (int i = 0; i < 100; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   722
      res[30] = sum(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   723
      res[31] = sumb(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   724
      res[32] = sumc(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   725
      res[33] = sumf(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   726
      res[34] = sump(ia, (byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   727
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   728
      res[35] = sum2(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   729
      res[36] = sumb2(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   730
      res[37] = sumc2(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   731
      res[38] = summ2(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   732
      res[39] = sump2(ia, (byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   733
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   734
      res[40] = sum_deop(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   735
      res[41] = sumb_deop(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   736
      res[42] = sumc_deop(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   737
      res[43] = sumf_deop(ia);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   738
      res[44] = sump_deop(ia, (byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   739
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   740
      res[45] = remi_sum();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   741
      res[46] = remi_sumb();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   742
      res[47] = remi_sumc();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   743
      res[48] = remi_sumf();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   744
      res[49] = remi_sump((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   745
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   746
      res[50] = remi_sum2();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   747
      res[51] = remi_sumb2();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   748
      res[52] = remi_sumc2();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   749
      res[53] = remi_summ2();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   750
      res[54] = remi_sump2((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   751
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   752
      res[55] = remi_sum_deop();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   753
      res[56] = remi_sumb_deop();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   754
      res[57] = remi_sumc_deop();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   755
      res[58] = remi_sumf_deop();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   756
      res[59] = remi_sump_deop((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   757
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   758
      res[60] = remi_sum_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   759
      res[61] = remi_sumb_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   760
      res[62] = remi_sumc_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   761
      res[63] = remi_sumf_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   762
      res[64] = remi_sump_cond((byte)1);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   763
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   764
      res[65] = remi_sum2_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   765
      res[66] = remi_sumb2_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   766
      res[67] = remi_sumc2_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   767
      res[68] = remi_summ2_cond();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   768
      res[69] = remi_sump2_cond((byte)1);
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
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   771
    int failed = 0;
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   772
    for (int i = 0; i < ntests; i++) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   773
      if (res[i] != val[i]) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   774
        System.err.println(test_name[i] + ": " + res[i] + " != " + val[i]);
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   775
        failed++;
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
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   778
    if (failed > 0) {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   779
      System.err.println("Failed " + failed + " tests.");
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   780
      throw new InternalError();
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   781
    } else {
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   782
      System.out.println("Passed.");
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   783
    }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   784
  }
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents:
diff changeset
   785
}