< prev index next >

src/hotspot/share/code/debugInfo.cpp

Print this page

133 }
134 
135 // MarkerValue
136 
137 void MarkerValue::write_on(DebugInfoWriteStream* stream) {
138   stream->write_int(MARKER_CODE);
139 }
140 
141 void MarkerValue::print_on(outputStream* st) const {
142     st->print("marker");
143 }
144 
145 // ObjectValue
146 
147 void ObjectValue::set_value(oop value) {
148   _value = Handle(Thread::current(), value);
149 }
150 
151 void ObjectValue::read_object(DebugInfoReadStream* stream) {
152   _klass = read_from(stream);

153   assert(_klass->is_constant_oop(), "should be constant java mirror oop");
154   int length = stream->read_int();
155   for (int i = 0; i < length; i++) {
156     ScopeValue* val = read_from(stream);
157     _field_values.append(val);
158   }
159 }
160 
161 void ObjectValue::write_on(DebugInfoWriteStream* stream) {
162   if (is_visited()) {
163     stream->write_int(OBJECT_ID_CODE);
164     stream->write_int(_id);
165   } else {
166     set_visited(true);
167     stream->write_int(is_auto_box() ? AUTO_BOX_OBJECT_CODE : OBJECT_CODE);
168     stream->write_int(_id);
169     _klass->write_on(stream);





170     int length = _field_values.length();
171     stream->write_int(length);
172     for (int i = 0; i < length; i++) {
173       _field_values.at(i)->write_on(stream);
174     }
175   }
176 }
177 
178 void ObjectValue::print_on(outputStream* st) const {
179   st->print("%s[%d]", is_auto_box() ? "box_obj" : "obj", _id);
180 }
181 
182 void ObjectValue::print_fields_on(outputStream* st) const {
183 #ifndef PRODUCT
184   if (_field_values.length() > 0) {
185     _field_values.at(0)->print_on(st);
186   }
187   for (int i = 1; i < _field_values.length(); i++) {
188     st->print(", ");
189     _field_values.at(i)->print_on(st);

133 }
134 
135 // MarkerValue
136 
137 void MarkerValue::write_on(DebugInfoWriteStream* stream) {
138   stream->write_int(MARKER_CODE);
139 }
140 
141 void MarkerValue::print_on(outputStream* st) const {
142     st->print("marker");
143 }
144 
145 // ObjectValue
146 
147 void ObjectValue::set_value(oop value) {
148   _value = Handle(Thread::current(), value);
149 }
150 
151 void ObjectValue::read_object(DebugInfoReadStream* stream) {
152   _klass = read_from(stream);
153   _is_init = read_from(stream);
154   assert(_klass->is_constant_oop(), "should be constant java mirror oop");
155   int length = stream->read_int();
156   for (int i = 0; i < length; i++) {
157     ScopeValue* val = read_from(stream);
158     _field_values.append(val);
159   }
160 }
161 
162 void ObjectValue::write_on(DebugInfoWriteStream* stream) {
163   if (is_visited()) {
164     stream->write_int(OBJECT_ID_CODE);
165     stream->write_int(_id);
166   } else {
167     set_visited(true);
168     stream->write_int(is_auto_box() ? AUTO_BOX_OBJECT_CODE : OBJECT_CODE);
169     stream->write_int(_id);
170     _klass->write_on(stream);
171     if (_is_init == NULL) {
172       // MarkerValue is used for null-free objects
173       _is_init = new MarkerValue();
174     }
175     _is_init->write_on(stream);
176     int length = _field_values.length();
177     stream->write_int(length);
178     for (int i = 0; i < length; i++) {
179       _field_values.at(i)->write_on(stream);
180     }
181   }
182 }
183 
184 void ObjectValue::print_on(outputStream* st) const {
185   st->print("%s[%d]", is_auto_box() ? "box_obj" : "obj", _id);
186 }
187 
188 void ObjectValue::print_fields_on(outputStream* st) const {
189 #ifndef PRODUCT
190   if (_field_values.length() > 0) {
191     _field_values.at(0)->print_on(st);
192   }
193   for (int i = 1; i < _field_values.length(); i++) {
194     st->print(", ");
195     _field_values.at(i)->print_on(st);
< prev index next >