-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8275868: ciReplay: Inlining fails with "unloaded signature classes" d…
…ue to wrong protection domains Reviewed-by: kvn, dlong, thartmann
- Loading branch information
1 parent
158831e
commit 5bb1992
Showing
5 changed files
with
438 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
test/hotspot/jtreg/compiler/ciReplay/DumpReplayBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* Copyright (c) 2021, 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 | ||
* under the terms of the GNU General Public License version 2 only, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This code is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* version 2 for more details (a copy is included in the LICENSE file that | ||
* accompanied this code). | ||
* | ||
* You should have received a copy of the GNU General Public License version | ||
* 2 along with this work; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
* | ||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
* or visit www.oracle.com if you need additional information or have any | ||
* questions. | ||
*/ | ||
|
||
package compiler.ciReplay; | ||
|
||
import jdk.test.lib.Asserts; | ||
import jdk.test.lib.process.OutputAnalyzer; | ||
import jdk.test.lib.process.ProcessTools; | ||
|
||
import java.io.File; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
import java.util.stream.Collectors; | ||
|
||
public abstract class DumpReplayBase extends CiReplayBase { | ||
|
||
private static final String DUMP_REPLAY_PATTERN = "replay_pid"; | ||
private List<File> replayFiles; | ||
private String replayFileName; | ||
|
||
@Override | ||
public void runTest(boolean needCoreDump, String... args) { | ||
throw new RuntimeException("use runTests(String...)"); | ||
} | ||
|
||
public void runTest(String... args) { | ||
if (generateReplay(args)) { | ||
testAction(); | ||
cleanup(); | ||
} else { | ||
throw new Error("Host is not configured to generate cores"); | ||
} | ||
} | ||
|
||
@Override | ||
public void cleanup() { | ||
replayFiles.forEach(f -> remove(f.getName())); | ||
} | ||
|
||
@Override | ||
public String getReplayFileName() { | ||
Asserts.assertEQ(replayFiles.size(), 1, "Test should only dump 1 replay file when trying to replay compile"); | ||
return replayFileName; | ||
} | ||
|
||
public boolean generateReplay(String... vmopts) { | ||
OutputAnalyzer oa; | ||
try { | ||
List<String> options = new ArrayList<>(Arrays.asList(vmopts)); | ||
options.add("-XX:CompileCommand=option," + getTestClass() + "::" + getTestMethod() + ",bool,DumpReplay,true"); | ||
options.add("-XX:+IgnoreUnrecognizedVMOptions"); | ||
options.add("-XX:TypeProfileLevel=222"); | ||
options.add("-XX:CompileCommand=compileonly," + getTestClass() + "::" + getTestMethod()); | ||
options.add("-Xbatch"); | ||
options.add(getTestClass()); | ||
oa = ProcessTools.executeProcess(ProcessTools.createTestJvm(options)); | ||
Asserts.assertEquals(oa.getExitValue(), 0, "Crash JVM exits gracefully"); | ||
replayFiles = Files.list(Paths.get(".")) | ||
.map(Path::toFile) | ||
.filter(f -> f.getName().startsWith(DUMP_REPLAY_PATTERN)).collect(Collectors.toList()); | ||
Asserts.assertFalse(replayFiles.isEmpty(), "Did not find a replay file starting with " + DUMP_REPLAY_PATTERN); | ||
replayFileName = replayFiles.get(0).getName(); | ||
} catch (Throwable t) { | ||
throw new Error("Can't create replay: " + t, t); | ||
} | ||
return true; | ||
} | ||
|
||
public int getCompileIdFromFile(String replayFileName) { | ||
Pattern p = Pattern.compile("replay_pid.*_compid([0-9]+)\\.log"); | ||
Matcher matcher = p.matcher(replayFileName); | ||
if (matcher.find()) { | ||
try { | ||
return Integer.parseInt(matcher.group(1)); | ||
} catch (NumberFormatException e) { | ||
throw new RuntimeException("Could not parse compile id from filename \"" + replayFileName + "\""); | ||
} | ||
} else { | ||
throw new RuntimeException("Could not find compile id in filename \"" + replayFileName + "\""); | ||
} | ||
} | ||
|
||
public List<File> getReplayFiles() { | ||
return replayFiles; | ||
} | ||
} |
Oops, something went wrong.
5bb1992
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues