Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/shenandoah/c1/shenandoahBarrierSetC1.hpp
38922 views
/*1* Copyright (c) 2018, Red Hat, Inc. All rights reserved.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation.6*7* This code is distributed in the hope that it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License10* version 2 for more details (a copy is included in the LICENSE file that11* accompanied this code).12*13* You should have received a copy of the GNU General Public License version14* 2 along with this work; if not, write to the Free Software Foundation,15* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.16*17* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA18* or visit www.oracle.com if you need additional information or have any19* questions.20*21*/2223#ifndef SHARE_GC_SHENANDOAH_C1_SHENANDOAHBARRIERSETC1_HPP24#define SHARE_GC_SHENANDOAH_C1_SHENANDOAHBARRIERSETC1_HPP2526#include "c1/c1_CodeStubs.hpp"27#include "memory/allocation.hpp"2829class LIRGenerator;30class LIRItem;3132class ShenandoahLoadReferenceBarrierStub: public CodeStub {33friend class ShenandoahBarrierSetC1;34private:35LIR_Opr _obj;36LIR_Opr _addr;37LIR_Opr _result;38LIR_Opr _tmp1;39LIR_Opr _tmp2;4041public:42ShenandoahLoadReferenceBarrierStub(LIR_Opr obj, LIR_Opr addr, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2) :43_obj(obj), _addr(addr), _result(result), _tmp1(tmp1), _tmp2(tmp2)44{45assert(_obj->is_register(), "should be register");46assert(_addr->is_register(), "should be register");47assert(_result->is_register(), "should be register");48assert(_tmp1->is_register(), "should be register");49assert(_tmp2->is_register(), "should be register");50}5152LIR_Opr obj() const { return _obj; }53LIR_Opr addr() const { return _addr; }54LIR_Opr result() const { return _result; }55LIR_Opr tmp1() const { return _tmp1; }56LIR_Opr tmp2() const { return _tmp2; }5758virtual void emit_code(LIR_Assembler* e);59virtual void visit(LIR_OpVisitState* visitor) {60visitor->do_slow_case();61visitor->do_input(_obj);62visitor->do_temp(_obj);63visitor->do_input(_addr);64visitor->do_temp(_addr);65visitor->do_temp(_result);66visitor->do_temp(_tmp1);67visitor->do_temp(_tmp2);68}69#ifndef PRODUCT70virtual void print_name(outputStream* out) const { out->print("ShenandoahLoadReferenceBarrierStub"); }71#endif // PRODUCT72};7374class ShenandoahBarrierSetC1 : public CHeapObj<mtGC>{75private:76CodeBlob* _pre_barrier_c1_runtime_code_blob;77public:78static ShenandoahBarrierSetC1* bsc1();7980LIR_Opr load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr);81LIR_Opr storeval_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, bool patch);8283LIR_Opr resolve_address(LIRGenerator* gen, LIR_Address* addr, BasicType type, CodeEmitInfo* patch_emit_info);8485private:86LIR_Opr load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr);87LIR_Opr ensure_in_register(LIRGenerator* gen, LIR_Opr obj, BasicType type);88};8990#endif // SHARE_GC_SHENANDOAH_C1_SHENANDOAHBARRIERSETC1_HPP919293