< prev index next >

src/hotspot/share/runtime/frame.cpp

Print this page

 556   jint i;
 557   for (i = 0; i < interpreter_frame_method()->max_locals(); i++ ) {
 558     intptr_t x = *interpreter_frame_local_at(i);
 559     st->print(" - local  [" INTPTR_FORMAT "]", x);
 560     st->fill_to(23);
 561     st->print_cr("; #%d", i);
 562   }
 563   for (i = interpreter_frame_expression_stack_size() - 1; i >= 0; --i ) {
 564     intptr_t x = *interpreter_frame_expression_stack_at(i);
 565     st->print(" - stack  [" INTPTR_FORMAT "]", x);
 566     st->fill_to(23);
 567     st->print_cr("; #%d", i);
 568   }
 569   // locks for synchronization
 570   for (BasicObjectLock* current = interpreter_frame_monitor_end();
 571        current < interpreter_frame_monitor_begin();
 572        current = next_monitor_in_interpreter_frame(current)) {
 573     st->print(" - obj    [");
 574     current->obj()->print_value_on(st);
 575     st->print_cr("]");
 576     st->print(" - lock   [");
 577     current->lock()->print_on(st, current->obj());
 578     st->print_cr("]");
 579   }
 580   // monitor
 581   st->print_cr(" - monitor[" INTPTR_FORMAT "]", p2i(interpreter_frame_monitor_begin()));
 582   // bcp
 583   st->print(" - bcp    [" INTPTR_FORMAT "]", p2i(interpreter_frame_bcp()));
 584   st->fill_to(23);
 585   st->print_cr("; @%d", interpreter_frame_bci());
 586   // locals
 587   st->print_cr(" - locals [" INTPTR_FORMAT "]", p2i(interpreter_frame_local_at(0)));
 588   // method
 589   st->print(" - method [" INTPTR_FORMAT "]", p2i(interpreter_frame_method()));
 590   st->fill_to(23);
 591   st->print("; ");
 592   interpreter_frame_method()->print_name(st);
 593   st->cr();
 594 #endif
 595 }
 596 
 597 // Print whether the frame is in the VM or OS indicating a HotSpot problem.
 598 // Otherwise, it's likely a bug in the native library that the Java code calls,

1067 // check local reg_map for it being a callee-save register or argument
1068 // register, both of which are saved in the local frame.  If not found
1069 // there, it must be an in-stack argument of the caller.
1070 // Note: caller.sp() points to callee-arguments
1071 oop frame::retrieve_receiver(RegisterMap* reg_map) {
1072   frame caller = *this;
1073 
1074   // First consult the ADLC on where it puts parameter 0 for this signature.
1075   VMReg reg = SharedRuntime::name_for_receiver();
1076   oop* oop_adr = caller.oopmapreg_to_oop_location(reg, reg_map);
1077   if (oop_adr == NULL) {
1078     guarantee(oop_adr != NULL, "bad register save location");
1079     return NULL;
1080   }
1081   oop r = *oop_adr;
1082   assert(Universe::heap()->is_in_or_null(r), "bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", p2i(r), p2i(r));
1083   return r;
1084 }
1085 
1086 
1087 BasicLock* frame::get_native_monitor() {
1088   nmethod* nm = (nmethod*)_cb;
1089   assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(),
1090          "Should not call this unless it's a native nmethod");
1091   int byte_offset = in_bytes(nm->native_basic_lock_sp_offset());
1092   assert(byte_offset >= 0, "should not see invalid offset");
1093   return (BasicLock*) &sp()[byte_offset / wordSize];
1094 }
1095 
1096 oop frame::get_native_receiver() {
1097   nmethod* nm = (nmethod*)_cb;
1098   assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(),
1099          "Should not call this unless it's a native nmethod");
1100   int byte_offset = in_bytes(nm->native_receiver_sp_offset());
1101   assert(byte_offset >= 0, "should not see invalid offset");
1102   oop owner = ((oop*) sp())[byte_offset / wordSize];
1103   assert( Universe::heap()->is_in(owner), "bad receiver" );
1104   return owner;
1105 }
1106 
1107 void frame::oops_entry_do(OopClosure* f, const RegisterMap* map) const {
1108   assert(map != NULL, "map must be set");
1109   if (map->include_argument_oops()) {
1110     // must collect argument oops, as nobody else is doing it
1111     Thread *thread = Thread::current();
1112     methodHandle m (thread, entry_frame_call_wrapper()->callee_method());
1113     EntryFrameOopFinder finder(this, m->signature(), m->is_static());
1114     finder.arguments_do(f);
1115   }

 556   jint i;
 557   for (i = 0; i < interpreter_frame_method()->max_locals(); i++ ) {
 558     intptr_t x = *interpreter_frame_local_at(i);
 559     st->print(" - local  [" INTPTR_FORMAT "]", x);
 560     st->fill_to(23);
 561     st->print_cr("; #%d", i);
 562   }
 563   for (i = interpreter_frame_expression_stack_size() - 1; i >= 0; --i ) {
 564     intptr_t x = *interpreter_frame_expression_stack_at(i);
 565     st->print(" - stack  [" INTPTR_FORMAT "]", x);
 566     st->fill_to(23);
 567     st->print_cr("; #%d", i);
 568   }
 569   // locks for synchronization
 570   for (BasicObjectLock* current = interpreter_frame_monitor_end();
 571        current < interpreter_frame_monitor_begin();
 572        current = next_monitor_in_interpreter_frame(current)) {
 573     st->print(" - obj    [");
 574     current->obj()->print_value_on(st);
 575     st->print_cr("]");



 576   }
 577   // monitor
 578   st->print_cr(" - monitor[" INTPTR_FORMAT "]", p2i(interpreter_frame_monitor_begin()));
 579   // bcp
 580   st->print(" - bcp    [" INTPTR_FORMAT "]", p2i(interpreter_frame_bcp()));
 581   st->fill_to(23);
 582   st->print_cr("; @%d", interpreter_frame_bci());
 583   // locals
 584   st->print_cr(" - locals [" INTPTR_FORMAT "]", p2i(interpreter_frame_local_at(0)));
 585   // method
 586   st->print(" - method [" INTPTR_FORMAT "]", p2i(interpreter_frame_method()));
 587   st->fill_to(23);
 588   st->print("; ");
 589   interpreter_frame_method()->print_name(st);
 590   st->cr();
 591 #endif
 592 }
 593 
 594 // Print whether the frame is in the VM or OS indicating a HotSpot problem.
 595 // Otherwise, it's likely a bug in the native library that the Java code calls,

1064 // check local reg_map for it being a callee-save register or argument
1065 // register, both of which are saved in the local frame.  If not found
1066 // there, it must be an in-stack argument of the caller.
1067 // Note: caller.sp() points to callee-arguments
1068 oop frame::retrieve_receiver(RegisterMap* reg_map) {
1069   frame caller = *this;
1070 
1071   // First consult the ADLC on where it puts parameter 0 for this signature.
1072   VMReg reg = SharedRuntime::name_for_receiver();
1073   oop* oop_adr = caller.oopmapreg_to_oop_location(reg, reg_map);
1074   if (oop_adr == NULL) {
1075     guarantee(oop_adr != NULL, "bad register save location");
1076     return NULL;
1077   }
1078   oop r = *oop_adr;
1079   assert(Universe::heap()->is_in_or_null(r), "bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", p2i(r), p2i(r));
1080   return r;
1081 }
1082 
1083 









1084 oop frame::get_native_receiver() {
1085   nmethod* nm = (nmethod*)_cb;
1086   assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(),
1087          "Should not call this unless it's a native nmethod");
1088   int byte_offset = in_bytes(nm->native_receiver_sp_offset());
1089   assert(byte_offset >= 0, "should not see invalid offset");
1090   oop owner = ((oop*) sp())[byte_offset / wordSize];
1091   assert( Universe::heap()->is_in(owner), "bad receiver" );
1092   return owner;
1093 }
1094 
1095 void frame::oops_entry_do(OopClosure* f, const RegisterMap* map) const {
1096   assert(map != NULL, "map must be set");
1097   if (map->include_argument_oops()) {
1098     // must collect argument oops, as nobody else is doing it
1099     Thread *thread = Thread::current();
1100     methodHandle m (thread, entry_frame_call_wrapper()->callee_method());
1101     EntryFrameOopFinder finder(this, m->signature(), m->is_static());
1102     finder.arguments_do(f);
1103   }
< prev index next >