< prev index next >

src/share/vm/runtime/frame.cpp

Print this page




1005 }
1006 
1007 
1008 // Get receiver out of callers frame, i.e. find parameter 0 in callers
1009 // frame.  Consult ADLC for where parameter 0 is to be found.  Then
1010 // check local reg_map for it being a callee-save register or argument
1011 // register, both of which are saved in the local frame.  If not found
1012 // there, it must be an in-stack argument of the caller.
1013 // Note: caller.sp() points to callee-arguments
1014 oop frame::retrieve_receiver(RegisterMap* reg_map) {
1015   frame caller = *this;
1016 
1017   // First consult the ADLC on where it puts parameter 0 for this signature.
1018   VMReg reg = SharedRuntime::name_for_receiver();
1019   oop* oop_adr = caller.oopmapreg_to_location(reg, reg_map);
1020   if (oop_adr == NULL) {
1021     guarantee(oop_adr != NULL, "bad register save location");
1022     return NULL;
1023   }
1024   oop r = *oop_adr;
1025   assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (void *) r, (void *) r));
1026   return r;
1027 }
1028 
1029 
1030 oop* frame::oopmapreg_to_location(VMReg reg, const RegisterMap* reg_map) const {
1031   if(reg->is_reg()) {
1032     // If it is passed in a register, it got spilled in the stub frame.
1033     return (oop *)reg_map->location(reg);
1034   } else {
1035     int sp_offset_in_bytes = reg->reg2stack() * VMRegImpl::stack_slot_size;
1036     return (oop*)(((address)unextended_sp()) + sp_offset_in_bytes);
1037   }
1038 }
1039 
1040 BasicLock* frame::get_native_monitor() {
1041   nmethod* nm = (nmethod*)_cb;
1042   assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(),
1043          "Should not call this unless it's a native nmethod");
1044   int byte_offset = in_bytes(nm->native_basic_lock_sp_offset());
1045   assert(byte_offset >= 0, "should not see invalid offset");




1005 }
1006 
1007 
1008 // Get receiver out of callers frame, i.e. find parameter 0 in callers
1009 // frame.  Consult ADLC for where parameter 0 is to be found.  Then
1010 // check local reg_map for it being a callee-save register or argument
1011 // register, both of which are saved in the local frame.  If not found
1012 // there, it must be an in-stack argument of the caller.
1013 // Note: caller.sp() points to callee-arguments
1014 oop frame::retrieve_receiver(RegisterMap* reg_map) {
1015   frame caller = *this;
1016 
1017   // First consult the ADLC on where it puts parameter 0 for this signature.
1018   VMReg reg = SharedRuntime::name_for_receiver();
1019   oop* oop_adr = caller.oopmapreg_to_location(reg, reg_map);
1020   if (oop_adr == NULL) {
1021     guarantee(oop_adr != NULL, "bad register save location");
1022     return NULL;
1023   }
1024   oop r = *oop_adr;
1025   assert(Universe::heap()->is_in_or_null(r), "bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (void *) r, (void *) r);
1026   return r;
1027 }
1028 
1029 
1030 oop* frame::oopmapreg_to_location(VMReg reg, const RegisterMap* reg_map) const {
1031   if(reg->is_reg()) {
1032     // If it is passed in a register, it got spilled in the stub frame.
1033     return (oop *)reg_map->location(reg);
1034   } else {
1035     int sp_offset_in_bytes = reg->reg2stack() * VMRegImpl::stack_slot_size;
1036     return (oop*)(((address)unextended_sp()) + sp_offset_in_bytes);
1037   }
1038 }
1039 
1040 BasicLock* frame::get_native_monitor() {
1041   nmethod* nm = (nmethod*)_cb;
1042   assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(),
1043          "Should not call this unless it's a native nmethod");
1044   int byte_offset = in_bytes(nm->native_basic_lock_sp_offset());
1045   assert(byte_offset >= 0, "should not see invalid offset");


< prev index next >