Mercurial > hg > graal-jvmci-8
annotate src/share/vm/code/debugInfo.hpp @ 7094:eec7173947a1
removed remaining use of the C++ "compiler interface" (i.e. ci) by Graal for installing dependencies
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 29 Nov 2012 17:13:13 +0100 |
parents | b6a8f2d23057 |
children | b8f261ba79c6 |
rev | line source |
---|---|
0 | 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 | 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 * | |
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 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_CODE_DEBUGINFO_HPP |
26 #define SHARE_VM_CODE_DEBUGINFO_HPP | |
27 | |
28 #include "code/compressedStream.hpp" | |
29 #include "code/location.hpp" | |
30 #include "code/nmethod.hpp" | |
31 #include "code/oopRecorder.hpp" | |
32 #include "runtime/stackValue.hpp" | |
33 #include "utilities/growableArray.hpp" | |
34 | |
0 | 35 // Classes used for serializing debugging information. |
36 // These abstractions are introducted to provide symmetric | |
37 // read and write operations. | |
38 | |
39 // ScopeValue describes the value of a variable/expression in a scope | |
40 // - LocationValue describes a value in a given location (in frame or register) | |
41 // - ConstantValue describes a constant | |
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 | 45 class ScopeValue: public ResourceObj { |
46 public: | |
47 // Testers | |
48 virtual bool is_location() const { return false; } | |
49 virtual bool is_object() const { return false; } | |
50 virtual bool is_constant_int() const { return false; } | |
51 virtual bool is_constant_double() const { return false; } | |
52 virtual bool is_constant_long() const { return false; } | |
53 virtual bool is_constant_oop() const { return false; } | |
54 virtual bool equals(ScopeValue* other) const { return false; } | |
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 | 61 // Serialization of debugging information |
62 virtual void write_on(DebugInfoWriteStream* stream) = 0; | |
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 | 69 }; |
70 | |
71 | |
72 // A Location value describes a value in a given location; i.e. the corresponding | |
73 // logical entity (e.g., a method temporary) lives in this location. | |
74 | |
75 class LocationValue: public ScopeValue { | |
76 private: | |
77 Location _location; | |
78 public: | |
79 LocationValue(Location location) { _location = location; } | |
80 bool is_location() const { return true; } | |
81 Location location() const { return _location; } | |
82 | |
83 // Serialization of debugging information | |
84 LocationValue(DebugInfoReadStream* stream); | |
85 void write_on(DebugInfoWriteStream* stream); | |
86 | |
87 // Printing | |
88 void print_on(outputStream* st) const; | |
89 }; | |
90 | |
7046
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
91 #ifdef GRAAL |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
92 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
93 class DeferredLocationValue: public ScopeValue { |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
94 private: |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
95 ScopeValue* _base; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
96 ScopeValue* _index; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
97 jint _scale; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
98 jlong _disp; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
99 public: |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
100 DeferredLocationValue(ScopeValue* base, ScopeValue* index, jint scale, jlong disp) |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
101 : _base(base), _index(index), _scale(scale), _disp(disp) { } |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
102 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
103 ScopeValue* base() { return _base; } |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
104 ScopeValue* index() { return _index; } |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
105 jint scale() { return _scale; } |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
106 jlong disp() { return _disp; } |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
107 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
108 // Serialization of debugging information |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
109 DeferredLocationValue(DebugInfoReadStream* stream); |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
110 void write_on(DebugInfoWriteStream* stream); |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
111 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
112 // Printing |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
113 void print_on(outputStream* st) const; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
114 }; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
115 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
116 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
117 class DeferredReadValue: public DeferredLocationValue { |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
118 public: |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
119 DeferredReadValue(ScopeValue* base, ScopeValue* index, jint scale, jint disp) |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
120 : DeferredLocationValue(base, index, scale, disp) { } |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
121 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
122 // Serialization of debugging information |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
123 DeferredReadValue(DebugInfoReadStream* stream); |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
124 void write_on(DebugInfoWriteStream* stream); |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
125 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
126 // Printing |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
127 void print_on(outputStream* st) const; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
128 }; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
129 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
130 class DeferredWriteValue: public DeferredLocationValue { |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
131 private: |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
132 ScopeValue* _value; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
133 public: |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
134 DeferredWriteValue(ScopeValue* base, ScopeValue* index, jint scale, jint disp, ScopeValue* value) |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
135 : DeferredLocationValue(base, index, scale, disp), _value(value) { } |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
136 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
137 ScopeValue* value() { return _value; } |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
138 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
139 // Serialization of debugging information |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
140 DeferredWriteValue(DebugInfoReadStream* stream); |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
141 void write_on(DebugInfoWriteStream* stream); |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
142 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
143 // Printing |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
144 void print_on(outputStream* st) const; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
145 }; |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
146 |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
147 #endif // GRAAL |
b6a8f2d23057
VM support for deferred reads and writes: ScopeDesc, DebugInfo, DebugInfoRecorder
Lukas Stadler <lukas.stadler@jku.at>
parents:
6725
diff
changeset
|
148 |
0 | 149 |
150 // An ObjectValue describes an object eliminated by escape analysis. | |
151 | |
152 class ObjectValue: public ScopeValue { | |
153 private: | |
154 int _id; | |
155 ScopeValue* _klass; | |
156 GrowableArray<ScopeValue*> _field_values; | |
157 Handle _value; | |
158 bool _visited; | |
159 | |
160 public: | |
161 ObjectValue(int id, ScopeValue* klass) | |
162 : _id(id) | |
163 , _klass(klass) | |
164 , _field_values() | |
165 , _value() | |
166 , _visited(false) { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
167 assert(klass->is_constant_oop(), "should be constant java mirror oop"); |
0 | 168 } |
169 | |
170 ObjectValue(int id) | |
171 : _id(id) | |
172 , _klass(NULL) | |
173 , _field_values() | |
174 , _value() | |
175 , _visited(false) {} | |
176 | |
177 // Accessors | |
178 bool is_object() const { return true; } | |
179 int id() const { return _id; } | |
180 ScopeValue* klass() const { return _klass; } | |
181 GrowableArray<ScopeValue*>* field_values() { return &_field_values; } | |
182 ScopeValue* field_at(int i) const { return _field_values.at(i); } | |
183 int field_size() { return _field_values.length(); } | |
184 Handle value() const { return _value; } | |
185 bool is_visited() const { return _visited; } | |
186 | |
187 void set_value(oop value) { _value = Handle(value); } | |
188 void set_visited(bool visited) { _visited = false; } | |
189 | |
190 // Serialization of debugging information | |
191 void read_object(DebugInfoReadStream* stream); | |
192 void write_on(DebugInfoWriteStream* stream); | |
193 | |
194 // Printing | |
195 void print_on(outputStream* st) const; | |
196 void print_fields_on(outputStream* st) const; | |
197 }; | |
198 | |
199 | |
200 // A ConstantIntValue describes a constant int; i.e., the corresponding logical entity | |
201 // is either a source constant or its computation has been constant-folded. | |
202 | |
203 class ConstantIntValue: public ScopeValue { | |
204 private: | |
205 jint _value; | |
206 public: | |
207 ConstantIntValue(jint value) { _value = value; } | |
208 jint value() const { return _value; } | |
209 bool is_constant_int() const { return true; } | |
210 bool equals(ScopeValue* other) const { return false; } | |
211 | |
212 // Serialization of debugging information | |
213 ConstantIntValue(DebugInfoReadStream* stream); | |
214 void write_on(DebugInfoWriteStream* stream); | |
215 | |
216 // Printing | |
217 void print_on(outputStream* st) const; | |
218 }; | |
219 | |
220 class ConstantLongValue: public ScopeValue { | |
221 private: | |
222 jlong _value; | |
223 public: | |
224 ConstantLongValue(jlong value) { _value = value; } | |
225 jlong value() const { return _value; } | |
226 bool is_constant_long() const { return true; } | |
227 bool equals(ScopeValue* other) const { return false; } | |
228 | |
229 // Serialization of debugging information | |
230 ConstantLongValue(DebugInfoReadStream* stream); | |
231 void write_on(DebugInfoWriteStream* stream); | |
232 | |
233 // Printing | |
234 void print_on(outputStream* st) const; | |
235 }; | |
236 | |
237 class ConstantDoubleValue: public ScopeValue { | |
238 private: | |
239 jdouble _value; | |
240 public: | |
241 ConstantDoubleValue(jdouble value) { _value = value; } | |
242 jdouble value() const { return _value; } | |
243 bool is_constant_double() const { return true; } | |
244 bool equals(ScopeValue* other) const { return false; } | |
245 | |
246 // Serialization of debugging information | |
247 ConstantDoubleValue(DebugInfoReadStream* stream); | |
248 void write_on(DebugInfoWriteStream* stream); | |
249 | |
250 // Printing | |
251 void print_on(outputStream* st) const; | |
252 }; | |
253 | |
254 // A ConstantOopWriteValue is created by the compiler to | |
255 // be written as debugging information. | |
256 | |
257 class ConstantOopWriteValue: public ScopeValue { | |
258 private: | |
259 jobject _value; | |
260 public: | |
261 ConstantOopWriteValue(jobject value) { _value = value; } | |
262 jobject value() const { return _value; } | |
263 bool is_constant_oop() const { return true; } | |
264 bool equals(ScopeValue* other) const { return false; } | |
265 | |
266 // Serialization of debugging information | |
267 void write_on(DebugInfoWriteStream* stream); | |
268 | |
269 // Printing | |
270 void print_on(outputStream* st) const; | |
271 }; | |
272 | |
273 // A ConstantOopReadValue is created by the VM when reading | |
274 // debug information | |
275 | |
276 class ConstantOopReadValue: public ScopeValue { | |
277 private: | |
278 Handle _value; | |
279 public: | |
280 Handle value() const { return _value; } | |
281 bool is_constant_oop() const { return true; } | |
282 bool equals(ScopeValue* other) const { return false; } | |
283 | |
284 // Serialization of debugging information | |
285 ConstantOopReadValue(DebugInfoReadStream* stream); | |
286 void write_on(DebugInfoWriteStream* stream); | |
287 | |
288 // Printing | |
289 void print_on(outputStream* st) const; | |
290 }; | |
291 | |
292 // MonitorValue describes the pair used for monitor_enter and monitor_exit. | |
293 | |
294 class MonitorValue: public ResourceObj { | |
295 private: | |
296 ScopeValue* _owner; | |
297 Location _basic_lock; | |
298 bool _eliminated; | |
299 public: | |
300 // Constructor | |
301 MonitorValue(ScopeValue* owner, Location basic_lock, bool eliminated = false); | |
302 | |
303 // Accessors | |
304 ScopeValue* owner() const { return _owner; } | |
305 Location basic_lock() const { return _basic_lock; } | |
306 bool eliminated() const { return _eliminated; } | |
307 | |
308 // Serialization of debugging information | |
309 MonitorValue(DebugInfoReadStream* stream); | |
310 void write_on(DebugInfoWriteStream* stream); | |
311 | |
312 // Printing | |
313 void print_on(outputStream* st) const; | |
314 }; | |
315 | |
316 // DebugInfoReadStream specializes CompressedReadStream for reading | |
317 // debugging information. Used by ScopeDesc. | |
318 | |
319 class DebugInfoReadStream : public CompressedReadStream { | |
320 private: | |
321 const nmethod* _code; | |
322 const nmethod* code() const { return _code; } | |
323 GrowableArray<ScopeValue*>* _obj_pool; | |
324 public: | |
325 DebugInfoReadStream(const nmethod* code, int offset, GrowableArray<ScopeValue*>* obj_pool = NULL) : | |
326 CompressedReadStream(code->scopes_data_begin(), offset) { | |
327 _code = code; | |
328 _obj_pool = obj_pool; | |
329 | |
330 } ; | |
331 | |
332 oop read_oop() { | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
333 oop o = code()->oop_at(read_int()); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
334 assert(o == NULL || o->is_oop(), "oop only"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
335 return o; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
336 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
337 Method* read_method() { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
338 Method* o = (Method*)(code()->metadata_at(read_int())); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
339 assert(o == NULL || |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
340 o->is_metadata(), "meta data only"); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
341 return o; |
0 | 342 } |
343 ScopeValue* read_object_value(); | |
344 ScopeValue* get_cached_object(); | |
345 // 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
|
346 int read_bci() { return read_int() + InvocationEntryBci; } |
0 | 347 }; |
348 | |
349 // DebugInfoWriteStream specializes CompressedWriteStream for | |
350 // writing debugging information. Used by ScopeDescRecorder. | |
351 | |
352 class DebugInfoWriteStream : public CompressedWriteStream { | |
353 private: | |
354 DebugInformationRecorder* _recorder; | |
355 DebugInformationRecorder* recorder() const { return _recorder; } | |
356 public: | |
357 DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size); | |
358 void write_handle(jobject h); | |
931
72088be4b386
6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents:
900
diff
changeset
|
359 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
|
360 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
361 void write_metadata(Metadata* m); |
0 | 362 }; |
1972 | 363 |
364 #endif // SHARE_VM_CODE_DEBUGINFO_HPP |