/* * Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// Note: Rtemp usage is this file should not impact C2 and should be // correct as long as it is not implicitly used in lower layers (the // arm [macro]assembler) and used with care in the other C1 specific // files.
// FP can no longer be used to memorize SP. It may be modified // if this method contains a methodHandle call site
raw_push(FP, LR);
sub_slow(SP, SP, frame_size_in_bytes);
}
if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) { if (obj_size_in_bytes >= 0 && obj_size_in_bytes <= 8 * BytesPerWord) {
mov(tmp1, 0); constint base = instanceOopDesc::header_size() * HeapWordSize; for (int i = base; i < obj_size_in_bytes; i += wordSize) {
str(tmp1, Address(obj, i));
}
} else {
assert(header_size.is_constant() || header_size.as_register() == ptr, "code assumption");
add(ptr, obj, header_size);
initialize_body(ptr, obj_end, tmp1);
}
}
// StoreStore barrier required after complete initialization // (headers + content zeroing), before the object may escape.
membar(MacroAssembler::StoreStore, tmp1);
}
assert(oopDesc::mark_offset_in_bytes() == 0, "Required by atomic instructions");
// On MP platforms the next load could return a 'stale' value if the memory location has been modified by another thread. // That would be acceptable as ether CAS or slow case path is taken in that case.
// Must be the first instruction here, because implicit null check relies on it
ldr(hdr, Address(obj, oopDesc::mark_offset_in_bytes()));
// Check for recursive locking // See comments in InterpreterMacroAssembler::lock_object for // explanations on the fast recursive locking check. // -1- test low 2 bits
movs(tmp2, AsmOperand(hdr, lsl, 30)); // -2- test (hdr - SP) if the low two bits are 0
sub(tmp2, hdr, SP, eq);
movs(tmp2, AsmOperand(tmp2, lsr, exact_log2(os::vm_page_size())), eq); // If still 'eq' then recursive locking OK // set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8267042)
str(tmp2, Address(disp_hdr, mark_offset));
b(fast_lock_done, eq); // else need slow case
b(slow_case);
bind(fast_lock); // Save previous object header in BasicLock structure and update the header
str(hdr, Address(disp_hdr, mark_offset));
assert(oopDesc::mark_offset_in_bytes() == 0, "Required by atomic instructions");
// Load displaced header and object from the lock
ldr(hdr, Address(disp_hdr, mark_offset)); // If hdr is NULL, we've got recursive locking and there's nothing more to do
cbz(hdr, done);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.