Skip to content

Commit ff00c59

Browse files
committed
8256569: Add C2 compiler stress flags to CTW
Reviewed-by: kvn, shade, thartmann
1 parent e7c7469 commit ff00c59

File tree

1 file changed

+9
-1
lines changed
  • test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw

1 file changed

+9
-1
lines changed

test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -257,6 +257,7 @@ private Pair<String, Long> getLastClass(Path errFile) {
257257
private String[] cmd(long classStart, long classStop) {
258258
String phase = phaseName(classStart);
259259
Path file = Paths.get(phase + ".cmd");
260+
var rng = Utils.getRandomInstance();
260261
try {
261262
Files.write(file, List.of(
262263
"-Xbatch",
@@ -283,6 +284,13 @@ private String[] cmd(long classStart, long classStop) {
283284
String.format("-XX:ReplayDataFile=replay_%s_%%p.log", phase),
284285
// MethodHandle MUST NOT be compiled
285286
"-XX:CompileCommand=exclude,java/lang/invoke/MethodHandle.*",
287+
// Stress* are c2-specific stress flags, so IgnoreUnrecognizedVMOptions is needed
288+
"-XX:+IgnoreUnrecognizedVMOptions",
289+
"-XX:+StressLCM",
290+
"-XX:+StressGCM",
291+
"-XX:+StressIGVN",
292+
// StressSeed is uint
293+
"-XX:StressSeed=" + Math.abs(rng.nextLong()),
286294
// CTW entry point
287295
CompileTheWorld.class.getName(),
288296
target));

0 commit comments

Comments
 (0)