8256569: Add C2 compiler stress flags to CTW

Reviewed-by: kvn, shade, thartmann
This commit is contained in:
Igor Ignatyev 2020-11-20 15:01:37 +00:00
parent e7c7469cf5
commit ff00c591c3

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. 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
@ -257,6 +257,7 @@ public class CtwRunner {
private String[] cmd(long classStart, long classStop) {
String phase = phaseName(classStart);
Path file = Paths.get(phase + ".cmd");
var rng = Utils.getRandomInstance();
try {
Files.write(file, List.of(
"-Xbatch",
@ -283,6 +284,13 @@ public class CtwRunner {
String.format("-XX:ReplayDataFile=replay_%s_%%p.log", phase),
// MethodHandle MUST NOT be compiled
"-XX:CompileCommand=exclude,java/lang/invoke/MethodHandle.*",
// Stress* are c2-specific stress flags, so IgnoreUnrecognizedVMOptions is needed
"-XX:+IgnoreUnrecognizedVMOptions",
"-XX:+StressLCM",
"-XX:+StressGCM",
"-XX:+StressIGVN",
// StressSeed is uint
"-XX:StressSeed=" + Math.abs(rng.nextLong()),
// CTW entry point
CompileTheWorld.class.getName(),
target));