151
152 // MarkerValue
153
154 void MarkerValue::write_on(DebugInfoWriteStream* stream) {
155 stream->write_int(MARKER_CODE);
156 }
157
158 void MarkerValue::print_on(outputStream* st) const {
159 st->print("marker");
160 }
161
162 // ObjectValue
163
164 void ObjectValue::set_value(oop value) {
165 _value = Handle(Thread::current(), value);
166 }
167
168 void ObjectValue::read_object(DebugInfoReadStream* stream) {
169 _is_root = stream->read_bool();
170 _klass = read_from(stream);
171 assert(_klass->is_constant_oop(), "should be constant java mirror oop");
172 int length = stream->read_int();
173 for (int i = 0; i < length; i++) {
174 ScopeValue* val = read_from(stream);
175 _field_values.append(val);
176 }
177 }
178
179 void ObjectValue::write_on(DebugInfoWriteStream* stream) {
180 if (is_visited()) {
181 stream->write_int(OBJECT_ID_CODE);
182 stream->write_int(_id);
183 } else {
184 set_visited(true);
185 stream->write_int(is_auto_box() ? AUTO_BOX_OBJECT_CODE : OBJECT_CODE);
186 stream->write_int(_id);
187 stream->write_bool(_is_root);
188 _klass->write_on(stream);
189 int length = _field_values.length();
190 stream->write_int(length);
191 for (int i = 0; i < length; i++) {
192 _field_values.at(i)->write_on(stream);
193 }
194 }
195 }
196
197 void ObjectValue::print_on(outputStream* st) const {
198 st->print("%s[%d]", is_auto_box() ? "box_obj" : is_object_merge() ? "merge_obj" : "obj", _id);
199 }
200
201 void ObjectValue::print_fields_on(outputStream* st) const {
202 #ifndef PRODUCT
203 if (is_object_merge()) {
204 ObjectMergeValue* omv = (ObjectMergeValue*)this;
205 st->print("selector=\"");
206 omv->selector()->print_on(st);
207 st->print("\"");
208 ScopeValue* merge_pointer = omv->merge_pointer();
|
151
152 // MarkerValue
153
154 void MarkerValue::write_on(DebugInfoWriteStream* stream) {
155 stream->write_int(MARKER_CODE);
156 }
157
158 void MarkerValue::print_on(outputStream* st) const {
159 st->print("marker");
160 }
161
162 // ObjectValue
163
164 void ObjectValue::set_value(oop value) {
165 _value = Handle(Thread::current(), value);
166 }
167
168 void ObjectValue::read_object(DebugInfoReadStream* stream) {
169 _is_root = stream->read_bool();
170 _klass = read_from(stream);
171 _is_init = read_from(stream);
172 assert(_klass->is_constant_oop(), "should be constant java mirror oop");
173 int length = stream->read_int();
174 for (int i = 0; i < length; i++) {
175 ScopeValue* val = read_from(stream);
176 _field_values.append(val);
177 }
178 }
179
180 void ObjectValue::write_on(DebugInfoWriteStream* stream) {
181 if (is_visited()) {
182 stream->write_int(OBJECT_ID_CODE);
183 stream->write_int(_id);
184 } else {
185 set_visited(true);
186 stream->write_int(is_auto_box() ? AUTO_BOX_OBJECT_CODE : OBJECT_CODE);
187 stream->write_int(_id);
188 stream->write_bool(_is_root);
189 _klass->write_on(stream);
190 if (_is_init == nullptr) {
191 // MarkerValue is used for null-free objects
192 _is_init = new MarkerValue();
193 }
194 _is_init->write_on(stream);
195 int length = _field_values.length();
196 stream->write_int(length);
197 for (int i = 0; i < length; i++) {
198 _field_values.at(i)->write_on(stream);
199 }
200 }
201 }
202
203 void ObjectValue::print_on(outputStream* st) const {
204 st->print("%s[%d]", is_auto_box() ? "box_obj" : is_object_merge() ? "merge_obj" : "obj", _id);
205 }
206
207 void ObjectValue::print_fields_on(outputStream* st) const {
208 #ifndef PRODUCT
209 if (is_object_merge()) {
210 ObjectMergeValue* omv = (ObjectMergeValue*)this;
211 st->print("selector=\"");
212 omv->selector()->print_on(st);
213 st->print("\"");
214 ScopeValue* merge_pointer = omv->merge_pointer();
|