mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8237767: Field layout computation overhaul
Reviewed-by: dholmes, coleenp, lfoltan, shade
This commit is contained in:
parent
304d764a72
commit
9886cb401c
19 changed files with 1528 additions and 231 deletions
|
@ -1156,18 +1156,18 @@ int compare(ReassignedField* left, ReassignedField* right) {
|
|||
// Restore fields of an eliminated instance object using the same field order
|
||||
// returned by HotSpotResolvedObjectTypeImpl.getInstanceFields(true)
|
||||
static int reassign_fields_by_klass(InstanceKlass* klass, frame* fr, RegisterMap* reg_map, ObjectValue* sv, int svIndex, oop obj, bool skip_internal) {
|
||||
if (klass->superklass() != NULL) {
|
||||
svIndex = reassign_fields_by_klass(klass->superklass(), fr, reg_map, sv, svIndex, obj, skip_internal);
|
||||
}
|
||||
|
||||
GrowableArray<ReassignedField>* fields = new GrowableArray<ReassignedField>();
|
||||
for (AllFieldStream fs(klass); !fs.done(); fs.next()) {
|
||||
if (!fs.access_flags().is_static() && (!skip_internal || !fs.access_flags().is_internal())) {
|
||||
ReassignedField field;
|
||||
field._offset = fs.offset();
|
||||
field._type = Signature::basic_type(fs.signature());
|
||||
fields->append(field);
|
||||
InstanceKlass* ik = klass;
|
||||
while (ik != NULL) {
|
||||
for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
|
||||
if (!fs.access_flags().is_static() && (!skip_internal || !fs.access_flags().is_internal())) {
|
||||
ReassignedField field;
|
||||
field._offset = fs.offset();
|
||||
field._type = Signature::basic_type(fs.signature());
|
||||
fields->append(field);
|
||||
}
|
||||
}
|
||||
ik = ik->superklass();
|
||||
}
|
||||
fields->sort(compare);
|
||||
for (int i = 0; i < fields->length(); i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue