--- old/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp 2019-01-24 17:46:34.918710366 +0000 +++ new/src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp 2019-01-24 17:46:34.158676588 +0000 @@ -175,11 +175,12 @@ // Implementation of NewObjectArrayStub -NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) { +NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info, bool is_value_type) { _klass_reg = klass_reg; _result = result; _length = length; _info = new CodeEmitInfo(info); + _is_value_type = is_value_type; } @@ -188,7 +189,13 @@ __ bind(_entry); assert(_length->as_register() == r19, "length must in r19,"); assert(_klass_reg->as_register() == r3, "klass_reg must in r3"); - __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id))); + + if (_is_value_type) { + __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_value_array_id))); + } else { + __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::new_object_array_id))); + } + ce->add_call_info_here(_info); ce->verify_oop_map(_info); assert(_result->as_register() == r0, "result must in r0"); @@ -196,16 +203,30 @@ } // Implementation of MonitorAccessStubs -MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info) +MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info, CodeStub* throw_imse_stub, LIR_Opr scratch_reg) : MonitorAccessStub(obj_reg, lock_reg) { _info = new CodeEmitInfo(info); + _scratch_reg = scratch_reg; + _throw_imse_stub = throw_imse_stub; + if (_throw_imse_stub != NULL) { + assert(_scratch_reg != LIR_OprFact::illegalOpr, "must be"); + } } void MonitorEnterStub::emit_code(LIR_Assembler* ce) { assert(__ rsp_offset() == 0, "frame size should be fixed"); __ bind(_entry); + if (_throw_imse_stub != NULL) { + // When we come here, _obj_reg has already been checked to be non-null. + Register mark = _scratch_reg->as_register(); + __ ldr(mark, Address(_obj_reg->as_register(), oopDesc::mark_offset_in_bytes())); + __ andr(mark, mark, (u1) markOopDesc::always_locked_pattern && 0xF); + __ cmp(r2, (u1) markOopDesc::always_locked_pattern); + __ br(Assembler::NE, *_throw_imse_stub->entry()); + } + ce->store_parameter(_obj_reg->as_register(), 1); ce->store_parameter(_lock_reg->as_register(), 0); Runtime1::StubID enter_id;