Mercurial > hg > truffle
comparison src/share/vm/runtime/frame.cpp @ 2019:09b4dd4f152b
7004582: Add GetThisObject() function to JVMTI 1.2
Summary: Add 'GetThisObject' function
Reviewed-by: never, coleenp
author | kamg |
---|---|
date | Thu, 09 Dec 2010 15:04:26 -0500 |
parents | f95d63e2154a |
children | 54f5dd2aa1d9 |
comparison
equal
deleted
inserted
replaced
2018:642e54d1850a | 2019:09b4dd4f152b |
---|---|
1069 int sp_offset_in_bytes = reg->reg2stack() * VMRegImpl::stack_slot_size; | 1069 int sp_offset_in_bytes = reg->reg2stack() * VMRegImpl::stack_slot_size; |
1070 return (oop*)(((address)unextended_sp()) + sp_offset_in_bytes); | 1070 return (oop*)(((address)unextended_sp()) + sp_offset_in_bytes); |
1071 } | 1071 } |
1072 } | 1072 } |
1073 | 1073 |
1074 BasicLock* frame::compiled_synchronized_native_monitor(nmethod* nm) { | 1074 BasicLock* frame::get_native_monitor() { |
1075 if (nm == NULL) { | 1075 nmethod* nm = (nmethod*)_cb; |
1076 assert(_cb != NULL && _cb->is_nmethod() && | 1076 assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(), |
1077 nm->method()->is_native() && | 1077 "Should not call this unless it's a native nmethod"); |
1078 nm->method()->is_synchronized(), | 1078 int byte_offset = in_bytes(nm->native_basic_lock_sp_offset()); |
1079 "should not call this otherwise"); | |
1080 nm = (nmethod*) _cb; | |
1081 } | |
1082 int byte_offset = in_bytes(nm->compiled_synchronized_native_basic_lock_sp_offset()); | |
1083 assert(byte_offset >= 0, "should not see invalid offset"); | 1079 assert(byte_offset >= 0, "should not see invalid offset"); |
1084 return (BasicLock*) &sp()[byte_offset / wordSize]; | 1080 return (BasicLock*) &sp()[byte_offset / wordSize]; |
1085 } | 1081 } |
1086 | 1082 |
1087 oop frame::compiled_synchronized_native_monitor_owner(nmethod* nm) { | 1083 oop frame::get_native_receiver() { |
1088 if (nm == NULL) { | 1084 nmethod* nm = (nmethod*)_cb; |
1089 assert(_cb != NULL && _cb->is_nmethod() && | 1085 assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(), |
1090 nm->method()->is_native() && | 1086 "Should not call this unless it's a native nmethod"); |
1091 nm->method()->is_synchronized(), | 1087 int byte_offset = in_bytes(nm->native_receiver_sp_offset()); |
1092 "should not call this otherwise"); | |
1093 nm = (nmethod*) _cb; | |
1094 } | |
1095 int byte_offset = in_bytes(nm->compiled_synchronized_native_basic_lock_owner_sp_offset()); | |
1096 assert(byte_offset >= 0, "should not see invalid offset"); | 1088 assert(byte_offset >= 0, "should not see invalid offset"); |
1097 oop owner = ((oop*) sp())[byte_offset / wordSize]; | 1089 oop owner = ((oop*) sp())[byte_offset / wordSize]; |
1098 assert( Universe::heap()->is_in(owner), "bad receiver" ); | 1090 assert( Universe::heap()->is_in(owner), "bad receiver" ); |
1099 return owner; | 1091 return owner; |
1100 } | 1092 } |