39 _objects = decode_object_values(DebugInformationRecorder::serialized_null);
40 decode_body();
41 }
42
43
44 ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
45 _code = parent->_code;
46 _decode_offset = parent->_sender_decode_offset;
47 _objects = parent->_objects;
48 decode_body();
49 }
50
51
52 void ScopeDesc::decode_body() {
53 if (decode_offset() == DebugInformationRecorder::serialized_null) {
54 // This is a sentinel record, which is only relevant to
55 // approximate queries. Decode a reasonable frame.
56 _sender_decode_offset = DebugInformationRecorder::serialized_null;
57 _method = methodHandle(_code->method());
58 _bci = InvocationEntryBci;
59 _locals_decode_offset = DebugInformationRecorder::serialized_null;
60 _expressions_decode_offset = DebugInformationRecorder::serialized_null;
61 _monitors_decode_offset = DebugInformationRecorder::serialized_null;
62 } else {
63 // decode header
64 DebugInfoReadStream* stream = stream_at(decode_offset());
65
66 _sender_decode_offset = stream->read_int();
67 _method = methodHandle((methodOop) stream->read_oop());
68 _bci = stream->read_bci();
69 // decode offsets for body and sender
70 _locals_decode_offset = stream->read_int();
71 _expressions_decode_offset = stream->read_int();
72 _monitors_decode_offset = stream->read_int();
73 }
74 }
75
76
77 GrowableArray<ScopeValue*>* ScopeDesc::decode_scope_values(int decode_offset) {
78 if (decode_offset == DebugInformationRecorder::serialized_null) return NULL;
79 DebugInfoReadStream* stream = stream_at(decode_offset);
80 int length = stream->read_int();
81 GrowableArray<ScopeValue*>* result = new GrowableArray<ScopeValue*> (length);
82 for (int index = 0; index < length; index++) {
83 result->push(ScopeValue::read_from(stream));
84 }
85 return result;
86 }
87
88 GrowableArray<ScopeValue*>* ScopeDesc::decode_object_values(int decode_offset) {
|
39 _objects = decode_object_values(DebugInformationRecorder::serialized_null);
40 decode_body();
41 }
42
43
44 ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
45 _code = parent->_code;
46 _decode_offset = parent->_sender_decode_offset;
47 _objects = parent->_objects;
48 decode_body();
49 }
50
51
52 void ScopeDesc::decode_body() {
53 if (decode_offset() == DebugInformationRecorder::serialized_null) {
54 // This is a sentinel record, which is only relevant to
55 // approximate queries. Decode a reasonable frame.
56 _sender_decode_offset = DebugInformationRecorder::serialized_null;
57 _method = methodHandle(_code->method());
58 _bci = InvocationEntryBci;
59 _restart = false;
60 _locals_decode_offset = DebugInformationRecorder::serialized_null;
61 _expressions_decode_offset = DebugInformationRecorder::serialized_null;
62 _monitors_decode_offset = DebugInformationRecorder::serialized_null;
63 } else {
64 // decode header
65 DebugInfoReadStream* stream = stream_at(decode_offset());
66
67 _sender_decode_offset = stream->read_int();
68 _method = methodHandle((methodOop) stream->read_oop());
69 _bci = stream->read_bci_and_restart(_restart);
70 // decode offsets for body and sender
71 _locals_decode_offset = stream->read_int();
72 _expressions_decode_offset = stream->read_int();
73 _monitors_decode_offset = stream->read_int();
74 }
75 }
76
77
78 GrowableArray<ScopeValue*>* ScopeDesc::decode_scope_values(int decode_offset) {
79 if (decode_offset == DebugInformationRecorder::serialized_null) return NULL;
80 DebugInfoReadStream* stream = stream_at(decode_offset);
81 int length = stream->read_int();
82 GrowableArray<ScopeValue*>* result = new GrowableArray<ScopeValue*> (length);
83 for (int index = 0; index < length; index++) {
84 result->push(ScopeValue::read_from(stream));
85 }
86 return result;
87 }
88
89 GrowableArray<ScopeValue*>* ScopeDesc::decode_object_values(int decode_offset) {
|