492 jt->reset_last_Java_frame(); 493 } 494 #else 495 if (jt->has_last_Java_frame()) { 496 st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)"); 497 for(StackFrameStream sfs(jt); !sfs.is_done(); sfs.next()) { 498 sfs.current()->print_on_error(st, buf, sizeof(buf)); 499 st->cr(); 500 } 501 } 502 #endif // ZERO 503 } 504 505 STEP(135, "(printing target Java thread stack)" ) 506 507 // printing Java thread stack trace if it is involved in GC crash 508 if (_verbose && (_thread->is_Named_thread())) { 509 JavaThread* jt = ((NamedThread *)_thread)->processed_thread(); 510 if (jt != NULL) { 511 st->print_cr("JavaThread " PTR_FORMAT " (nid = " UINTX_FORMAT ") was being processed", jt, jt->osthread()->thread_id()); 512 if (jt->has_last_Java_frame()) { 513 st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)"); 514 for(StackFrameStream sfs(jt); !sfs.is_done(); sfs.next()) { 515 sfs.current()->print_on_error(st, buf, sizeof(buf), true); 516 st->cr(); 517 } 518 } 519 } 520 } 521 522 STEP(140, "(printing VM operation)" ) 523 524 if (_verbose && _thread && _thread->is_VM_thread()) { 525 VMThread* t = (VMThread*)_thread; 526 VM_Operation* op = t->vm_operation(); 527 if (op) { 528 op->print_on_error(st); 529 st->cr(); 530 st->cr(); 531 } 532 } 533 534 STEP(150, "(printing current compile task)" ) 535 536 if (_verbose && _thread && _thread->is_Compiler_thread()) { 537 CompilerThread* t = (CompilerThread*)_thread; 538 if (t->task()) { | 492 jt->reset_last_Java_frame(); 493 } 494 #else 495 if (jt->has_last_Java_frame()) { 496 st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)"); 497 for(StackFrameStream sfs(jt); !sfs.is_done(); sfs.next()) { 498 sfs.current()->print_on_error(st, buf, sizeof(buf)); 499 st->cr(); 500 } 501 } 502 #endif // ZERO 503 } 504 505 STEP(135, "(printing target Java thread stack)" ) 506 507 // printing Java thread stack trace if it is involved in GC crash 508 if (_verbose && (_thread->is_Named_thread())) { 509 JavaThread* jt = ((NamedThread *)_thread)->processed_thread(); 510 if (jt != NULL) { 511 st->print_cr("JavaThread " PTR_FORMAT " (nid = " UINTX_FORMAT ") was being processed", jt, jt->osthread()->thread_id()); 512 #ifdef ZERO 513 if (jt->zero_stack()->sp() && jt->top_zero_frame()) { 514 // StackFrameStream uses the frame anchor, which may not have 515 // been set up. This can be done at any time in Zero, however, 516 // so if it hasn't been set up then we just set it up now and 517 // clear it again when we're done. 518 bool has_last_Java_frame = jt->has_last_Java_frame(); 519 if (!has_last_Java_frame) 520 jt->set_last_Java_frame(); 521 st->print("Java frames:"); 522 523 // If the top frame is a Shark frame and the frame anchor isn't 524 // set up then it's possible that the information in the frame 525 // is garbage: it could be from a previous decache, or it could 526 // simply have never been written. So we print a warning... 527 StackFrameStream sfs(jt); 528 if (!has_last_Java_frame && !sfs.is_done()) { 529 if (sfs.current()->zeroframe()->is_shark_frame()) { 530 st->print(" (TOP FRAME MAY BE JUNK)"); 531 } 532 } 533 st->cr(); 534 535 // Print the frames 536 for(int i = 0; !sfs.is_done(); sfs.next(), i++) { 537 sfs.current()->zero_print_on_error(i, st, buf, sizeof(buf)); 538 st->cr(); 539 } 540 541 // Reset the frame anchor if necessary 542 if (!has_last_Java_frame) 543 jt->reset_last_Java_frame(); 544 } 545 #else 546 if (jt->has_last_Java_frame()) { 547 st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)"); 548 for(StackFrameStream sfs(jt); !sfs.is_done(); sfs.next()) { 549 sfs.current()->print_on_error(st, buf, sizeof(buf), true); 550 st->cr(); 551 } 552 } 553 #endif // ZERO 554 } 555 } 556 557 STEP(140, "(printing VM operation)" ) 558 559 if (_verbose && _thread && _thread->is_VM_thread()) { 560 VMThread* t = (VMThread*)_thread; 561 VM_Operation* op = t->vm_operation(); 562 if (op) { 563 op->print_on_error(st); 564 st->cr(); 565 st->cr(); 566 } 567 } 568 569 STEP(150, "(printing current compile task)" ) 570 571 if (_verbose && _thread && _thread->is_Compiler_thread()) { 572 CompilerThread* t = (CompilerThread*)_thread; 573 if (t->task()) { |