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