Path: blob/master/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.hpp
40930 views
/*1* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.2* Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef CPU_AARCH64_C1_MACROASSEMBLER_AARCH64_HPP26#define CPU_AARCH64_C1_MACROASSEMBLER_AARCH64_HPP2728using MacroAssembler::build_frame;29using MacroAssembler::null_check;3031// C1_MacroAssembler contains high-level macros for C13233private:34int _rsp_offset; // track rsp changes35// initialization36void pd_init() { _rsp_offset = 0; }373839public:40void try_allocate(41Register obj, // result: pointer to object after successful allocation42Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise43int con_size_in_bytes, // object size in bytes if known at compile time44Register t1, // temp register45Register t2, // temp register46Label& slow_case // continuation point if fast allocation fails47);4849void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2);50void initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register t1);5152void float_cmp(bool is_float, int unordered_result,53FloatRegister f0, FloatRegister f1,54Register result);5556// locking57// hdr : must be r0, contents destroyed58// obj : must point to the object to lock, contents preserved59// disp_hdr: must point to the displaced header location, contents preserved60// scratch : scratch register, contents destroyed61// returns code offset at which to add null check debug information62int lock_object (Register swap, Register obj, Register disp_hdr, Register scratch, Label& slow_case);6364// unlocking65// hdr : contents destroyed66// obj : must point to the object to lock, contents preserved67// disp_hdr: must be r0 & must point to the displaced header location, contents destroyed68void unlock_object(Register swap, Register obj, Register lock, Label& slow_case);6970void initialize_object(71Register obj, // result: pointer to object after successful allocation72Register klass, // object klass73Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise74int con_size_in_bytes, // object size in bytes if known at compile time75Register t1, // temp register76Register t2, // temp register77bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB78);7980// allocation of fixed-size objects81// (can also be used to allocate fixed-size arrays, by setting82// hdr_size correctly and storing the array length afterwards)83// obj : will contain pointer to allocated object84// t1, t2 : scratch registers - contents destroyed85// header_size: size of object header in words86// object_size: total size of object in words87// slow_case : exit to slow case implementation if fast allocation fails88void allocate_object(Register obj, Register t1, Register t2, int header_size, int object_size, Register klass, Label& slow_case);8990enum {91max_array_allocation_length = 0x00FFFFFF92};9394// allocation of arrays95// obj : will contain pointer to allocated object96// len : array length in number of elements97// t : scratch register - contents destroyed98// header_size: size of object header in words99// f : element scale factor100// slow_case : exit to slow case implementation if fast allocation fails101void allocate_array(Register obj, Register len, Register t, Register t2, int header_size, int f, Register klass, Label& slow_case);102103int rsp_offset() const { return _rsp_offset; }104void set_rsp_offset(int n) { _rsp_offset = n; }105106void invalidate_registers(bool inv_r0, bool inv_r19, bool inv_r2, bool inv_r3, bool inv_r4, bool inv_r5) PRODUCT_RETURN;107108// This platform only uses signal-based null checks. The Label is not needed.109void null_check(Register r, Label *Lnull = NULL) { MacroAssembler::null_check(r); }110111void load_parameter(int offset_in_words, Register reg);112113#endif // CPU_AARCH64_C1_MACROASSEMBLER_AARCH64_HPP114115116