Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiHartmann committed Jul 9, 2024
1 parent a1ce144 commit dc38ce4
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 32 deletions.
10 changes: 4 additions & 6 deletions src/hotspot/share/ci/ciTypeFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ ciType* ciTypeFlow::StateVector::type_meet_internal(ciType* t1, ciType* t2, ciTy
// But when (obj/flat)Array meets (obj/flat)Array, we look carefully at element types.
if ((k1->is_obj_array_klass() || k1->is_flat_array_klass()) &&
(k2->is_obj_array_klass() || k2->is_flat_array_klass())) {
bool null_free = k1->as_array_klass()->is_elem_null_free() &&
k2->as_array_klass()->is_elem_null_free();
ciType* elem1 = k1->as_array_klass()->element_klass();
ciType* elem2 = k2->as_array_klass()->element_klass();
ciType* elem = elem1;
Expand All @@ -334,14 +332,12 @@ ciType* ciTypeFlow::StateVector::type_meet_internal(ciType* t1, ciType* t2, ciTy
}
// Do an easy shortcut if one type is a super of the other.
if (elem == elem1 && !elem->is_inlinetype()) {
assert(k1 == ciArrayKlass::make(elem, null_free), "shortcut is OK");
assert(k1 == ciArrayKlass::make(elem), "shortcut is OK");
return k1;
} else if (elem == elem2 && !elem->is_inlinetype()) {
assert(k2 == ciArrayKlass::make(elem, null_free), "shortcut is OK");
assert(k2 == ciArrayKlass::make(elem), "shortcut is OK");
return k2;
} else {
// TODO 8325106 Remove
assert(!null_free, "should be dead");
return ciArrayKlass::make(elem);
}
} else {
Expand Down Expand Up @@ -606,6 +602,7 @@ void ciTypeFlow::StateVector::do_aload(ciBytecodeStream* str) {
} else {
if (array_klass->is_elem_null_free()) {
// TODO 8325106 Is this dead?
assert(false, "STILL LIVE?");
push(outer()->mark_as_null_free(element_klass));
} else {
push_object(element_klass);
Expand Down Expand Up @@ -636,6 +633,7 @@ void ciTypeFlow::StateVector::do_checkcast(ciBytecodeStream* str) {
}
if (klass->is_inlinetype() && type->is_null_free()) {
// TODO 8325106 Is this dead?
assert(false, "STILL LIVE?");
push(outer()->mark_as_null_free(klass));
} else {
push_object(klass);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ Klass* java_lang_Class::array_klass_acquire(oop java_class) {
void java_lang_Class::release_set_array_klass(oop java_class, Klass* klass) {
assert(klass->is_klass() && klass->is_array_klass(), "should be array klass");
if (klass->is_flatArray_klass() || (klass->is_objArray_klass() && ObjArrayKlass::cast(klass)->is_null_free_array_klass())) {
// TODO 8325106 Ignore flat / null-free arrays
// TODO 8336006 Ignore flat / null-free arrays
return;
}
java_class->release_metadata_field_put(_array_klass_offset, klass);
Expand Down
7 changes: 3 additions & 4 deletions src/hotspot/share/opto/graphKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4366,11 +4366,10 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
const TypeOopPtr* ary_type = ary_klass->as_instance_type();
const TypeAryPtr* ary_ptr = ary_type->isa_aryptr();

// TODO 8325106 Fix comment
// Inline type array variants:
// - null-ok: MyValue.ref[] (ciObjArrayKlass "[LMyValue")
// - null-free: MyValue.val[] (ciObjArrayKlass "[QMyValue")
// - null-free, flat : MyValue.val[] (ciFlatArrayKlass "[QMyValue")
// - null-ok: ciObjArrayKlass with is_elem_null_free() = false
// - null-free: ciObjArrayKlass with is_elem_null_free() = true
// - null-free, flat: ciFlatArrayKlass with is_elem_null_free() = true
// Check if array is a null-free, non-flat inline type array
// that needs to be initialized with the default inline type.
Node* default_value = nullptr;
Expand Down
7 changes: 3 additions & 4 deletions src/hotspot/share/opto/memnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ Node *MemNode::optimize_memory_chain(Node *mchain, const TypePtr *t_adr, Node *l
// clone the Phi with our address type
result = mphi->split_out_instance(t_adr, igvn);
} else {
// TODO 8325106
// assert(phase->C->get_alias_index(t) == phase->C->get_alias_index(t_adr), "correct memory chain");
assert(phase->C->get_alias_index(t) == phase->C->get_alias_index(t_adr), "correct memory chain");
}
}
return result;
Expand Down Expand Up @@ -2130,8 +2129,8 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
tkls->offset() == in_bytes(InstanceKlass::adr_inlineklass_fixed_block_offset())) {
assert(base->Opcode() == Op_LoadP, "must load an oop from klass");
assert(Opcode() == Op_LoadI, "must load an int from fixed block");
// TODO 8325106 remove?
assert(false, "NOT DEAD");
// TODO 8325106 Is this dead?
assert(false, "STILL LIVE?");
return TypeInt::make(tkls->exact_klass()->as_inline_klass()->default_value_offset());
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/opto/parse1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ Node* Parse::check_interpreter_type(Node* l, const Type* type,
// TypeFlow asserted a specific object type. Value must have that type.
Node* bad_type_ctrl = nullptr;
if (tp->is_inlinetypeptr() && !tp->maybe_null()) {
// TODO 8325106 Dead code?
// TODO 8325106 Is this dead?
assert(false, "STILL LIVE?");
// Check inline types for null here to prevent checkcast from adding an
// exception state before the bytecode entry (use 'bad_type_ctrl' instead).
l = null_check_oop(l, &bad_type_ctrl);
Expand Down
10 changes: 1 addition & 9 deletions src/hotspot/share/opto/parse3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,7 @@ void Parse::do_put_xxx(Node* obj, ciField* field, bool is_field) {
// TODO 8325106 Assert that we only do this in the constructor and align with checks in ::do_call
//if (_method->is_object_constructor() && _method->holder()->is_inlinetype()) {
assert(obj->as_InlineType()->is_larval(), "must be larval");

// TODO 8325106 Assert that holder is null-free
/*
int holder_depth = field->type()->size();
null_check(peek(holder_depth));
if (stopped()) {
return;
}
*/
assert(!_gvn.type(obj)->maybe_null(), "should never be null");

if (field->is_null_free()) {
PreserveReexecuteState preexecs(this);
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/opto/subtypenode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ Node *SubTypeCheckNode::Ideal(PhaseGVN* phase, bool can_reshape) {

// Verify that optimizing the subtype check to a simple code pattern
// when possible would not constant fold better
// TODO 8325106
// assert(verify(phase), "missing Value() optimization");
assert(verify(phase), "missing Value() optimization");

return nullptr;
}
Expand Down
9 changes: 5 additions & 4 deletions src/hotspot/share/opto/type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3678,8 +3678,8 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, const TypeInterfaces* inter
ciInstanceKlass* k = const_oop()->as_instance()->java_lang_Class_klass()->as_instance_klass();
if (k->is_inlinetype() && this->offset() == k->as_inline_klass()->default_value_offset()) {
// Special hidden field that contains the oop of the default inline type
// TODO 8325106 remove?
assert(false, "NOT DEAD");
// TODO 8325106 Is this dead?
assert(false, "STILL LIVE?");
_is_ptr_to_narrowoop = UseCompressedOops;
} else {
field = k->get_field_by_offset(this->offset(), true);
Expand Down Expand Up @@ -3871,9 +3871,10 @@ const TypeOopPtr* TypeOopPtr::make_from_klass_common(ciKlass *klass, bool klass_
} else if (klass->is_obj_array_klass()) {
// Element is an object or inline type array. Recursively call ourself.
const TypeOopPtr* etype = TypeOopPtr::make_from_klass_common(klass->as_array_klass()->element_klass(), /* klass_change= */ false, try_for_exact, interface_handling);
bool null_free = klass->as_array_klass()->is_elem_null_free();
bool null_free = klass->is_loaded() && klass->as_array_klass()->is_elem_null_free();
if (null_free) {
// TODO 8325106 assert to check if we ever even take this path?
// TODO 8325106 Is this dead?
assert(false, "STILL LIVE?");
etype = etype->join_speculative(TypePtr::NOTNULL)->is_oopptr();
}
// Determine null-free/flat properties
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/utilities/globalDefinitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,6 @@ inline bool is_double_word_type(BasicType t) {
}

inline bool is_reference_type(BasicType t, bool include_narrow_oop = false) {
// TODO 8325106 Remove the last occurences of T_PRIMITIVE_OBJECT
return (t == T_OBJECT || t == T_ARRAY || t == T_PRIMITIVE_OBJECT || (include_narrow_oop && t == T_NARROWOOP));
}

Expand Down

0 comments on commit dc38ce4

Please sign in to comment.