From c7a2c07ca83fd20eb692efaee7a3612fe7a106d9 Mon Sep 17 00:00:00 2001 From: Jini George Date: Wed, 31 Aug 2016 11:46:59 +0300 Subject: [PATCH] 8163150: SA: CLHSDB printmdo throws an exception with "java.lang.InternalError: missing reason for 22" Accounted for the new JVMCI related Deoptimization Reasons. Reviewed-by: dsamersoff, sla --- .../sun/tools/jhsdb/BasicLauncherTest.java | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java index 57651e69c87..7c9cc31da5a 100644 --- a/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java +++ b/jdk/test/sun/tools/jhsdb/BasicLauncherTest.java @@ -85,20 +85,52 @@ public class BasicLauncherTest { try (OutputStream out = toolProcess.getOutputStream()) { out.write("universe\n".getBytes()); + out.write("printmdo -a\n".getBytes()); out.write("quit\n".getBytes()); } // By default child process output stream redirected to pipe, so we are reading it in foreground. Exception unexpected = null; - try (BufferedReader reader = new BufferedReader(new InputStreamReader(toolProcess.getInputStream()))) { + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(toolProcess.getInputStream()))) { String line; + String unexpectedMsg = + "One or more of 'VirtualCallData', 'CounterData', " + + "'ReceiverTypeData', 'bci', 'MethodData' " + + "or 'java/lang/Object' not found"; + boolean knownClassFound = false; + boolean knownProfileDataTypeFound = false; + boolean knownTokensFound = false; + while ((line = reader.readLine()) != null) { line = line.trim(); System.out.println(line); if (line.contains("unknown subtype of CollectedHeap")) { unexpected = new RuntimeException("CollectedHeap type should be known."); + break; } + else if (line.contains("missing reason for ")) { + unexpected = new RuntimeException("missing reason for "); + break; + } + if (line.contains("VirtualCallData") || + line.contains("CounterData") || + line.contains("ReceiverTypeData")) { + knownProfileDataTypeFound = true; + } + if (line.contains("bci") || + line.contains("MethodData")) { + knownTokensFound = true; + } + if (line.contains("java/lang/Object")) { + knownClassFound = true; + } + } + if ((knownClassFound == false) || + (knownTokensFound == false) || + (knownProfileDataTypeFound == false)) { + unexpected = new RuntimeException(unexpectedMsg); } }