Skip to content

Commit

Permalink
Aaand more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiHartmann committed Jul 25, 2024
1 parent fc20abb commit aed3d16
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/hotspot/share/opto/compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,9 @@ void Compile::process_inline_types(PhaseIterGVN &igvn, bool remove) {
// Delay this until all inlining is over to avoid getting inconsistent debug info.
set_scalarize_in_safepoints(true);
for (int i = _inline_type_nodes.length()-1; i >= 0; i--) {
_inline_type_nodes.at(i)->as_InlineType()->make_scalar_in_safepoints(&igvn);
InlineTypeNode* vt = _inline_type_nodes.at(i)->as_InlineType();
vt->make_scalar_in_safepoints(&igvn);
igvn.record_for_igvn(vt);
}
if (remove) {
// Remove inline type nodes by replacing them with their oop input
Expand Down
13 changes: 7 additions & 6 deletions src/hotspot/share/opto/inlinetypenode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,8 @@ void InlineTypeNode::make_scalar_in_safepoint(PhaseIterGVN* igvn, Unique_Node_Li
sobj->init_req(0, igvn->C->root());
// Nullable inline types have an IsInit field that needs
// to be checked before using the field values.
if (!igvn->type(get_is_init())->is_int()->is_con(1)) {
const TypeInt* tinit = igvn->type(get_is_init())->isa_int();
if (tinit != nullptr && tinit->is_con(1)) {
sfpt->add_req(get_is_init());
} else {
sfpt->add_req(igvn->C->top());
Expand Down Expand Up @@ -831,8 +832,8 @@ InlineTypeNode* InlineTypeNode::make_default_impl(PhaseGVN& gvn, ciInlineKlass*
}

bool InlineTypeNode::is_default(PhaseGVN* gvn) const {
const Type* tinit = gvn->type(get_is_init());
if (!tinit->isa_int() || !tinit->is_int()->is_con(1)) {
const TypeInt* tinit = gvn->type(get_is_init())->isa_int();
if (tinit == nullptr|| !tinit->is_con(1)) {
return false; // May be null
}
for (uint i = 0; i < field_count(); ++i) {
Expand All @@ -845,8 +846,8 @@ bool InlineTypeNode::is_default(PhaseGVN* gvn) const {
continue;
} else if (value->is_InlineType()) {
// Nullable value class field must be null
const Type* tinit = gvn->type(value->as_InlineType()->get_is_init());
if (tinit->isa_int() && tinit->is_int()->is_con(0)) {
tinit = gvn->type(value->as_InlineType()->get_is_init())->isa_int();
if (tinit != nullptr && tinit->is_con(0)) {
continue;
}
return false;
Expand Down Expand Up @@ -877,7 +878,7 @@ InlineTypeNode* InlineTypeNode::make_from_oop_impl(GraphKit* kit, Node* oop, ciI
InlineTypeNode* vt = nullptr;

if (oop->isa_InlineType()) {
// TODO 8325106 Re-enable assert and fix OSR code
// TODO 8335256 Re-enable assert and fix OSR code
// Issue triggers with TestValueConstruction.java and -XX:Tier0BackedgeNotifyFreqLog=0 -XX:Tier2BackedgeNotifyFreqLog=0 -XX:Tier3BackedgeNotifyFreqLog=0 -XX:Tier2BackEdgeThreshold=1 -XX:Tier3BackEdgeThreshold=1 -XX:Tier4BackEdgeThreshold=1 -Xbatch -XX:-TieredCompilation
// assert(!is_larval || oop->as_InlineType()->is_larval(), "must be larval");
if (is_larval && !oop->as_InlineType()->is_larval()) {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/opto/inlinetypenode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class InlineTypeNode : public TypeNode {
bool _is_larval;

virtual uint hash() const { return TypeNode::hash() + _is_larval; }
// TODO 8325106 why can't we gvn larvals?
virtual bool cmp(const Node &n) const { return TypeNode::cmp(n) && !((InlineTypeNode&)n)._is_larval && !_is_larval; }
// Don't GVN larvals during parsing because the inputs might be updated
virtual bool cmp(const Node &n) const { return TypeNode::cmp(n) && (Compile::current()->scalarize_in_safepoints() || !(n.isa_InlineType()->_is_larval || _is_larval)); }
virtual uint size_of() const { return sizeof(*this); }

// Get the klass defining the field layout of the inline type
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/runtime/sharedRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,6 @@ Handle SharedRuntime::find_callee_info_helper(vframeStream& vfst, Bytecodes::Cod
} else {
assert(attached_method->has_scalarized_args(), "invalid use of attached method");
if (!attached_method->method_holder()->is_inline_klass()) {
// TODO 8325106 is this still needed?
// Ignore the attached method in this case to not confuse below code
attached_method = methodHandle(current, nullptr);
}
Expand Down

0 comments on commit aed3d16

Please sign in to comment.