< prev index next >

src/share/vm/ci/ciInstanceKlass.cpp

Print this page

        

*** 702,712 **** void do_field(fieldDescriptor* fd) { if (fd->is_final() && !fd->has_initial_value()) { ResourceMark rm; InstanceKlass* holder = fd->field_holder(); oop mirror = holder->java_mirror(); ! _out->print("staticfield %s %s %s ", _holder, fd->name()->as_quoted_ascii(), fd->signature()->as_quoted_ascii()); do_field_helper(fd, mirror, false); _out->cr(); } } }; --- 702,716 ---- void do_field(fieldDescriptor* fd) { if (fd->is_final() && !fd->has_initial_value()) { ResourceMark rm; InstanceKlass* holder = fd->field_holder(); oop mirror = holder->java_mirror(); ! _out->print("staticfield %s %s ", _holder, fd->name()->as_quoted_ascii()); ! BasicType bt = fd->field_type(); ! if (bt != T_OBJECT && bt != T_ARRAY) { ! _out->print("%s ", fd->signature()->as_quoted_ascii()); ! } do_field_helper(fd, mirror, false); _out->cr(); } } };
*** 722,733 **** _out->print(" "); } }; void StaticFieldPrinter::do_field_helper(fieldDescriptor* fd, oop mirror, bool flattened) { ! switch (fd->field_type()) { ! case T_BYTE: _out->print_cr("%d", mirror->byte_field(fd->offset())); break; case T_BOOLEAN: _out->print("%d", mirror->bool_field(fd->offset())); break; case T_SHORT: _out->print("%d", mirror->short_field(fd->offset())); break; case T_CHAR: _out->print("%d", mirror->char_field(fd->offset())); break; case T_INT: _out->print("%d", mirror->int_field(fd->offset())); break; case T_LONG: _out->print(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break; --- 726,738 ---- _out->print(" "); } }; void StaticFieldPrinter::do_field_helper(fieldDescriptor* fd, oop mirror, bool flattened) { ! BasicType bt = fd->field_type(); ! switch (bt) { ! case T_BYTE: _out->print("%d", mirror->byte_field(fd->offset())); break; case T_BOOLEAN: _out->print("%d", mirror->bool_field(fd->offset())); break; case T_SHORT: _out->print("%d", mirror->short_field(fd->offset())); break; case T_CHAR: _out->print("%d", mirror->char_field(fd->offset())); break; case T_INT: _out->print("%d", mirror->int_field(fd->offset())); break; case T_LONG: _out->print(INT64_FORMAT, (int64_t)(mirror->long_field(fd->offset()))); break;
*** 739,778 **** case T_DOUBLE: { double d = mirror->double_field(fd->offset()); _out->print(INT64_FORMAT, *(int64_t*)&d); break; } ! case T_ARRAY: { ! oop value = mirror->obj_field_acquire(fd->offset()); ! if (value == NULL) { ! _out->print("null"); ! } else { ! typeArrayOop ta = (typeArrayOop)value; ! _out->print("%d", ta->length()); ! if (value->is_objArray()) { ! objArrayOop oa = (objArrayOop)value; ! const char* klass_name = value->klass()->name()->as_quoted_ascii(); ! _out->print(" %s", klass_name); ! } ! } ! break; ! } case T_OBJECT: { oop value = mirror->obj_field_acquire(fd->offset()); if (value == NULL) { _out->print("null"); ! } else if (value->is_instance()) { if (value->is_a(SystemDictionary::String_klass())) { ! _out->print("\""); _out->print_raw(java_lang_String::as_quoted_ascii(value)); _out->print("\""); - } else { - const char* klass_name = value->klass()->name()->as_quoted_ascii(); - _out->print("%s", klass_name); } ! } else { ! ShouldNotReachHere(); } break; } case T_VALUETYPE: { ResetNoHandleMark rnhm; --- 744,770 ---- case T_DOUBLE: { double d = mirror->double_field(fd->offset()); _out->print(INT64_FORMAT, *(int64_t*)&d); break; } ! case T_ARRAY: case T_OBJECT: { oop value = mirror->obj_field_acquire(fd->offset()); if (value == NULL) { _out->print("null"); ! } else { ! _out->print("%s", value->klass()->signature_name()); ! if (value->is_array()) { ! _out->print(" %d", ((arrayOop)value)->length()); ! } else { ! assert(value->is_instance() && bt == T_OBJECT, "what else?"); if (value->is_a(SystemDictionary::String_klass())) { ! _out->print(" \""); _out->print_raw(java_lang_String::as_quoted_ascii(value)); _out->print("\""); } ! } } break; } case T_VALUETYPE: { ResetNoHandleMark rnhm;
< prev index next >