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 void ScopeDesc::initialize(const ScopeDesc* parent, int decode_offset) {
55 _code = parent->_code;
56 _decode_offset = 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 ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
65 initialize(parent, parent->_sender_decode_offset);
66 }
67
68 ScopeDesc::ScopeDesc(const ScopeDesc* parent, int decode_offset) {
69 initialize(parent, decode_offset);
70 }
71
72
73 void ScopeDesc::decode_body() {
74 if (decode_offset() == DebugInformationRecorder::serialized_null) {
75 // This is a sentinel record, which is only relevant to
76 // approximate queries. Decode a reasonable frame.
77 _sender_decode_offset = DebugInformationRecorder::serialized_null;
78 _method = _code->method();
79 _bci = InvocationEntryBci;
80 _locals_decode_offset = DebugInformationRecorder::serialized_null;
|
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, PcDesc* pd, bool ignore_objects) {
34 int obj_decode_offset = ignore_objects ? DebugInformationRecorder::serialized_null : pd->obj_decode_offset();
35 _code = code;
36 _decode_offset = pd->scope_decode_offset();
37 _objects = decode_object_values(obj_decode_offset);
38 _reexecute = pd->should_reexecute();
39 _rethrow_exception = pd->rethrow_exception();
40 _return_oop = pd->return_oop();
41 _not_global_escape_in_scope = ignore_objects ? false : pd->not_global_escape_in_scope();
42 _arg_escape = ignore_objects ? false : pd->arg_escape();
43 decode_body();
44 }
45
46
47 void ScopeDesc::initialize(const ScopeDesc* parent, int decode_offset) {
48 _code = parent->_code;
49 _decode_offset = decode_offset;
50 _objects = parent->_objects;
51 _reexecute = false; //reexecute only applies to the first scope
52 _rethrow_exception = false;
53 _return_oop = false;
54 _not_global_escape_in_scope = parent->not_global_escape_in_scope();
55 _arg_escape = false;
56 decode_body();
57 }
58
59 ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
60 initialize(parent, parent->_sender_decode_offset);
61 }
62
63 ScopeDesc::ScopeDesc(const ScopeDesc* parent, int decode_offset) {
64 initialize(parent, decode_offset);
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;
|