Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8273594: [lworld] JITs need to properly handle static inline type field with unloaded type #551

Closed
wants to merge 9 commits into from
@@ -2049,7 +2049,7 @@ bool LIRGenerator::inline_type_field_access_prolog(AccessField* x) {
bool could_be_null = x->is_static() && x->as_LoadField() != NULL && !field->type()->is_loaded();
if (could_be_flat || could_be_null) {
CodeEmitInfo* info = state_for(x, x->state_before());
CodeStub* stub = new DeoptimizeStub(info,
CodeStub* stub = new DeoptimizeStub(new CodeEmitInfo(info),
Deoptimization::Reason_unloaded,
Deoptimization::Action_make_not_entrant);
__ jump(stub);
@@ -322,19 +322,6 @@ int ciBytecodeStream::get_field_holder_index() {
)
}

// ------------------------------------------------------------------
// ciBytecodeStream::get_field_signature_index
//
// Get the constant pool index of the signature of the field
// referenced by the current bytecode. Used for generating
// deoptimization information.
int ciBytecodeStream::get_field_signature_index() {
VM_ENTRY_MARK;
ConstantPool* cpool = _holder->get_instanceKlass()->constants();
int nt_index = cpool->name_and_type_ref_index_at(get_field_index());
return cpool->signature_ref_index_at(nt_index);
}

// ------------------------------------------------------------------
// ciBytecodeStream::get_method_index
//
@@ -245,7 +245,6 @@ class ciBytecodeStream : StackObj {

ciInstanceKlass* get_declared_field_holder();
int get_field_holder_index();
int get_field_signature_index();

ciMethod* get_method(bool& will_link, ciSignature* *declared_signature_result);
bool has_appendix();
@@ -673,7 +673,10 @@ void ciTypeFlow::StateVector::do_getstatic(ciBytecodeStream* str) {
if (field->is_static() && field->is_null_free()) {
// Deoptimize if we load from a static field with an unloaded
// inline type because we need the default value if the field is null.
trap(str, field_type->as_klass(), str->get_field_signature_index());
trap(str, field_type->as_klass(),
Deoptimization::make_trap_request
(Deoptimization::Reason_unloaded,
Deoptimization::Action_reinterpret));
return;
}
// Normally, we need the field's type to be loaded if we are to