1 /*
2 * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
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 //** The DebugInformationRecorder collects debugging information
26 // for a compiled method.
27 // Debugging information is used for:
28 // - garbage collecting compiled frames
29 // - stack tracing across compiled frames
30 // - deoptimizating compiled frames
31 //
32 // The implementation requires the compiler to use the recorder
33 // in the following order:
34 // 1) Describe debug information for safepoints at increasing addresses.
35 // a) Add safepoint entry (use add_safepoint or add_non_safepoint)
36 // b) Describe scopes for that safepoint
37 // - create locals if needed (use create_scope_values)
38 // - create expressions if needed (use create_scope_values)
39 // - create monitor stack if needed (use create_monitor_values)
40 // - describe scope (use describe_scope)
41 // "repeat last four steps for all scopes"
42 // "outer most scope first and inner most scope last"
43 // NB: nodes from create_scope_values and create_locations
44 // can be reused for simple sharing.
166 int _prev_safepoint_pc;
167
168 PcDesc* last_pc() {
169 guarantee(_pcs_length > 0, "a safepoint must be declared already");
170 return &_pcs[_pcs_length-1];
171 }
172 PcDesc* prev_pc() {
173 guarantee(_pcs_length > 1, "a safepoint must be declared already");
174 return &_pcs[_pcs_length-2];
175 }
176 void add_new_pc_offset(int pc_offset);
177 void end_scopes(int pc_offset, bool is_safepoint);
178
179 int serialize_monitor_values(GrowableArray<MonitorValue*>* monitors);
180 int serialize_scope_values(GrowableArray<ScopeValue*>* values);
181 int find_sharable_decode_offset(int stream_offset);
182
183 public:
184 enum { serialized_null = 0 };
185 };
|
1 /*
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
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 #ifndef SHARE_VM_CODE_DEBUGINFOREC_HPP
26 #define SHARE_VM_CODE_DEBUGINFOREC_HPP
27
28 #include "ci/ciClassList.hpp"
29 #include "ci/ciInstanceKlass.hpp"
30 #include "ci/ciMethod.hpp"
31 #include "code/debugInfo.hpp"
32 #include "code/location.hpp"
33 #include "code/pcDesc.hpp"
34 #include "compiler/oopMap.hpp"
35 #include "oops/oop.hpp"
36 #include "utilities/growableArray.hpp"
37
38 //** The DebugInformationRecorder collects debugging information
39 // for a compiled method.
40 // Debugging information is used for:
41 // - garbage collecting compiled frames
42 // - stack tracing across compiled frames
43 // - deoptimizating compiled frames
44 //
45 // The implementation requires the compiler to use the recorder
46 // in the following order:
47 // 1) Describe debug information for safepoints at increasing addresses.
48 // a) Add safepoint entry (use add_safepoint or add_non_safepoint)
49 // b) Describe scopes for that safepoint
50 // - create locals if needed (use create_scope_values)
51 // - create expressions if needed (use create_scope_values)
52 // - create monitor stack if needed (use create_monitor_values)
53 // - describe scope (use describe_scope)
54 // "repeat last four steps for all scopes"
55 // "outer most scope first and inner most scope last"
56 // NB: nodes from create_scope_values and create_locations
57 // can be reused for simple sharing.
179 int _prev_safepoint_pc;
180
181 PcDesc* last_pc() {
182 guarantee(_pcs_length > 0, "a safepoint must be declared already");
183 return &_pcs[_pcs_length-1];
184 }
185 PcDesc* prev_pc() {
186 guarantee(_pcs_length > 1, "a safepoint must be declared already");
187 return &_pcs[_pcs_length-2];
188 }
189 void add_new_pc_offset(int pc_offset);
190 void end_scopes(int pc_offset, bool is_safepoint);
191
192 int serialize_monitor_values(GrowableArray<MonitorValue*>* monitors);
193 int serialize_scope_values(GrowableArray<ScopeValue*>* values);
194 int find_sharable_decode_offset(int stream_offset);
195
196 public:
197 enum { serialized_null = 0 };
198 };
199
200 #endif // SHARE_VM_CODE_DEBUGINFOREC_HPP
|