test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff test/compiler/arraycopy

test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java

Print this page
rev 8008 : 8073866: Fix for 8064703 is not sufficient
Summary: side effects between allocation and arraycopy can be reexecuted, unreachable uninitialized array can be seen by GCs
Reviewed-by:


  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 8072016
  27  * @summary Infinite deoptimization/recompilation cycles in case of arraycopy with tightly coupled allocation
  28  * @library /testlibrary /../../test/lib /compiler/whitebox
  29  * @build TestArrayCopyNoInitDeopt
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
  32  * @run main/othervm -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI

  33  *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020
  34  *                   TestArrayCopyNoInitDeopt
  35  *
  36  */
  37 
  38 
  39 import sun.hotspot.WhiteBox;
  40 import sun.hotspot.code.NMethod;
  41 import com.oracle.java.testlibrary.Platform;
  42 import java.lang.reflect.*;
  43 
  44 public class TestArrayCopyNoInitDeopt {
  45 
  46     public static int[] m1(Object src) {
  47         if (src == null) return null;
  48         int[] dest = new int[10];
  49         try {
  50             System.arraycopy(src, 0, dest, 0, 10);
  51         } catch (ArrayStoreException npe) {
  52         }




  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 8072016
  27  * @summary Infinite deoptimization/recompilation cycles in case of arraycopy with tightly coupled allocation
  28  * @library /testlibrary /../../test/lib /compiler/whitebox
  29  * @build TestArrayCopyNoInitDeopt
  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  * @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
  32  * @run main/othervm -Xmixed -XX:Tier4InvocationThreshold=5000 -XX:Tier3InvokeNotifyFreqLog=10
  33  *                    -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  34  *                   -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:TypeProfileLevel=020
  35  *                   TestArrayCopyNoInitDeopt
  36  *
  37  */
  38 
  39 
  40 import sun.hotspot.WhiteBox;
  41 import sun.hotspot.code.NMethod;
  42 import com.oracle.java.testlibrary.Platform;
  43 import java.lang.reflect.*;
  44 
  45 public class TestArrayCopyNoInitDeopt {
  46 
  47     public static int[] m1(Object src) {
  48         if (src == null) return null;
  49         int[] dest = new int[10];
  50         try {
  51             System.arraycopy(src, 0, dest, 0, 10);
  52         } catch (ArrayStoreException npe) {
  53         }


test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File