annotate src/share/vm/code/debugInfo.hpp @ 8151:b8f261ba79c6

Minimize diff to plain HotSpot version.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 07 Mar 2013 21:00:29 +0100
parents b6a8f2d23057
children c5ff08c22458
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 931
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 931
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 931
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_CODE_DEBUGINFO_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_CODE_DEBUGINFO_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "code/compressedStream.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "code/location.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "code/nmethod.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "code/oopRecorder.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #include "runtime/stackValue.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
33 #include "utilities/growableArray.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
34
0
a61af66fc99e Initial load
duke
parents:
diff changeset
35 // Classes used for serializing debugging information.
a61af66fc99e Initial load
duke
parents:
diff changeset
36 // These abstractions are introducted to provide symmetric
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // read and write operations.
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // ScopeValue describes the value of a variable/expression in a scope
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // - LocationValue describes a value in a given location (in frame or register)
a61af66fc99e Initial load
duke
parents:
diff changeset
41 // - ConstantValue describes a constant
a61af66fc99e Initial load
duke
parents:
diff changeset
42
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
43 class ConstantOopReadValue;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
44
0
a61af66fc99e Initial load
duke
parents:
diff changeset
45 class ScopeValue: public ResourceObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
46 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // Testers
a61af66fc99e Initial load
duke
parents:
diff changeset
48 virtual bool is_location() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
49 virtual bool is_object() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
50 virtual bool is_constant_int() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
51 virtual bool is_constant_double() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
52 virtual bool is_constant_long() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
53 virtual bool is_constant_oop() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
54 virtual bool equals(ScopeValue* other) const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
55
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
56 ConstantOopReadValue* as_ConstantOopReadValue() {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
57 assert(is_constant_oop(), "must be");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
58 return (ConstantOopReadValue*) this;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
59 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
60
0
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
62 virtual void write_on(DebugInfoWriteStream* stream) = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static ScopeValue* read_from(DebugInfoReadStream* stream);
7046
b6a8f2d23057 VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents: 6725
diff changeset
64
b6a8f2d23057 VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents: 6725
diff changeset
65 #ifdef GRAAL
b6a8f2d23057 VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents: 6725
diff changeset
66 // Printing
b6a8f2d23057 VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents: 6725
diff changeset
67 virtual void print_on(outputStream* st) const = 0;
b6a8f2d23057 VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents: 6725
diff changeset
68 #endif // GRAAL
0
a61af66fc99e Initial load
duke
parents:
diff changeset
69 };
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 // A Location value describes a value in a given location; i.e. the corresponding
a61af66fc99e Initial load
duke
parents:
diff changeset
73 // logical entity (e.g., a method temporary) lives in this location.
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 class LocationValue: public ScopeValue {
a61af66fc99e Initial load
duke
parents:
diff changeset
76 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
77 Location _location;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
79 LocationValue(Location location) { _location = location; }
a61af66fc99e Initial load
duke
parents:
diff changeset
80 bool is_location() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
81 Location location() const { return _location; }
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
84 LocationValue(DebugInfoReadStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
85 void write_on(DebugInfoWriteStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
88 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 };
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 // An ObjectValue describes an object eliminated by escape analysis.
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 class ObjectValue: public ScopeValue {
a61af66fc99e Initial load
duke
parents:
diff changeset
95 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
96 int _id;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 ScopeValue* _klass;
a61af66fc99e Initial load
duke
parents:
diff changeset
98 GrowableArray<ScopeValue*> _field_values;
a61af66fc99e Initial load
duke
parents:
diff changeset
99 Handle _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
100 bool _visited;
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
103 ObjectValue(int id, ScopeValue* klass)
a61af66fc99e Initial load
duke
parents:
diff changeset
104 : _id(id)
a61af66fc99e Initial load
duke
parents:
diff changeset
105 , _klass(klass)
a61af66fc99e Initial load
duke
parents:
diff changeset
106 , _field_values()
a61af66fc99e Initial load
duke
parents:
diff changeset
107 , _value()
a61af66fc99e Initial load
duke
parents:
diff changeset
108 , _visited(false) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
109 assert(klass->is_constant_oop(), "should be constant java mirror oop");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
110 }
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 ObjectValue(int id)
a61af66fc99e Initial load
duke
parents:
diff changeset
113 : _id(id)
a61af66fc99e Initial load
duke
parents:
diff changeset
114 , _klass(NULL)
a61af66fc99e Initial load
duke
parents:
diff changeset
115 , _field_values()
a61af66fc99e Initial load
duke
parents:
diff changeset
116 , _value()
a61af66fc99e Initial load
duke
parents:
diff changeset
117 , _visited(false) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 // Accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
120 bool is_object() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
121 int id() const { return _id; }
a61af66fc99e Initial load
duke
parents:
diff changeset
122 ScopeValue* klass() const { return _klass; }
a61af66fc99e Initial load
duke
parents:
diff changeset
123 GrowableArray<ScopeValue*>* field_values() { return &_field_values; }
a61af66fc99e Initial load
duke
parents:
diff changeset
124 ScopeValue* field_at(int i) const { return _field_values.at(i); }
a61af66fc99e Initial load
duke
parents:
diff changeset
125 int field_size() { return _field_values.length(); }
a61af66fc99e Initial load
duke
parents:
diff changeset
126 Handle value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
127 bool is_visited() const { return _visited; }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 void set_value(oop value) { _value = Handle(value); }
a61af66fc99e Initial load
duke
parents:
diff changeset
130 void set_visited(bool visited) { _visited = false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
131
a61af66fc99e Initial load
duke
parents:
diff changeset
132 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
133 void read_object(DebugInfoReadStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
134 void write_on(DebugInfoWriteStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
135
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
137 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 void print_fields_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
139 };
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 // A ConstantIntValue describes a constant int; i.e., the corresponding logical entity
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // is either a source constant or its computation has been constant-folded.
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 class ConstantIntValue: public ScopeValue {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
147 jint _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
148 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
149 ConstantIntValue(jint value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
150 jint value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 bool is_constant_int() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
152 bool equals(ScopeValue* other) const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
155 ConstantIntValue(DebugInfoReadStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
156 void write_on(DebugInfoWriteStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
159 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
160 };
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 class ConstantLongValue: public ScopeValue {
a61af66fc99e Initial load
duke
parents:
diff changeset
163 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
164 jlong _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
165 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
166 ConstantLongValue(jlong value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
167 jlong value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
168 bool is_constant_long() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
169 bool equals(ScopeValue* other) const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
170
a61af66fc99e Initial load
duke
parents:
diff changeset
171 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
172 ConstantLongValue(DebugInfoReadStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
173 void write_on(DebugInfoWriteStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
174
a61af66fc99e Initial load
duke
parents:
diff changeset
175 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
176 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
177 };
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 class ConstantDoubleValue: public ScopeValue {
a61af66fc99e Initial load
duke
parents:
diff changeset
180 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
181 jdouble _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
182 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
183 ConstantDoubleValue(jdouble value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
184 jdouble value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
185 bool is_constant_double() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
186 bool equals(ScopeValue* other) const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
189 ConstantDoubleValue(DebugInfoReadStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
190 void write_on(DebugInfoWriteStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
193 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
194 };
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 // A ConstantOopWriteValue is created by the compiler to
a61af66fc99e Initial load
duke
parents:
diff changeset
197 // be written as debugging information.
a61af66fc99e Initial load
duke
parents:
diff changeset
198
a61af66fc99e Initial load
duke
parents:
diff changeset
199 class ConstantOopWriteValue: public ScopeValue {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
201 jobject _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
202 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
203 ConstantOopWriteValue(jobject value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
204 jobject value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
205 bool is_constant_oop() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
206 bool equals(ScopeValue* other) const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
207
a61af66fc99e Initial load
duke
parents:
diff changeset
208 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
209 void write_on(DebugInfoWriteStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
212 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
213 };
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 // A ConstantOopReadValue is created by the VM when reading
a61af66fc99e Initial load
duke
parents:
diff changeset
216 // debug information
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218 class ConstantOopReadValue: public ScopeValue {
a61af66fc99e Initial load
duke
parents:
diff changeset
219 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
220 Handle _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
221 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
222 Handle value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
223 bool is_constant_oop() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
224 bool equals(ScopeValue* other) const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
227 ConstantOopReadValue(DebugInfoReadStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
228 void write_on(DebugInfoWriteStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
231 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
232 };
a61af66fc99e Initial load
duke
parents:
diff changeset
233
a61af66fc99e Initial load
duke
parents:
diff changeset
234 // MonitorValue describes the pair used for monitor_enter and monitor_exit.
a61af66fc99e Initial load
duke
parents:
diff changeset
235
a61af66fc99e Initial load
duke
parents:
diff changeset
236 class MonitorValue: public ResourceObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
237 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
238 ScopeValue* _owner;
a61af66fc99e Initial load
duke
parents:
diff changeset
239 Location _basic_lock;
a61af66fc99e Initial load
duke
parents:
diff changeset
240 bool _eliminated;
a61af66fc99e Initial load
duke
parents:
diff changeset
241 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
242 // Constructor
a61af66fc99e Initial load
duke
parents:
diff changeset
243 MonitorValue(ScopeValue* owner, Location basic_lock, bool eliminated = false);
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 // Accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
246 ScopeValue* owner() const { return _owner; }
a61af66fc99e Initial load
duke
parents:
diff changeset
247 Location basic_lock() const { return _basic_lock; }
a61af66fc99e Initial load
duke
parents:
diff changeset
248 bool eliminated() const { return _eliminated; }
a61af66fc99e Initial load
duke
parents:
diff changeset
249
a61af66fc99e Initial load
duke
parents:
diff changeset
250 // Serialization of debugging information
a61af66fc99e Initial load
duke
parents:
diff changeset
251 MonitorValue(DebugInfoReadStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
252 void write_on(DebugInfoWriteStream* stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
253
a61af66fc99e Initial load
duke
parents:
diff changeset
254 // Printing
a61af66fc99e Initial load
duke
parents:
diff changeset
255 void print_on(outputStream* st) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
256 };
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258 // DebugInfoReadStream specializes CompressedReadStream for reading
a61af66fc99e Initial load
duke
parents:
diff changeset
259 // debugging information. Used by ScopeDesc.
a61af66fc99e Initial load
duke
parents:
diff changeset
260
a61af66fc99e Initial load
duke
parents:
diff changeset
261 class DebugInfoReadStream : public CompressedReadStream {
a61af66fc99e Initial load
duke
parents:
diff changeset
262 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
263 const nmethod* _code;
a61af66fc99e Initial load
duke
parents:
diff changeset
264 const nmethod* code() const { return _code; }
a61af66fc99e Initial load
duke
parents:
diff changeset
265 GrowableArray<ScopeValue*>* _obj_pool;
a61af66fc99e Initial load
duke
parents:
diff changeset
266 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
267 DebugInfoReadStream(const nmethod* code, int offset, GrowableArray<ScopeValue*>* obj_pool = NULL) :
a61af66fc99e Initial load
duke
parents:
diff changeset
268 CompressedReadStream(code->scopes_data_begin(), offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
269 _code = code;
a61af66fc99e Initial load
duke
parents:
diff changeset
270 _obj_pool = obj_pool;
a61af66fc99e Initial load
duke
parents:
diff changeset
271
a61af66fc99e Initial load
duke
parents:
diff changeset
272 } ;
a61af66fc99e Initial load
duke
parents:
diff changeset
273
a61af66fc99e Initial load
duke
parents:
diff changeset
274 oop read_oop() {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
275 oop o = code()->oop_at(read_int());
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
276 assert(o == NULL || o->is_oop(), "oop only");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
277 return o;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
278 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
279 Method* read_method() {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
280 Method* o = (Method*)(code()->metadata_at(read_int()));
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
281 assert(o == NULL ||
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
282 o->is_metadata(), "meta data only");
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
283 return o;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
284 }
a61af66fc99e Initial load
duke
parents:
diff changeset
285 ScopeValue* read_object_value();
a61af66fc99e Initial load
duke
parents:
diff changeset
286 ScopeValue* get_cached_object();
a61af66fc99e Initial load
duke
parents:
diff changeset
287 // BCI encoding is mostly unsigned, but -1 is a distinguished value
931
72088be4b386 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents: 900
diff changeset
288 int read_bci() { return read_int() + InvocationEntryBci; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
289 };
a61af66fc99e Initial load
duke
parents:
diff changeset
290
a61af66fc99e Initial load
duke
parents:
diff changeset
291 // DebugInfoWriteStream specializes CompressedWriteStream for
a61af66fc99e Initial load
duke
parents:
diff changeset
292 // writing debugging information. Used by ScopeDescRecorder.
a61af66fc99e Initial load
duke
parents:
diff changeset
293
a61af66fc99e Initial load
duke
parents:
diff changeset
294 class DebugInfoWriteStream : public CompressedWriteStream {
a61af66fc99e Initial load
duke
parents:
diff changeset
295 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
296 DebugInformationRecorder* _recorder;
a61af66fc99e Initial load
duke
parents:
diff changeset
297 DebugInformationRecorder* recorder() const { return _recorder; }
a61af66fc99e Initial load
duke
parents:
diff changeset
298 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
299 DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
300 void write_handle(jobject h);
931
72088be4b386 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents: 900
diff changeset
301 void write_bci(int bci) { write_int(bci - InvocationEntryBci); }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
302
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
303 void write_metadata(Metadata* m);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
304 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
305
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
306 #endif // SHARE_VM_CODE_DEBUGINFO_HPP