< prev index next >

src/hotspot/share/code/debugInfo.cpp

Print this page

145 
146 // MarkerValue
147 
148 void MarkerValue::write_on(DebugInfoWriteStream* stream) {
149   stream->write_int(MARKER_CODE);
150 }
151 
152 void MarkerValue::print_on(outputStream* st) const {
153     st->print("marker");
154 }
155 
156 // ObjectValue
157 
158 void ObjectValue::set_value(oop value) {
159   _value = Handle(Thread::current(), value);
160 }
161 
162 void ObjectValue::read_object(DebugInfoReadStream* stream) {
163   _is_root = stream->read_bool();
164   _klass = 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     int length = _field_values.length();
184     stream->write_int(length);
185     for (int i = 0; i < length; i++) {
186       _field_values.at(i)->write_on(stream);
187     }
188   }
189 }
190 
191 void ObjectValue::print_on(outputStream* st) const {
192   st->print("%s[%d]", is_auto_box() ? "box_obj" : is_object_merge() ? "merge_obj" : "obj", _id);
193 }
194 
195 void ObjectValue::print_fields_on(outputStream* st) const {
196 #ifndef PRODUCT
197   if (is_object_merge()) {
198     ObjectMergeValue* omv = (ObjectMergeValue*)this;
199     st->print("selector=\"");
200     omv->selector()->print_on(st);
201     st->print("\"");
202     ScopeValue* merge_pointer = omv->merge_pointer();

145 
146 // MarkerValue
147 
148 void MarkerValue::write_on(DebugInfoWriteStream* stream) {
149   stream->write_int(MARKER_CODE);
150 }
151 
152 void MarkerValue::print_on(outputStream* st) const {
153     st->print("marker");
154 }
155 
156 // ObjectValue
157 
158 void ObjectValue::set_value(oop value) {
159   _value = Handle(Thread::current(), value);
160 }
161 
162 void ObjectValue::read_object(DebugInfoReadStream* stream) {
163   _is_root = stream->read_bool();
164   _klass = read_from(stream);
165   _is_init = read_from(stream);
166   assert(_klass->is_constant_oop(), "should be constant java mirror oop");
167   int length = stream->read_int();
168   for (int i = 0; i < length; i++) {
169     ScopeValue* val = read_from(stream);
170     _field_values.append(val);
171   }
172 }
173 
174 void ObjectValue::write_on(DebugInfoWriteStream* stream) {
175   if (is_visited()) {
176     stream->write_int(OBJECT_ID_CODE);
177     stream->write_int(_id);
178   } else {
179     set_visited(true);
180     stream->write_int(is_auto_box() ? AUTO_BOX_OBJECT_CODE : OBJECT_CODE);
181     stream->write_int(_id);
182     stream->write_bool(_is_root);
183     _klass->write_on(stream);
184     if (_is_init == nullptr) {
185       // MarkerValue is used for null-free objects
186       _is_init = new MarkerValue();
187     }
188     _is_init->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();
< prev index next >