changeset 8787:3d2f377c9a21

8132242: LogTouchedMethods (8025692) asserts if TieredCompilation is off. Summary: LogTouchedMethods causes the template interpreter to generate profiling code even if no compiler is used. If TieredCompilation is off, code containing an assertion that checks that UseCompiler is set, is reached. This assertion exists on the sparc and ppc platforms. Reviewed-by: simonis, iklam, minqi Contributed-by: goetz.lindenmaier@sap.com
author minqi
date Wed, 29 Jul 2015 15:08:42 -0700
parents e8351756255d
children 9370b1fc828e
files src/cpu/ppc/vm/interp_masm_ppc_64.cpp src/cpu/sparc/vm/interp_masm_sparc.cpp test/runtime/CommandLine/PrintTouchedMethods.java
diffstat 3 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Mon Jul 27 13:56:26 2015 -0700
+++ b/src/cpu/ppc/vm/interp_masm_ppc_64.cpp	Wed Jul 29 15:08:42 2015 -0700
@@ -2187,7 +2187,7 @@
 }
 
 void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, Register iv_be_count, Register Rtmp_r0) {
-  assert(UseCompiler, "incrementing must be useful");
+  assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
   Register invocation_count = iv_be_count;
   Register backedge_count   = Rtmp_r0;
   int delta = InvocationCounter::count_increment;
--- a/src/cpu/sparc/vm/interp_masm_sparc.cpp	Mon Jul 27 13:56:26 2015 -0700
+++ b/src/cpu/sparc/vm/interp_masm_sparc.cpp	Wed Jul 29 15:08:42 2015 -0700
@@ -2314,7 +2314,7 @@
 }
 
 void InterpreterMacroAssembler::increment_invocation_counter( Register Rcounters, Register Rtmp, Register Rtmp2 ) {
-  assert(UseCompiler, "incrementing must be useful");
+  assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
   assert_different_registers(Rcounters, Rtmp, Rtmp2);
 
   Address inv_counter(Rcounters, MethodCounters::invocation_counter_offset() +
--- a/test/runtime/CommandLine/PrintTouchedMethods.java	Mon Jul 27 13:56:26 2015 -0700
+++ b/test/runtime/CommandLine/PrintTouchedMethods.java	Wed Jul 29 15:08:42 2015 -0700
@@ -87,6 +87,24 @@
       output.shouldNotContain("TestLogTouchedMethods.methodB:()V");
       output.shouldHaveExitValue(0);
 
+      String[] javaArgs4 = {"-XX:+UnlockDiagnosticVMOptions", "-Xint", "-XX:+LogTouchedMethods", "-XX:+PrintTouchedMethodsAtExit", "-XX:-TieredCompilation", "TestLogTouchedMethods"};
+      pb = ProcessTools.createJavaProcessBuilder(javaArgs4);
+      output = new OutputAnalyzer(pb.start());
+      lines = output.asLines();
+
+      if (lines.size() < 1) {
+        throw new Exception("Empty output");
+      }
+
+      first = lines.get(0);
+      if (!first.equals("# Method::print_touched_methods version 1")) {
+        throw new Exception("First line mismatch");
+      }
+
+      output.shouldContain("TestLogTouchedMethods.methodA:()V");
+      output.shouldNotContain("TestLogTouchedMethods.methodB:()V");
+      output.shouldHaveExitValue(0);
+
       // Test jcmd PrintTouchedMethods VM.print_touched_methods
       String pid = Integer.toString(ProcessTools.getProcessId());
       pb = new ProcessBuilder();