src/share/vm/oops/fieldStreams.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/oops

src/share/vm/oops/fieldStreams.hpp

Print this page
rev 7589 : 6700100: optimize inline_native_clone() for small objects with exact klass
Summary: optimize small instance clones as loads/stores
Reviewed-by:


  34 // are provided depending on the kind of iteration required.  The
  35 // JavaFieldStream is for iterating over regular Java fields and it
  36 // generally the preferred iterator.  InternalFieldStream only
  37 // iterates over fields that have been injected by the JVM.
  38 // AllFieldStream exposes all fields and should only be used in rare
  39 // cases.
  40 class FieldStreamBase : public StackObj {
  41  protected:
  42   Array<u2>*          _fields;
  43   constantPoolHandle  _constants;
  44   int                 _index;
  45   int                 _limit;
  46   int                 _generic_signature_slot;
  47   fieldDescriptor     _fd_buf;
  48 
  49   FieldInfo* field() const { return FieldInfo::from_field_array(_fields, _index); }
  50   InstanceKlass* field_holder() const { return _constants->pool_holder(); }
  51 
  52   int init_generic_signature_start_slot() {
  53     int length = _fields->length();
  54     int num_fields = 0;
  55     int skipped_generic_signature_slots = 0;
  56     FieldInfo* fi;
  57     AccessFlags flags;
  58     /* Scan from 0 to the current _index. Count the number of generic
  59        signature slots for field[0] to field[_index - 1]. */
  60     for (int i = 0; i < _index; i++) {
  61       fi = FieldInfo::from_field_array(_fields, i);
  62       flags.set_flags(fi->access_flags());
  63       if (flags.field_has_generic_signature()) {
  64         length --;
  65         skipped_generic_signature_slots ++;
  66       }
  67     }
  68     /* Scan from the current _index. */
  69     for (int i = _index; i*FieldInfo::field_slots < length; i++) {
  70       fi = FieldInfo::from_field_array(_fields, i);
  71       flags.set_flags(fi->access_flags());
  72       if (flags.field_has_generic_signature()) {
  73         length --;
  74       }




  34 // are provided depending on the kind of iteration required.  The
  35 // JavaFieldStream is for iterating over regular Java fields and it
  36 // generally the preferred iterator.  InternalFieldStream only
  37 // iterates over fields that have been injected by the JVM.
  38 // AllFieldStream exposes all fields and should only be used in rare
  39 // cases.
  40 class FieldStreamBase : public StackObj {
  41  protected:
  42   Array<u2>*          _fields;
  43   constantPoolHandle  _constants;
  44   int                 _index;
  45   int                 _limit;
  46   int                 _generic_signature_slot;
  47   fieldDescriptor     _fd_buf;
  48 
  49   FieldInfo* field() const { return FieldInfo::from_field_array(_fields, _index); }
  50   InstanceKlass* field_holder() const { return _constants->pool_holder(); }
  51 
  52   int init_generic_signature_start_slot() {
  53     int length = _fields->length();
  54     int num_fields = _index;
  55     int skipped_generic_signature_slots = 0;
  56     FieldInfo* fi;
  57     AccessFlags flags;
  58     /* Scan from 0 to the current _index. Count the number of generic
  59        signature slots for field[0] to field[_index - 1]. */
  60     for (int i = 0; i < _index; i++) {
  61       fi = FieldInfo::from_field_array(_fields, i);
  62       flags.set_flags(fi->access_flags());
  63       if (flags.field_has_generic_signature()) {
  64         length --;
  65         skipped_generic_signature_slots ++;
  66       }
  67     }
  68     /* Scan from the current _index. */
  69     for (int i = _index; i*FieldInfo::field_slots < length; i++) {
  70       fi = FieldInfo::from_field_array(_fields, i);
  71       flags.set_flags(fi->access_flags());
  72       if (flags.field_has_generic_signature()) {
  73         length --;
  74       }


src/share/vm/oops/fieldStreams.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File