< prev index next >

src/hotspot/share/oops/fieldInfo.cpp

Print this page

 91   int ifc = r.next_uint();
 92   assert(ifc == injected_fields, "Must be");
 93   for (int i = 0; i < jfc + ifc; i++) {
 94     FieldInfo fi;
 95     r.read_field_info(fi);
 96     FieldInfo* fi_ref = fields->adr_at(i);
 97     assert(fi_ref->name_index() == fi.name_index(), "Must be");
 98     assert(fi_ref->signature_index() == fi.signature_index(), "Must be");
 99     assert(fi_ref->offset() == fi.offset(), "Must be");
100     assert(fi_ref->access_flags().as_int() == fi.access_flags().as_int(), "Must be");
101     assert(fi_ref->field_flags().as_uint() == fi.field_flags().as_uint(), " Must be");
102     if(fi_ref->field_flags().is_initialized()) {
103       assert(fi_ref->initializer_index() == fi.initializer_index(), "Must be");
104     }
105     if (fi_ref->field_flags().is_generic()) {
106       assert(fi_ref->generic_signature_index() == fi.generic_signature_index(), "Must be");
107     }
108     if (fi_ref->field_flags().is_contended()) {
109       assert(fi_ref->contended_group() == fi.contended_group(), "Must be");
110     }






111   }
112 #endif // ASSERT
113 
114   return fis;
115 }
116 
117 GrowableArray<FieldInfo>* FieldInfoStream::create_FieldInfoArray(const Array<u1>* fis, int* java_fields_count, int* injected_fields_count) {
118   int length = FieldInfoStream::num_total_fields(fis);
119   GrowableArray<FieldInfo>* array = new GrowableArray<FieldInfo>(length);
120   FieldInfoReader r(fis);
121   *java_fields_count = r.next_uint();
122   *injected_fields_count = r.next_uint();
123   while (r.has_next()) {
124     FieldInfo fi;
125     r.read_field_info(fi);
126     array->append(fi);
127   }
128   assert(array->length() == length, "Must be");
129   assert(array->length() == *java_fields_count + *injected_fields_count, "Must be");
130   return array;

 91   int ifc = r.next_uint();
 92   assert(ifc == injected_fields, "Must be");
 93   for (int i = 0; i < jfc + ifc; i++) {
 94     FieldInfo fi;
 95     r.read_field_info(fi);
 96     FieldInfo* fi_ref = fields->adr_at(i);
 97     assert(fi_ref->name_index() == fi.name_index(), "Must be");
 98     assert(fi_ref->signature_index() == fi.signature_index(), "Must be");
 99     assert(fi_ref->offset() == fi.offset(), "Must be");
100     assert(fi_ref->access_flags().as_int() == fi.access_flags().as_int(), "Must be");
101     assert(fi_ref->field_flags().as_uint() == fi.field_flags().as_uint(), " Must be");
102     if(fi_ref->field_flags().is_initialized()) {
103       assert(fi_ref->initializer_index() == fi.initializer_index(), "Must be");
104     }
105     if (fi_ref->field_flags().is_generic()) {
106       assert(fi_ref->generic_signature_index() == fi.generic_signature_index(), "Must be");
107     }
108     if (fi_ref->field_flags().is_contended()) {
109       assert(fi_ref->contended_group() == fi.contended_group(), "Must be");
110     }
111     if (fi_ref->field_flags().is_flat()) {
112       assert(fi_ref->layout_kind() == fi.layout_kind(), "Must be");
113     }
114     if (fi_ref->field_flags().has_null_marker()) {
115       assert(fi_ref->null_marker_offset() == fi.null_marker_offset(), "Must be");
116     }
117   }
118 #endif // ASSERT
119 
120   return fis;
121 }
122 
123 GrowableArray<FieldInfo>* FieldInfoStream::create_FieldInfoArray(const Array<u1>* fis, int* java_fields_count, int* injected_fields_count) {
124   int length = FieldInfoStream::num_total_fields(fis);
125   GrowableArray<FieldInfo>* array = new GrowableArray<FieldInfo>(length);
126   FieldInfoReader r(fis);
127   *java_fields_count = r.next_uint();
128   *injected_fields_count = r.next_uint();
129   while (r.has_next()) {
130     FieldInfo fi;
131     r.read_field_info(fi);
132     array->append(fi);
133   }
134   assert(array->length() == length, "Must be");
135   assert(array->length() == *java_fields_count + *injected_fields_count, "Must be");
136   return array;
< prev index next >