@@ -277,15 +277,16 @@ int InlineTypeNode::field_null_marker_offset(uint index) const {
277
277
return field->null_marker_offset ();
278
278
}
279
279
280
- uint InlineTypeNode::add_fields_to_safepoint (Unique_Node_List& worklist, Node_List& null_markers, SafePointNode* sfpt) {
280
+ uint InlineTypeNode::add_fields_to_safepoint (Unique_Node_List& worklist, SafePointNode* sfpt) {
281
281
uint cnt = 0 ;
282
282
for (uint i = 0 ; i < field_count (); ++i) {
283
283
Node* value = field_value (i);
284
284
if (field_is_flat (i)) {
285
285
InlineTypeNode* vt = value->as_InlineType ();
286
- cnt += vt->add_fields_to_safepoint (worklist, null_markers, sfpt);
286
+ cnt += vt->add_fields_to_safepoint (worklist, sfpt);
287
287
if (!field_is_null_free (i)) {
288
- null_markers.push (vt->get_is_init ());
288
+ // The null marker of a flat field is added right after we scalarize that field
289
+ sfpt->add_req (vt->get_is_init ());
289
290
cnt++;
290
291
}
291
292
continue ;
@@ -308,18 +309,8 @@ void InlineTypeNode::make_scalar_in_safepoint(PhaseIterGVN* igvn, Unique_Node_Li
308
309
// Iterate over the inline type fields in order of increasing offset and add the
309
310
// field values to the safepoint. Nullable inline types have an IsInit field that
310
311
// needs to be checked before using the field values.
311
- const TypeInt* tinit = igvn->type (get_is_init ())->isa_int ();
312
- if (tinit != nullptr && !tinit->is_con (1 )) {
313
- sfpt->add_req (get_is_init ());
314
- } else {
315
- sfpt->add_req (igvn->C ->top ());
316
- }
317
- Node_List null_markers;
318
- uint nfields = add_fields_to_safepoint (worklist, null_markers, sfpt);
319
- // Add null markers after the field values
320
- for (uint i = 0 ; i < null_markers.size (); ++i) {
321
- sfpt->add_req (null_markers.at (i));
322
- }
312
+ sfpt->add_req (get_is_init ());
313
+ uint nfields = add_fields_to_safepoint (worklist, sfpt);
323
314
jvms->set_endoff (sfpt->req ());
324
315
// Replace safepoint edge by SafePointScalarObjectNode
325
316
SafePointScalarObjectNode* sobj = new SafePointScalarObjectNode (type ()->isa_instptr (),
@@ -1606,7 +1597,7 @@ InlineTypeNode* InlineTypeNode::make_null(PhaseGVN& gvn, ciInlineKlass* vk, bool
1606
1597
InlineTypeNode* InlineTypeNode::make_null_impl (PhaseGVN& gvn, ciInlineKlass* vk, GrowableArray<ciType*>& visited, bool transform) {
1607
1598
InlineTypeNode* vt = new InlineTypeNode (vk, gvn.zerocon (T_OBJECT), /* null_free= */ false );
1608
1599
vt->set_is_buffered (gvn);
1609
- vt->set_is_init (gvn, false );
1600
+ vt->set_is_init (gvn, gvn. intcon ( 0 ) );
1610
1601
for (uint i = 0 ; i < vt->field_count (); i++) {
1611
1602
ciType* ft = vt->field_type (i);
1612
1603
Node* value = gvn.zerocon (ft->basic_type ());
0 commit comments