Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 28 additions & 14 deletions src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -1898,12 +1898,6 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
Compile* C = ra_->C;
C2_MacroAssembler _masm(&cbuf);

__ verified_entry(C, 0);
__ bind(*_verified_entry);
// n.b. frame size includes space for return pc and rfp
const int framesize = C->output()->frame_size_in_bytes();
assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");

// insert a nop at the start of the prolog so we can patch in a
// branch if we need to invalidate the method later
__ nop();
Expand All @@ -1923,11 +1917,8 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
__ reinitialize_ptrue();
}

int bangsize = C->output()->bang_size_in_bytes();
if (C->output()->need_stack_bang(bangsize))
__ generate_stack_overflow_check(bangsize);

__ build_frame(framesize);
__ verified_entry(C, 0);
__ bind(*_verified_entry);

if (C->stub_function() == NULL) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
Expand Down Expand Up @@ -3938,6 +3929,12 @@ encode %{
// Set tmp to be (markWord of object | UNLOCK_VALUE).
__ orr(tmp, disp_hdr, markWord::unlocked_value);

if (EnableValhalla) {
assert(!UseBiasedLocking, "Not compatible with biased-locking");
// Mask inline_type bit such that we go to the slow path if object is an inline type
__ andr(tmp, tmp, ~((int) markWord::inline_type_bit_in_place));
}

// Initialize the box. (Must happen before we update the object mark!)
__ str(tmp, Address(box, BasicLock::displaced_header_offset_in_bytes()));

Expand Down Expand Up @@ -14979,9 +14976,9 @@ instruct MoveL2D_reg_reg(vRegD dst, iRegL src) %{
// ============================================================================
// clearing of an array

instruct clearArray_reg_reg(iRegL_R11 cnt, iRegP_R10 base, iRegL val, Universe dummy, rFlagsReg cr)
instruct clearArray_reg_reg_immL0(iRegL_R11 cnt, iRegP_R10 base, immL0 zero, Universe dummy, rFlagsReg cr)
%{
match(Set dummy (ClearArray (Binary cnt base) val));
match(Set dummy (ClearArray (Binary cnt base) zero));
effect(USE_KILL cnt, USE_KILL base, KILL cr);

ins_cost(4 * INSN_COST);
Expand All @@ -14998,10 +14995,27 @@ instruct clearArray_reg_reg(iRegL_R11 cnt, iRegP_R10 base, iRegL val, Universe d
ins_pipe(pipe_class_memory);
%}

instruct clearArray_reg_reg(iRegL_R11 cnt, iRegP_R10 base, iRegL val, Universe dummy, rFlagsReg cr)
%{
predicate(((ClearArrayNode*)n)->word_copy_only());
match(Set dummy (ClearArray (Binary cnt base) val));
effect(USE_KILL cnt, USE_KILL base, KILL cr);

ins_cost(4 * INSN_COST);
format %{ "ClearArray $cnt, $base, $val" %}

ins_encode %{
__ fill_words($base$$Register, $cnt$$Register, $val$$Register);
%}

ins_pipe(pipe_class_memory);
%}

instruct clearArray_imm_reg(immL cnt, iRegP_R10 base, Universe dummy, rFlagsReg cr)
%{
predicate((uint64_t)n->in(2)->get_long()
< (uint64_t)(BlockZeroingLowLimit >> LogBytesPerWord));
< (uint64_t)(BlockZeroingLowLimit >> LogBytesPerWord)
&& !((ClearArrayNode*)n)->word_copy_only());
match(Set dummy (ClearArray cnt base));
effect(USE_KILL base);

Expand Down
10 changes: 6 additions & 4 deletions src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -208,6 +208,7 @@ NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKl
_klass_reg = klass_reg;
_info = new CodeEmitInfo(info);
assert(stub_id == Runtime1::new_instance_id ||
stub_id == Runtime1::new_instance_no_inline_id ||
stub_id == Runtime1::fast_new_instance_id ||
stub_id == Runtime1::fast_new_instance_init_check_id,
"need new_instance id");
Expand Down Expand Up @@ -253,7 +254,8 @@ void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {

// Implementation of NewObjectArrayStub

NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info, bool is_inline_type) {
NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result,
CodeEmitInfo* info, bool is_inline_type) {
_klass_reg = klass_reg;
_result = result;
_length = length;
Expand Down Expand Up @@ -299,11 +301,11 @@ void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
if (_throw_imse_stub != NULL) {
// When we come here, _obj_reg has already been checked to be non-null.
__ ldr(rscratch1, Address(_obj_reg->as_register(), oopDesc::mark_offset_in_bytes()));
__ mov(rscratch2, markWord::always_locked_pattern);
__ mov(rscratch2, markWord::inline_type_pattern);
__ andr(rscratch1, rscratch1, rscratch2);

__ cmp(rscratch1, rscratch2);
__ br(Assembler::NE, *_throw_imse_stub->entry());
__ br(Assembler::EQ, *_throw_imse_stub->entry());
}

ce->store_parameter(_obj_reg->as_register(), 1);
Expand Down
Loading