< prev index next >

test/hotspot/jtreg/compiler/loopopts/SplitIfSharedFastLockBehindCastPP.java

Print this page
*** 1,6 ***
--- 1,7 ---
  /*
+  * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
   * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as

*** 68,21 ***
                  field = true;
              }
          }
      }
  
      private static Object test2(boolean flag) {
          int integer;
          if (flag) {
              field = true;
              integer = 1;
          } else {
              field = false;
              integer = 2;
          }
  
!         Object obj = integer;
  
          // This loop will be unswitched. The condition becomes candidate for split if
          for (int i = 0; i < 100; i++) {
              if (integer == 1) {
                  field = true;
--- 69,29 ---
                  field = true;
              }
          }
      }
  
+     static class MyBox {
+         int val;
+ 
+         public MyBox(int val) {
+             this.val = val;
+         }
+     }
+ 
      private static Object test2(boolean flag) {
          int integer;
          if (flag) {
              field = true;
              integer = 1;
          } else {
              field = false;
              integer = 2;
          }
  
!         Object obj = new MyBox(integer);
  
          // This loop will be unswitched. The condition becomes candidate for split if
          for (int i = 0; i < 100; i++) {
              if (integer == 1) {
                  field = true;
< prev index next >