8145025: compiler/compilercontrol/commandfile/CompileOnlyTest.java and compiler/compilercontrol/commands/CompileOnlyTest.java fail: java.lang.RuntimeException:
Summary: Fix incorrect compileonly setting
Reviewed-by: kvn, neliasso
--- a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java Fri Jan 15 09:15:33 2016 +0100
+++ b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java Fri Jan 15 16:36:43 2016 +0300
@@ -105,15 +105,15 @@
Map<Executable, State> states = new HashMap<>();
for (Pair<Executable, Callable<?>> pair : METHODS) {
Executable exec = pair.first;
- State state = getState(commandList, states, exec);
+ State state = getState(commandList, exec);
states.put(exec, state);
}
return states;
}
private State getState(List<CompileCommand> commandList,
- Map<Executable, State> states, Executable exec) {
- State state = states.getOrDefault(exec, new State());
+ Executable exec) {
+ State state = new State();
MethodDescriptor execDesc = new MethodDescriptor(exec);
for (CompileCommand compileCommand : commandList) {
if (compileCommand.isValid()) {
@@ -149,7 +149,8 @@
&& (compileCommand.command == Command.COMPILEONLY)) {
MethodDescriptor md = compileCommand.methodDescriptor;
if (!execDesc.getCanonicalString().matches(md.getRegexp())
- && (state.getCompilableOptional(
+ // if compilation state wasn't set before
+ && (!state.getCompilableOptional(
// no matter C1, C2 or both
Scenario.Compiler.C2).isPresent())) {
/* compileonly excludes only methods that haven't been