13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "code/debugInfoRec.hpp" 27 #include "code/pcDesc.hpp" 28 #include "code/scopeDesc.hpp" 29 #include "memory/resourceArea.hpp" 30 #include "oops/oop.inline.hpp" 31 #include "runtime/handles.inline.hpp" 32 33 ScopeDesc::ScopeDesc(const CompiledMethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool rethrow_exception, bool return_oop) { 34 _code = code; 35 _decode_offset = decode_offset; 36 _objects = decode_object_values(obj_decode_offset); 37 _reexecute = reexecute; 38 _rethrow_exception = rethrow_exception; 39 _return_oop = return_oop; 40 decode_body(); 41 } 42 43 ScopeDesc::ScopeDesc(const CompiledMethod* code, int decode_offset, bool reexecute, bool rethrow_exception, bool return_oop) { 44 _code = code; 45 _decode_offset = decode_offset; 46 _objects = decode_object_values(DebugInformationRecorder::serialized_null); 47 _reexecute = reexecute; 48 _rethrow_exception = rethrow_exception; 49 _return_oop = return_oop; 50 decode_body(); 51 } 52 53 54 ScopeDesc::ScopeDesc(const ScopeDesc* parent) { 55 _code = parent->_code; 56 _decode_offset = parent->_sender_decode_offset; 57 _objects = parent->_objects; 58 _reexecute = false; //reexecute only applies to the first scope 59 _rethrow_exception = false; 60 _return_oop = false; 61 decode_body(); 62 } 63 64 65 void ScopeDesc::decode_body() { 66 if (decode_offset() == DebugInformationRecorder::serialized_null) { 67 // This is a sentinel record, which is only relevant to 68 // approximate queries. Decode a reasonable frame. 69 _sender_decode_offset = DebugInformationRecorder::serialized_null; 70 _method = _code->method(); 71 _bci = InvocationEntryBci; 72 _locals_decode_offset = DebugInformationRecorder::serialized_null; 73 _expressions_decode_offset = DebugInformationRecorder::serialized_null; 74 _monitors_decode_offset = DebugInformationRecorder::serialized_null; 75 } else { 76 // decode header 77 DebugInfoReadStream* stream = stream_at(decode_offset()); 78 79 _sender_decode_offset = stream->read_int(); 80 _method = stream->read_method(); | 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "code/debugInfoRec.hpp" 27 #include "code/pcDesc.hpp" 28 #include "code/scopeDesc.hpp" 29 #include "memory/resourceArea.hpp" 30 #include "oops/oop.inline.hpp" 31 #include "runtime/handles.inline.hpp" 32 33 ScopeDesc::ScopeDesc(const CompiledMethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool rethrow_exception, bool return_oop, bool return_vt) { 34 _code = code; 35 _decode_offset = decode_offset; 36 _objects = decode_object_values(obj_decode_offset); 37 _reexecute = reexecute; 38 _rethrow_exception = rethrow_exception; 39 _return_oop = return_oop; 40 _return_vt = return_vt; 41 decode_body(); 42 } 43 44 ScopeDesc::ScopeDesc(const CompiledMethod* code, int decode_offset, bool reexecute, bool rethrow_exception, bool return_oop, bool return_vt) { 45 _code = code; 46 _decode_offset = decode_offset; 47 _objects = decode_object_values(DebugInformationRecorder::serialized_null); 48 _reexecute = reexecute; 49 _rethrow_exception = rethrow_exception; 50 _return_oop = return_oop; 51 _return_vt = return_vt; 52 decode_body(); 53 } 54 55 56 ScopeDesc::ScopeDesc(const ScopeDesc* parent) { 57 _code = parent->_code; 58 _decode_offset = parent->_sender_decode_offset; 59 _objects = parent->_objects; 60 _reexecute = false; //reexecute only applies to the first scope 61 _rethrow_exception = false; 62 _return_oop = false; 63 _return_vt = false; 64 decode_body(); 65 } 66 67 68 void ScopeDesc::decode_body() { 69 if (decode_offset() == DebugInformationRecorder::serialized_null) { 70 // This is a sentinel record, which is only relevant to 71 // approximate queries. Decode a reasonable frame. 72 _sender_decode_offset = DebugInformationRecorder::serialized_null; 73 _method = _code->method(); 74 _bci = InvocationEntryBci; 75 _locals_decode_offset = DebugInformationRecorder::serialized_null; 76 _expressions_decode_offset = DebugInformationRecorder::serialized_null; 77 _monitors_decode_offset = DebugInformationRecorder::serialized_null; 78 } else { 79 // decode header 80 DebugInfoReadStream* stream = stream_at(decode_offset()); 81 82 _sender_decode_offset = stream->read_int(); 83 _method = stream->read_method(); |