8183151: DCmd Compiler.codelist should print all compiled methods

Add support for AOT methods in codelist dcmd

Reviewed-by: neliasso, kvn
This commit is contained in:
Christian Thalinger 2017-07-03 11:41:19 +02:00 committed by Nils Eliasson
parent 5ae3d88bb7
commit 340108f92b
2 changed files with 18 additions and 9 deletions

View File

@ -1609,14 +1609,15 @@ void CodeCache::print_summary(outputStream* st, bool detailed) {
void CodeCache::print_codelist(outputStream* st) {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
NMethodIterator iter;
while(iter.next_alive()) {
nmethod* nm = iter.method();
CompiledMethodIterator iter;
while (iter.next_alive()) {
CompiledMethod* cm = iter.method();
ResourceMark rm;
char *method_name = nm->method()->name_and_sig_as_C_string();
st->print_cr("%d %d %s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]",
nm->compile_id(), nm->comp_level(), method_name, (intptr_t)nm->header_begin(),
(intptr_t)nm->code_begin(), (intptr_t)nm->code_end());
char* method_name = cm->method()->name_and_sig_as_C_string();
st->print_cr("%d %d %d %s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]",
cm->compile_id(), cm->comp_level(), cm->get_state(),
method_name,
(intptr_t)cm->header_begin(), (intptr_t)cm->code_begin(), (intptr_t)cm->code_end());
}
}

View File

@ -118,9 +118,17 @@ public class CodelistTest {
if (line.contains("CodelistTest.testcaseMethod")) {
String[] parts = line.split(" ");
int compileID = Integer.parseInt(parts[0]);
int compileLevel = Integer.parseInt(parts[1]);
String str = parts[2];
Assert.assertTrue(compileID > 0, "CompileID must be positive");
int compileLevel = Integer.parseInt(parts[1]);
Assert.assertTrue(compileLevel >= -1, "CompileLevel must be at least -1 (AOT)");
Assert.assertTrue(compileLevel <= 4, "CompileLevel must be at most 4 (C2)");
int codeState = Integer.parseInt(parts[2]);
Assert.assertTrue(codeState >= 0, "CodeState must be at least 0 (In Use)");
Assert.assertTrue(codeState <= 4, "CodeState must be at most 4 (Unloaded)");
String str = parts[3];
for (TestCase testcase : testcases) {
if (str.contains(testcase.methodName)) {
Assert.assertFalse(testcase.check, "Must not be found or already found.");