Path: blob/master/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp
66646 views
/*1* Copyright (c) 2018, 2021, Red Hat, Inc. All rights reserved.2* Copyright (c) 2012, 2021 SAP SE. 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_PPC_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_PPC_HPP26#define CPU_PPC_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_PPC_HPP2728#include "asm/macroAssembler.hpp"29#include "gc/shared/barrierSetAssembler.hpp"30#include "gc/shenandoah/shenandoahBarrierSet.hpp"3132#ifdef COMPILER13334class LIR_Assembler;35class ShenandoahPreBarrierStub;36class ShenandoahLoadReferenceBarrierStub;37class StubAssembler;3839#endif4041class StubCodeGenerator;4243class ShenandoahBarrierSetAssembler: public BarrierSetAssembler {44private:4546/* ==== Actual barrier implementations ==== */47void satb_write_barrier_impl(MacroAssembler* masm, DecoratorSet decorators,48Register base, RegisterOrConstant ind_or_offs,49Register pre_val,50Register tmp1, Register tmp2,51MacroAssembler::PreservationLevel preservation_level);5253void load_reference_barrier_impl(MacroAssembler* masm, DecoratorSet decorators,54Register base, RegisterOrConstant ind_or_offs,55Register dst,56Register tmp1, Register tmp2,57MacroAssembler::PreservationLevel preservation_level);5859/* ==== Helper methods for barrier implementations ==== */60void resolve_forward_pointer_not_null(MacroAssembler* masm, Register dst, Register tmp);6162public:6364/* ==== C1 stubs ==== */65#ifdef COMPILER16667void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);6869void gen_load_reference_barrier_stub(LIR_Assembler* ce, ShenandoahLoadReferenceBarrierStub* stub);7071void generate_c1_pre_barrier_runtime_stub(StubAssembler* sasm);7273void generate_c1_load_reference_barrier_runtime_stub(StubAssembler* sasm, DecoratorSet decorators);7475#endif7677/* ==== Available barriers (facades of the actual implementations) ==== */78void satb_write_barrier(MacroAssembler* masm,79Register base, RegisterOrConstant ind_or_offs,80Register tmp1, Register tmp2, Register tmp3,81MacroAssembler::PreservationLevel preservation_level);8283void iu_barrier(MacroAssembler* masm,84Register val,85Register tmp1, Register tmp2,86MacroAssembler::PreservationLevel preservation_level, DecoratorSet decorators = 0);8788void load_reference_barrier(MacroAssembler* masm, DecoratorSet decorators,89Register base, RegisterOrConstant ind_or_offs,90Register dst,91Register tmp1, Register tmp2,92MacroAssembler::PreservationLevel preservation_level);9394/* ==== Helper methods used by C1 and C2 ==== */95void cmpxchg_oop(MacroAssembler* masm, Register base_addr, Register expected, Register new_val,96Register tmp1, Register tmp2,97bool is_cae, Register result);9899/* ==== Access api ==== */100virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,101Register src, Register dst, Register count, Register preserve1, Register preserve2);102103virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,104Register base, RegisterOrConstant ind_or_offs, Register val,105Register tmp1, Register tmp2, Register tmp3,106MacroAssembler::PreservationLevel preservation_level);107108virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,109Register base, RegisterOrConstant ind_or_offs, Register dst,110Register tmp1, Register tmp2,111MacroAssembler::PreservationLevel preservation_level, Label* L_handle_null = NULL);112113virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register dst, Register jni_env,114Register obj, Register tmp, Label& slowpath);115};116117#endif // CPU_PPC_GC_SHENANDOAH_SHENANDOAHBARRIERSETASSEMBLER_PPC_HPP118119120