Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp
32285 views
/*1* Copyright (c) 2013, Red Hat Inc.2* Copyright (c) 1999, 2010, Oracle and/or its affiliates.3* All rights reserved.4* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5*6* This code is free software; you can redistribute it and/or modify it7* under the terms of the GNU General Public License version 2 only, as8* published by the Free Software Foundation.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*24*/2526#ifndef CPU_AARCH64_VM_C1_MACROASSEMBLER_AARCH64_HPP27#define CPU_AARCH64_VM_C1_MACROASSEMBLER_AARCH64_HPP2829using MacroAssembler::build_frame;30using MacroAssembler::null_check;3132// C1_MacroAssembler contains high-level macros for C13334private:35int _rsp_offset; // track rsp changes36// initialization37void pd_init() { _rsp_offset = 0; }3839void zero_memory(Register addr, Register len, Register t1);4041public:42void try_allocate(43Register obj, // result: pointer to object after successful allocation44Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise45int con_size_in_bytes, // object size in bytes if known at compile time46Register t1, // temp register47Register t2, // temp register48Label& slow_case // continuation point if fast allocation fails49);5051void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2);52void initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register t1);5354void float_cmp(bool is_float, int unordered_result,55FloatRegister f0, FloatRegister f1,56Register result);5758// locking59// hdr : must be r0, contents destroyed60// obj : must point to the object to lock, contents preserved61// disp_hdr: must point to the displaced header location, contents preserved62// scratch : scratch register, contents destroyed63// returns code offset at which to add null check debug information64int lock_object (Register swap, Register obj, Register disp_hdr, Register scratch, Label& slow_case);6566// unlocking67// hdr : contents destroyed68// obj : must point to the object to lock, contents preserved69// disp_hdr: must be r0 & must point to the displaced header location, contents destroyed70void unlock_object(Register swap, Register obj, Register lock, Label& slow_case);7172void initialize_object(73Register obj, // result: pointer to object after successful allocation74Register klass, // object klass75Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise76int con_size_in_bytes, // object size in bytes if known at compile time77Register t1, // temp register78Register t2 // temp register79);8081// allocation of fixed-size objects82// (can also be used to allocate fixed-size arrays, by setting83// hdr_size correctly and storing the array length afterwards)84// obj : will contain pointer to allocated object85// t1, t2 : scratch registers - contents destroyed86// header_size: size of object header in words87// object_size: total size of object in words88// slow_case : exit to slow case implementation if fast allocation fails89void allocate_object(Register obj, Register t1, Register t2, int header_size, int object_size, Register klass, Label& slow_case);9091enum {92max_array_allocation_length = 0x00FFFFFF93};9495// allocation of arrays96// obj : will contain pointer to allocated object97// len : array length in number of elements98// t : scratch register - contents destroyed99// header_size: size of object header in words100// f : element scale factor101// slow_case : exit to slow case implementation if fast allocation fails102void allocate_array(Register obj, Register len, Register t, Register t2, int header_size, int f, Register klass, Label& slow_case);103104int rsp_offset() const { return _rsp_offset; }105void set_rsp_offset(int n) { _rsp_offset = n; }106107void invalidate_registers(bool inv_r0, bool inv_r19, bool inv_r2, bool inv_r3, bool inv_r4, bool inv_r5) PRODUCT_RETURN;108109#endif // CPU_AARCH64_VM_C1_MACROASSEMBLER_AARCH64_HPP110111112