8145025: compiler/compilercontrol/commandfile/CompileOnlyTest.java and compiler/compilercontrol/commands/CompileOnlyTest.java fail: java.lang.RuntimeException:
authorppunegov
Fri, 15 Jan 2016 16:36:43 +0300
changeset 35566 034e1bc6f382
parent 35565 ba5fe4d701e4
child 35567 4b293ebd9ef9
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
hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java
--- 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