Path: blob/master/src/hotspot/share/gc/z/c1/zBarrierSetC1.hpp
40975 views
/*1* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223#ifndef SHARE_GC_Z_C1_ZBARRIERSETC1_HPP24#define SHARE_GC_Z_C1_ZBARRIERSETC1_HPP2526#include "c1/c1_CodeStubs.hpp"27#include "c1/c1_IR.hpp"28#include "c1/c1_LIR.hpp"29#include "gc/shared/c1/barrierSetC1.hpp"30#include "oops/accessDecorators.hpp"3132class ZLoadBarrierStubC1 : public CodeStub {33private:34DecoratorSet _decorators;35LIR_Opr _ref_addr;36LIR_Opr _ref;37LIR_Opr _tmp;38address _runtime_stub;3940public:41ZLoadBarrierStubC1(LIRAccess& access, LIR_Opr ref, address runtime_stub);4243DecoratorSet decorators() const;44LIR_Opr ref() const;45LIR_Opr ref_addr() const;46LIR_Opr tmp() const;47address runtime_stub() const;4849virtual void emit_code(LIR_Assembler* ce);50virtual void visit(LIR_OpVisitState* visitor);5152#ifndef PRODUCT53virtual void print_name(outputStream* out) const;54#endif // PRODUCT55};5657class ZBarrierSetC1 : public BarrierSetC1 {58private:59address _load_barrier_on_oop_field_preloaded_runtime_stub;60address _load_barrier_on_weak_oop_field_preloaded_runtime_stub;6162address load_barrier_on_oop_field_preloaded_runtime_stub(DecoratorSet decorators) const;63void load_barrier(LIRAccess& access, LIR_Opr result) const;6465protected:66virtual LIR_Opr resolve_address(LIRAccess& access, bool resolve_in_register);67virtual void load_at_resolved(LIRAccess& access, LIR_Opr result);68virtual LIR_Opr atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value);69virtual LIR_Opr atomic_cmpxchg_at_resolved(LIRAccess& access, LIRItem& cmp_value, LIRItem& new_value);7071public:72ZBarrierSetC1();7374virtual void generate_c1_runtime_stubs(BufferBlob* blob);75};7677#endif // SHARE_GC_Z_C1_ZBARRIERSETC1_HPP787980