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