< prev index next >

test/compiler/escapeAnalysis/Test8020215.java

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


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8020215
  27  * @summary Different execution plan when using JIT vs interpreter
  28  * @run main Test8020215

  29  */
  30 


  31 import java.util.ArrayList;
  32 import java.util.List;
  33 
  34 public class Test8020215 {
  35     public static class NamedObject {
  36         public int id;
  37         public String name;
  38         public NamedObject(int id, String name) {
  39             this.id = id;
  40             this.name = name;
  41         }
  42     }
  43 
  44     public static class NamedObjectList {
  45         public List<NamedObject> namedObjectList = new ArrayList<NamedObject>();
  46 
  47         public NamedObject getBest(int id) {
  48             NamedObject bestObject = null;
  49             for (NamedObject o : namedObjectList) {
  50                 bestObject = id==o.id ? getBetter(bestObject, o) : bestObject;




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test
  26  * @bug 8020215
  27  * @summary Different execution plan when using JIT vs interpreter
  28  *
  29  * @run main compiler.escapeAnalysis.Test8020215
  30  */
  31 
  32 package compiler.escapeAnalysis;
  33 
  34 import java.util.ArrayList;
  35 import java.util.List;
  36 
  37 public class Test8020215 {
  38     public static class NamedObject {
  39         public int id;
  40         public String name;
  41         public NamedObject(int id, String name) {
  42             this.id = id;
  43             this.name = name;
  44         }
  45     }
  46 
  47     public static class NamedObjectList {
  48         public List<NamedObject> namedObjectList = new ArrayList<NamedObject>();
  49 
  50         public NamedObject getBest(int id) {
  51             NamedObject bestObject = null;
  52             for (NamedObject o : namedObjectList) {
  53                 bestObject = id==o.id ? getBetter(bestObject, o) : bestObject;


< prev index next >