1 /* 2 * Copyright (c) 2019, Oracle and/or its affiliates. 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 it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 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 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 #ifndef CPU_AARCH64_GC_Z_ZBARRIERSETASSEMBLER_AARCH64_HPP 25 #define CPU_AARCH64_GC_Z_ZBARRIERSETASSEMBLER_AARCH64_HPP 26 27 #ifdef COMPILER1 28 class LIR_Assembler; 29 class LIR_OprDesc; 30 typedef LIR_OprDesc* LIR_Opr; 31 class StubAssembler; 32 class ZLoadBarrierStubC1; 33 #endif // COMPILER1 34 35 class ZBarrierSetAssembler : public ZBarrierSetAssemblerBase { 36 private: 37 address _load_barrier_slow_stub[RegisterImpl::number_of_registers]; 38 address _load_barrier_weak_slow_stub[RegisterImpl::number_of_registers]; 39 40 public: 41 ZBarrierSetAssembler(); 42 43 virtual void load_at(MacroAssembler* masm, 44 DecoratorSet decorators, 45 BasicType type, 46 Register dst, 47 Address src, 48 Register tmp1, 49 Register tmp_thread); 50 51 #ifdef ASSERT 52 virtual void store_at(MacroAssembler* masm, 53 DecoratorSet decorators, 54 BasicType type, 55 Address dst, 56 Register val, 57 Register tmp1, 58 Register tmp2, 59 Register tmp3); 60 #endif // ASSERT 61 62 virtual void arraycopy_prologue(MacroAssembler* masm, 63 DecoratorSet decorators, 64 bool is_oop, 65 Register src, 66 Register dst, 67 Register count, 68 RegSet saved_regs); 69 70 virtual void try_resolve_jobject_in_native(MacroAssembler* masm, 71 Register jni_env, 72 Register robj, 73 Register tmp, 74 Label& slowpath); 75 76 #ifdef COMPILER1 77 void generate_c1_load_barrier_test(LIR_Assembler* ce, 78 LIR_Opr ref) const; 79 80 void generate_c1_load_barrier_stub(LIR_Assembler* ce, 81 ZLoadBarrierStubC1* stub) const; 82 83 void generate_c1_load_barrier_runtime_stub(StubAssembler* sasm, 84 DecoratorSet decorators) const; 85 #endif // COMPILER1 86 87 virtual void barrier_stubs_init(); 88 89 address load_barrier_slow_stub(Register reg); 90 address load_barrier_weak_slow_stub(Register reg); 91 }; 92 93 #endif // CPU_AARCH64_GC_Z_ZBARRIERSETASSEMBLER_AARCH64_HPP