annotate src/share/vm/code/debugInfo.cpp @ 14649:f6301b007a16

6498581: ThreadInterruptTest3 produces wrong output on Windows Summary: There is race condition between os::interrupt and os::is_interrupted on Windows. In JVM_Sleep(Thread.sleep), check if thread gets interrupted, it may see interrupted but not really interrupted so cause spurious waking up (early return from sleep). Fix by checking if interrupt event really gets set thus prevent false return. For intrinsic of _isInterrupted, on Windows, go fastpath only on bit not set. Reviewed-by: acorn, kvn Contributed-by: david.holmes@oracle.com, yumin.qi@oracle.com
author minqi
date Wed, 26 Feb 2014 15:20:41 -0800
parents da91efe96a93
children b6a8f2d23057 78bbf4d43a14
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: 196
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 196
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: 196
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 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "code/debugInfo.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "code/debugInfoRec.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "code/nmethod.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "runtime/handles.inline.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 // Comstructors
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 DebugInfoWriteStream::DebugInfoWriteStream(DebugInformationRecorder* recorder, int initial_size)
a61af66fc99e Initial load
duke
parents:
diff changeset
34 : CompressedWriteStream(initial_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
35 _recorder = recorder;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 }
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // Serializing oops
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 void DebugInfoWriteStream::write_handle(jobject h) {
a61af66fc99e Initial load
duke
parents:
diff changeset
41 write_int(recorder()->oop_recorder()->find_index(h));
a61af66fc99e Initial load
duke
parents:
diff changeset
42 }
a61af66fc99e Initial load
duke
parents:
diff changeset
43
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
44 void DebugInfoWriteStream::write_metadata(Metadata* h) {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
45 write_int(recorder()->oop_recorder()->find_index(h));
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
46 }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
47
0
a61af66fc99e Initial load
duke
parents:
diff changeset
48 ScopeValue* DebugInfoReadStream::read_object_value() {
a61af66fc99e Initial load
duke
parents:
diff changeset
49 int id = read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
50 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
51 assert(_obj_pool != NULL, "object pool does not exist");
a61af66fc99e Initial load
duke
parents:
diff changeset
52 for (int i = _obj_pool->length() - 1; i >= 0; i--) {
a61af66fc99e Initial load
duke
parents:
diff changeset
53 assert(((ObjectValue*) _obj_pool->at(i))->id() != id, "should not be read twice");
a61af66fc99e Initial load
duke
parents:
diff changeset
54 }
a61af66fc99e Initial load
duke
parents:
diff changeset
55 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
56 ObjectValue* result = new ObjectValue(id);
44
52fed2ec0afb 6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents: 0
diff changeset
57 // Cache the object since an object field could reference it.
52fed2ec0afb 6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents: 0
diff changeset
58 _obj_pool->push(result);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
59 result->read_object(this);
a61af66fc99e Initial load
duke
parents:
diff changeset
60 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
61 }
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 ScopeValue* DebugInfoReadStream::get_cached_object() {
a61af66fc99e Initial load
duke
parents:
diff changeset
64 int id = read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
65 assert(_obj_pool != NULL, "object pool does not exist");
a61af66fc99e Initial load
duke
parents:
diff changeset
66 for (int i = _obj_pool->length() - 1; i >= 0; i--) {
44
52fed2ec0afb 6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents: 0
diff changeset
67 ObjectValue* ov = (ObjectValue*) _obj_pool->at(i);
52fed2ec0afb 6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents: 0
diff changeset
68 if (ov->id() == id) {
52fed2ec0afb 6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents: 0
diff changeset
69 return ov;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
70 }
a61af66fc99e Initial load
duke
parents:
diff changeset
71 }
a61af66fc99e Initial load
duke
parents:
diff changeset
72 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
73 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 }
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 // Serializing scope values
a61af66fc99e Initial load
duke
parents:
diff changeset
77
a61af66fc99e Initial load
duke
parents:
diff changeset
78 enum { LOCATION_CODE = 0, CONSTANT_INT_CODE = 1, CONSTANT_OOP_CODE = 2,
a61af66fc99e Initial load
duke
parents:
diff changeset
79 CONSTANT_LONG_CODE = 3, CONSTANT_DOUBLE_CODE = 4,
a61af66fc99e Initial load
duke
parents:
diff changeset
80 OBJECT_CODE = 5, OBJECT_ID_CODE = 6 };
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 ScopeValue* ScopeValue::read_from(DebugInfoReadStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 ScopeValue* result = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
84 switch(stream->read_int()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
85 case LOCATION_CODE: result = new LocationValue(stream); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 case CONSTANT_INT_CODE: result = new ConstantIntValue(stream); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 case CONSTANT_OOP_CODE: result = new ConstantOopReadValue(stream); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
88 case CONSTANT_LONG_CODE: result = new ConstantLongValue(stream); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
89 case CONSTANT_DOUBLE_CODE: result = new ConstantDoubleValue(stream); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 case OBJECT_CODE: result = stream->read_object_value(); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 case OBJECT_ID_CODE: result = stream->get_cached_object(); break;
a61af66fc99e Initial load
duke
parents:
diff changeset
92 default: ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
93 }
a61af66fc99e Initial load
duke
parents:
diff changeset
94 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
95 }
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // LocationValue
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99 LocationValue::LocationValue(DebugInfoReadStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
100 _location = Location(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
101 }
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 void LocationValue::write_on(DebugInfoWriteStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
104 stream->write_int(LOCATION_CODE);
a61af66fc99e Initial load
duke
parents:
diff changeset
105 location().write_on(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
106 }
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 void LocationValue::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 location().print_on(st);
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
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 void ObjectValue::read_object(DebugInfoReadStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
115 _klass = read_from(stream);
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
116 assert(_klass->is_constant_oop(), "should be constant java mirror oop");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
117 int length = stream->read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
118 for (int i = 0; i < length; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 ScopeValue* val = read_from(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
120 _field_values.append(val);
a61af66fc99e Initial load
duke
parents:
diff changeset
121 }
a61af66fc99e Initial load
duke
parents:
diff changeset
122 }
a61af66fc99e Initial load
duke
parents:
diff changeset
123
a61af66fc99e Initial load
duke
parents:
diff changeset
124 void ObjectValue::write_on(DebugInfoWriteStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
125 if (_visited) {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 stream->write_int(OBJECT_ID_CODE);
a61af66fc99e Initial load
duke
parents:
diff changeset
127 stream->write_int(_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
128 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 _visited = true;
a61af66fc99e Initial load
duke
parents:
diff changeset
130 stream->write_int(OBJECT_CODE);
a61af66fc99e Initial load
duke
parents:
diff changeset
131 stream->write_int(_id);
a61af66fc99e Initial load
duke
parents:
diff changeset
132 _klass->write_on(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
133 int length = _field_values.length();
a61af66fc99e Initial load
duke
parents:
diff changeset
134 stream->write_int(length);
a61af66fc99e Initial load
duke
parents:
diff changeset
135 for (int i = 0; i < length; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 _field_values.at(i)->write_on(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141 void ObjectValue::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
142 st->print("obj[%d]", _id);
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 void ObjectValue::print_fields_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
147 if (_field_values.length() > 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
148 _field_values.at(0)->print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
149 }
a61af66fc99e Initial load
duke
parents:
diff changeset
150 for (int i = 1; i < _field_values.length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
151 st->print(", ");
a61af66fc99e Initial load
duke
parents:
diff changeset
152 _field_values.at(i)->print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
153 }
a61af66fc99e Initial load
duke
parents:
diff changeset
154 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
155 }
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 // ConstantIntValue
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159 ConstantIntValue::ConstantIntValue(DebugInfoReadStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
160 _value = stream->read_signed_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 void ConstantIntValue::write_on(DebugInfoWriteStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
164 stream->write_int(CONSTANT_INT_CODE);
a61af66fc99e Initial load
duke
parents:
diff changeset
165 stream->write_signed_int(value());
a61af66fc99e Initial load
duke
parents:
diff changeset
166 }
a61af66fc99e Initial load
duke
parents:
diff changeset
167
a61af66fc99e Initial load
duke
parents:
diff changeset
168 void ConstantIntValue::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
169 st->print("%d", value());
a61af66fc99e Initial load
duke
parents:
diff changeset
170 }
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 // ConstantLongValue
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174 ConstantLongValue::ConstantLongValue(DebugInfoReadStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
175 _value = stream->read_long();
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }
a61af66fc99e Initial load
duke
parents:
diff changeset
177
a61af66fc99e Initial load
duke
parents:
diff changeset
178 void ConstantLongValue::write_on(DebugInfoWriteStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
179 stream->write_int(CONSTANT_LONG_CODE);
a61af66fc99e Initial load
duke
parents:
diff changeset
180 stream->write_long(value());
a61af66fc99e Initial load
duke
parents:
diff changeset
181 }
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 void ConstantLongValue::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
184 st->print(INT64_FORMAT, value());
a61af66fc99e Initial load
duke
parents:
diff changeset
185 }
a61af66fc99e Initial load
duke
parents:
diff changeset
186
a61af66fc99e Initial load
duke
parents:
diff changeset
187 // ConstantDoubleValue
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 ConstantDoubleValue::ConstantDoubleValue(DebugInfoReadStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
190 _value = stream->read_double();
a61af66fc99e Initial load
duke
parents:
diff changeset
191 }
a61af66fc99e Initial load
duke
parents:
diff changeset
192
a61af66fc99e Initial load
duke
parents:
diff changeset
193 void ConstantDoubleValue::write_on(DebugInfoWriteStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
194 stream->write_int(CONSTANT_DOUBLE_CODE);
a61af66fc99e Initial load
duke
parents:
diff changeset
195 stream->write_double(value());
a61af66fc99e Initial load
duke
parents:
diff changeset
196 }
a61af66fc99e Initial load
duke
parents:
diff changeset
197
a61af66fc99e Initial load
duke
parents:
diff changeset
198 void ConstantDoubleValue::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
199 st->print("%f", value());
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 // ConstantOopWriteValue
a61af66fc99e Initial load
duke
parents:
diff changeset
203
a61af66fc99e Initial load
duke
parents:
diff changeset
204 void ConstantOopWriteValue::write_on(DebugInfoWriteStream* stream) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
205 assert(JNIHandles::resolve(value()) == NULL ||
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
206 Universe::heap()->is_in_reserved(JNIHandles::resolve(value())),
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
207 "Should be in heap");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
208 stream->write_int(CONSTANT_OOP_CODE);
a61af66fc99e Initial load
duke
parents:
diff changeset
209 stream->write_handle(value());
a61af66fc99e Initial load
duke
parents:
diff changeset
210 }
a61af66fc99e Initial load
duke
parents:
diff changeset
211
a61af66fc99e Initial load
duke
parents:
diff changeset
212 void ConstantOopWriteValue::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
213 JNIHandles::resolve(value())->print_value_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
214 }
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 // ConstantOopReadValue
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 ConstantOopReadValue::ConstantOopReadValue(DebugInfoReadStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 _value = Handle(stream->read_oop());
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
221 assert(_value() == NULL ||
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
222 Universe::heap()->is_in_reserved(_value()), "Should be in heap");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
223 }
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 void ConstantOopReadValue::write_on(DebugInfoWriteStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
226 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
227 }
a61af66fc99e Initial load
duke
parents:
diff changeset
228
a61af66fc99e Initial load
duke
parents:
diff changeset
229 void ConstantOopReadValue::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
230 value()()->print_value_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
231 }
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
a61af66fc99e Initial load
duke
parents:
diff changeset
235
a61af66fc99e Initial load
duke
parents:
diff changeset
236 MonitorValue::MonitorValue(ScopeValue* owner, Location basic_lock, bool eliminated) {
a61af66fc99e Initial load
duke
parents:
diff changeset
237 _owner = owner;
a61af66fc99e Initial load
duke
parents:
diff changeset
238 _basic_lock = basic_lock;
a61af66fc99e Initial load
duke
parents:
diff changeset
239 _eliminated = eliminated;
a61af66fc99e Initial load
duke
parents:
diff changeset
240 }
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 MonitorValue::MonitorValue(DebugInfoReadStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
243 _basic_lock = Location(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
244 _owner = ScopeValue::read_from(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
245 _eliminated = (stream->read_bool() != 0);
a61af66fc99e Initial load
duke
parents:
diff changeset
246 }
a61af66fc99e Initial load
duke
parents:
diff changeset
247
a61af66fc99e Initial load
duke
parents:
diff changeset
248 void MonitorValue::write_on(DebugInfoWriteStream* stream) {
a61af66fc99e Initial load
duke
parents:
diff changeset
249 _basic_lock.write_on(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
250 _owner->write_on(stream);
a61af66fc99e Initial load
duke
parents:
diff changeset
251 stream->write_bool(_eliminated);
a61af66fc99e Initial load
duke
parents:
diff changeset
252 }
a61af66fc99e Initial load
duke
parents:
diff changeset
253
a61af66fc99e Initial load
duke
parents:
diff changeset
254 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
255 void MonitorValue::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
256 st->print("monitor{");
a61af66fc99e Initial load
duke
parents:
diff changeset
257 owner()->print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
258 st->print(",");
a61af66fc99e Initial load
duke
parents:
diff changeset
259 basic_lock().print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
260 st->print("}");
a61af66fc99e Initial load
duke
parents:
diff changeset
261 if (_eliminated) {
a61af66fc99e Initial load
duke
parents:
diff changeset
262 st->print(" (eliminated)");
a61af66fc99e Initial load
duke
parents:
diff changeset
263 }
a61af66fc99e Initial load
duke
parents:
diff changeset
264 }
a61af66fc99e Initial load
duke
parents:
diff changeset
265 #endif