< prev index next >

src/hotspot/share/runtime/fieldDescriptor.cpp

Print this page
*** 29,10 ***
--- 29,11 ---
  #include "oops/constantPool.hpp"
  #include "oops/instanceKlass.hpp"
  #include "oops/klass.inline.hpp"
  #include "oops/oop.inline.hpp"
  #include "oops/fieldStreams.inline.hpp"
+ #include "oops/inlineKlass.inline.hpp"
  #include "runtime/fieldDescriptor.inline.hpp"
  #include "runtime/handles.inline.hpp"
  #include "runtime/signature.hpp"
  
  

*** 58,11 ***
    return vmSymbols::void_signature(); // return a default value (for code analyzers)
  }
  
  bool fieldDescriptor::is_trusted_final() const {
    InstanceKlass* ik = field_holder();
!   return is_final() && (is_static() || ik->is_hidden() || ik->is_record());
  }
  
  AnnotationArray* fieldDescriptor::annotations() const {
    InstanceKlass* ik = field_holder();
    Array<AnnotationArray*>* md = ik->fields_annotations();
--- 59,11 ---
    return vmSymbols::void_signature(); // return a default value (for code analyzers)
  }
  
  bool fieldDescriptor::is_trusted_final() const {
    InstanceKlass* ik = field_holder();
!   return is_final() && (is_static() || ik->is_hidden() || ik->is_record() || ik->is_inline_klass());
  }
  
  AnnotationArray* fieldDescriptor::annotations() const {
    InstanceKlass* ik = field_holder();
    Array<AnnotationArray*>* md = ik->fields_annotations();

*** 153,12 ***
  }
  
  void fieldDescriptor::print() const { print_on(tty); }
  
  void fieldDescriptor::print_on_for(outputStream* st, oop obj) {
-   print_on(st);
    BasicType ft = field_type();
    jint as_int = 0;
    switch (ft) {
      case T_BYTE:
        as_int = (jint)obj->byte_field(offset());
        st->print(" %d", obj->byte_field(offset()));
--- 154,14 ---
  }
  
  void fieldDescriptor::print() const { print_on(tty); }
  
  void fieldDescriptor::print_on_for(outputStream* st, oop obj) {
    BasicType ft = field_type();
+   if (ft != T_INLINE_TYPE) {
+     print_on(st);
+   }
    jint as_int = 0;
    switch (ft) {
      case T_BYTE:
        as_int = (jint)obj->byte_field(offset());
        st->print(" %d", obj->byte_field(offset()));

*** 192,19 ***
        break;
      case T_BOOLEAN:
        as_int = obj->bool_field(offset());
        st->print(" %s", obj->bool_field(offset()) ? "true" : "false");
        break;
!     case T_ARRAY:
!       st->print(" ");
!       NOT_LP64(as_int = obj->int_field(offset()));
!       if (obj->obj_field(offset()) != NULL) {
!         obj->obj_field(offset())->print_value_on(st);
!       } else {
!         st->print("NULL");
        }
!       break;
      case T_OBJECT:
        st->print(" ");
        NOT_LP64(as_int = obj->int_field(offset()));
        if (obj->obj_field(offset()) != NULL) {
          obj->obj_field(offset())->print_value_on(st);
--- 195,23 ---
        break;
      case T_BOOLEAN:
        as_int = obj->bool_field(offset());
        st->print(" %s", obj->bool_field(offset()) ? "true" : "false");
        break;
!     case T_INLINE_TYPE:
!       if (is_inlined()) {
!         // Print fields of inlined fields (recursively)
!         InlineKlass* vk = InlineKlass::cast(field_holder()->get_inline_type_field_klass(index()));
!         int field_offset = offset() - vk->first_field_offset();
!         obj = cast_to_oop(cast_from_oop<address>(obj) + field_offset);
!         st->print_cr("Inline type field inlined '%s':", vk->name()->as_C_string());
+         FieldPrinter print_field(st, obj);
+         vk->do_nonstatic_fields(&print_field);
+         return; // Do not print underlying representation
        }
!       // inline type field not inlined, fall through
+     case T_ARRAY:
      case T_OBJECT:
        st->print(" ");
        NOT_LP64(as_int = obj->int_field(offset()));
        if (obj->obj_field(offset()) != NULL) {
          obj->obj_field(offset())->print_value_on(st);

*** 227,7 ***
--- 234,8 ---
    if (ft == T_LONG || ft == T_DOUBLE LP64_ONLY(|| !is_java_primitive(ft)) ) {
      st->print(" (%x %x)", obj->int_field(offset()), obj->int_field(offset()+sizeof(jint)));
    } else if (as_int < 0 || as_int > 9) {
      st->print(" (%x)", as_int);
    }
+   st->cr();
  }
  
< prev index next >