Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiHartmann committed Dec 12, 2024
1 parent 2191030 commit aab28cb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
3 changes: 0 additions & 3 deletions src/hotspot/share/c1/c1_GraphBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1825,9 +1825,6 @@ void GraphBuilder::copy_inline_content(ciInlineKlass* vk, Value src, int src_off
assert(!inner_field->is_flat(), "the iteration over nested fields is handled by the loop itself");
int off = inner_field->offset_in_bytes() - vk->first_field_offset();
LoadField* load = new LoadField(src, src_off + off, inner_field, false, state_before, false);
// TODO no null checks on holder required after first field copy
// load->needs_null_check(false)
// dest->needs_null_check(false)
Value replacement = append(load);
StoreField* store = new StoreField(dest, dest_off + off, inner_field, replacement, false, state_before, false);
store->set_enclosing_field(enclosing_field);
Expand Down
12 changes: 1 addition & 11 deletions src/hotspot/share/oops/inlineKlass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,24 +321,14 @@ int InlineKlass::collect_fields(GrowableArray<SigEntry>* sig, float& max_offset,
// Null markers are no real fields, add them manually at the end (C2 relies on this) of the flat fields
if (null_marker_offset != -1) {
max_offset += 0.1f; // We add the markers "in-between" because they are no real fields
//tty->print_cr("MARKER %d %d %f", null_marker_offset, offset, max_offset);
SigEntry::add_entry(sig, T_BOOLEAN, name(), null_marker_offset, max_offset);
count++;
}
// TODO I think this is incorrect
// TODO Shouldn't this use max_offset?
SigEntry::add_entry(sig, T_VOID, name(), offset);
if (base_off == 0) {
sig->sort(SigEntry::compare);
/*
tty->print_cr("##\n");
print();
for (int i = 0; i < sig->length(); ++i) {
tty->print_cr("%s %d %f %s", type2name(sig->at(i)._bt), sig->at(i)._offset, sig->at(i)._sort_offset, (sig->at(i)._offset != sig->at(i)._sort_offset) ? " MARKER" : "");
}
tty->print_cr("##\n");
*/
}

assert(sig->at(0)._bt == T_METADATA && sig->at(sig->length()-1)._bt == T_VOID, "broken structure");
return count;
}
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/opto/inlinetypenode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,8 @@ void InlineTypeNode::load(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass*
value = make_default_impl(kit->gvn(), ft->as_inline_klass(), visited);
} else if (field_is_flat(i)) {
// Recursively load the flat inline type field
assert(field_is_null_free(i) == (field_null_marker_offset(i) == -1), "inconsistency");
value = make_from_flat_impl(kit, ft->as_inline_klass(), base, ptr, holder, offset, holder_offset + field_null_marker_offset(i), decorators, visited);
int nm_offset = field_is_null_free(i) ? -1 : (holder_offset + field_null_marker_offset(i));
value = make_from_flat_impl(kit, ft->as_inline_klass(), base, ptr, holder, offset, nm_offset, decorators, visited);
} else {
const TypeOopPtr* oop_ptr = kit->gvn().type(base)->isa_oopptr();
bool is_array = (oop_ptr->isa_aryptr() != nullptr);
Expand Down Expand Up @@ -586,8 +586,8 @@ void InlineTypeNode::store(GraphKit* kit, Node* base, Node* ptr, ciInstanceKlass
ciType* ft = field_type(i);
if (field_is_flat(i)) {
// Recursively store the flat inline type field
assert(field_is_null_free(i) == (field_null_marker_offset(i) == -1), "inconsistency");
value->as_InlineType()->store_flat(kit, base, ptr, holder, offset, holder_offset + field_null_marker_offset(i), decorators);
int nm_offset = field_is_null_free(i) ? -1 : (holder_offset + field_null_marker_offset(i));
value->as_InlineType()->store_flat(kit, base, ptr, holder, offset, nm_offset, decorators);
} else {
// Store field value to memory
const TypePtr* adr_type = field_adr_type(base, offset, holder, decorators, kit->gvn());
Expand Down

0 comments on commit aab28cb

Please sign in to comment.