< prev index next >

src/hotspot/share/opto/parseHelper.cpp

Print this page




 354   Node* val = type2size[bt] == 1 ? pop() : pop_pair();
 355   ciValueKlass* holder_klass = field->holder()->as_value_klass();
 356   Node* holder = pop();
 357 
 358   if (!holder->is_ValueType()) {
 359     // Null check and scalarize value type holder
 360     inc_sp(2);
 361     holder = null_check(holder);
 362     dec_sp(2);
 363     if (stopped()) return;
 364     holder = ValueTypeNode::make_from_oop(this, holder, holder_klass);
 365   }
 366   if (!val->is_ValueType() && field->is_flattenable()) {
 367     // Null check and scalarize value type field value
 368     inc_sp(2);
 369     val = null_check(val);
 370     dec_sp(2);
 371     if (stopped()) return;
 372     val = ValueTypeNode::make_from_oop(this, val, gvn().type(val)->value_klass());
 373   } else if (val->is_ValueType() && !field->is_flattenable()) {
 374     // Non-flattenable field should not be scalarized
 375     // Re-execute withfield if buffering triggers deoptimization
 376     PreserveReexecuteState preexecs(this);
 377     jvms()->set_should_reexecute(true);
 378     inc_sp(2);
 379     val = ValueTypePtrNode::make_from_value_type(this, val->as_ValueType());
 380   }
 381 
 382   // Clone the value type node and set the new field value
 383   ValueTypeNode* new_vt = holder->clone()->as_ValueType();
 384   new_vt->set_oop(_gvn.zerocon(T_VALUETYPE));
 385   gvn().set_type(new_vt, new_vt->bottom_type());
 386   new_vt->set_field_value_by_offset(field->offset(), val);
 387 
 388   if (holder_klass->is_scalarizable()) {
 389     push(_gvn.transform(new_vt));
 390   } else {
 391     // Re-execute withfield if buffering triggers deoptimization
 392     PreserveReexecuteState preexecs(this);
 393     jvms()->set_should_reexecute(true);
 394     inc_sp(2);
 395     push(new_vt->allocate(this)->get_oop());




 354   Node* val = type2size[bt] == 1 ? pop() : pop_pair();
 355   ciValueKlass* holder_klass = field->holder()->as_value_klass();
 356   Node* holder = pop();
 357 
 358   if (!holder->is_ValueType()) {
 359     // Null check and scalarize value type holder
 360     inc_sp(2);
 361     holder = null_check(holder);
 362     dec_sp(2);
 363     if (stopped()) return;
 364     holder = ValueTypeNode::make_from_oop(this, holder, holder_klass);
 365   }
 366   if (!val->is_ValueType() && field->is_flattenable()) {
 367     // Null check and scalarize value type field value
 368     inc_sp(2);
 369     val = null_check(val);
 370     dec_sp(2);
 371     if (stopped()) return;
 372     val = ValueTypeNode::make_from_oop(this, val, gvn().type(val)->value_klass());
 373   } else if (val->is_ValueType() && !field->is_flattenable()) {
 374     // Non-flattenable field value needs to be allocated because it can be merged
 375     // with an oop. Re-execute withfield if buffering triggers deoptimization.
 376     PreserveReexecuteState preexecs(this);
 377     jvms()->set_should_reexecute(true);
 378     inc_sp(2);
 379     val = ValueTypePtrNode::make_from_value_type(this, val->as_ValueType());
 380   }
 381 
 382   // Clone the value type node and set the new field value
 383   ValueTypeNode* new_vt = holder->clone()->as_ValueType();
 384   new_vt->set_oop(_gvn.zerocon(T_VALUETYPE));
 385   gvn().set_type(new_vt, new_vt->bottom_type());
 386   new_vt->set_field_value_by_offset(field->offset(), val);
 387 
 388   if (holder_klass->is_scalarizable()) {
 389     push(_gvn.transform(new_vt));
 390   } else {
 391     // Re-execute withfield if buffering triggers deoptimization
 392     PreserveReexecuteState preexecs(this);
 393     jvms()->set_should_reexecute(true);
 394     inc_sp(2);
 395     push(new_vt->allocate(this)->get_oop());


< prev index next >