Path: blob/master/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp
40975 views
/*1* Copyright (c) 2018, 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*22*/2324#ifndef SHARE_GC_G1_C2_G1BARRIERSETC2_HPP25#define SHARE_GC_G1_C2_G1BARRIERSETC2_HPP2627#include "gc/shared/c2/cardTableBarrierSetC2.hpp"2829class PhaseTransform;30class Type;31class TypeFunc;3233class G1BarrierSetC2: public CardTableBarrierSetC2 {34protected:35virtual void pre_barrier(GraphKit* kit,36bool do_load,37Node* ctl,38Node* obj,39Node* adr,40uint adr_idx,41Node* val,42const TypeOopPtr* val_type,43Node* pre_val,44BasicType bt) const;4546virtual void post_barrier(GraphKit* kit,47Node* ctl,48Node* store,49Node* obj,50Node* adr,51uint adr_idx,52Node* val,53BasicType bt,54bool use_precise) const;5556bool g1_can_remove_pre_barrier(GraphKit* kit,57PhaseTransform* phase,58Node* adr,59BasicType bt,60uint adr_idx) const;6162bool g1_can_remove_post_barrier(GraphKit* kit,63PhaseTransform* phase, Node* store,64Node* adr) const;6566void g1_mark_card(GraphKit* kit,67IdealKit& ideal,68Node* card_adr,69Node* oop_store,70uint oop_alias_idx,71Node* index,72Node* index_adr,73Node* buffer,74const TypeFunc* tf) const;7576// Helper for unsafe accesses, that may or may not be on the referent field.77// Generates the guards that check whether the result of78// Unsafe.getReference should be recorded in an SATB log buffer.79void insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset, Node* pre_val, bool need_mem_bar) const;8081static const TypeFunc* write_ref_field_pre_entry_Type();82static const TypeFunc* write_ref_field_post_entry_Type();8384virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const;8586public:87virtual bool is_gc_barrier_node(Node* node) const;88virtual void eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const;89virtual Node* step_over_gc_barrier(Node* c) const;9091#ifdef ASSERT92virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const;93#endif9495virtual bool escape_add_to_con_graph(ConnectionGraph* conn_graph, PhaseGVN* gvn, Unique_Node_List* delayed_worklist, Node* n, uint opcode) const;96};9798#endif // SHARE_GC_G1_C2_G1BARRIERSETC2_HPP99100101