< prev index next >

src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.hpp

Print this page

 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 
 25 #ifndef SHARE_GC_SHENANDOAH_C2_SHENANDOAHBARRIERSETC2_HPP
 26 #define SHARE_GC_SHENANDOAH_C2_SHENANDOAHBARRIERSETC2_HPP
 27 
 28 #include "gc/shared/c2/barrierSetC2.hpp"
 29 #include "gc/shenandoah/c2/shenandoahSupport.hpp"
 30 #include "utilities/growableArray.hpp"
 31 
 32 class ShenandoahBarrierSetC2State : public ArenaObj {
 33 private:
 34   GrowableArray<ShenandoahIUBarrierNode*>* _iu_barriers;
 35   GrowableArray<ShenandoahLoadReferenceBarrierNode*>* _load_reference_barriers;
 36 
 37 public:
 38   ShenandoahBarrierSetC2State(Arena* comp_arena);
 39 
 40   int iu_barriers_count() const;
 41   ShenandoahIUBarrierNode* iu_barrier(int idx) const;
 42   void add_iu_barrier(ShenandoahIUBarrierNode* n);
 43   void remove_iu_barrier(ShenandoahIUBarrierNode * n);
 44 
 45   int load_reference_barriers_count() const;
 46   ShenandoahLoadReferenceBarrierNode* load_reference_barrier(int idx) const;
 47   void add_load_reference_barrier(ShenandoahLoadReferenceBarrierNode* n);
 48   void remove_load_reference_barrier(ShenandoahLoadReferenceBarrierNode * n);
 49 };
 50 
 51 class ShenandoahBarrierSetC2 : public BarrierSetC2 {
 52 private:
 53   void shenandoah_eliminate_wb_pre(Node* call, PhaseIterGVN* igvn) const;
 54 
 55   bool satb_can_remove_pre_barrier(GraphKit* kit, PhaseValues* phase, Node* adr,
 56                                    BasicType bt, uint adr_idx) const;
 57   void satb_write_barrier_pre(GraphKit* kit, bool do_load,
 58                               Node* obj,
 59                               Node* adr,
 60                               uint alias_idx,
 61                               Node* val,
 62                               const TypeOopPtr* val_type,
 63                               Node* pre_val,
 64                               BasicType bt) const;
 65 
 66   void shenandoah_write_barrier_pre(GraphKit* kit,
 67                                     bool do_load,
 68                                     Node* obj,
 69                                     Node* adr,
 70                                     uint alias_idx,
 71                                     Node* val,
 72                                     const TypeOopPtr* val_type,
 73                                     Node* pre_val,
 74                                     BasicType bt) const;
 75 
 76   Node* shenandoah_iu_barrier(GraphKit* kit, Node* obj) const;










 77 
 78   void insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset,
 79                           Node* pre_val, bool need_mem_bar) const;
 80 
 81   static bool clone_needs_barrier(Node* src, PhaseGVN& gvn);
 82 
 83 protected:
 84   virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const;
 85   virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const;
 86   virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
 87                                                Node* new_val, const Type* val_type) const;
 88   virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
 89                                                 Node* new_val, const Type* value_type) const;
 90   virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* val_type) const;
 91 
 92 public:
 93   static ShenandoahBarrierSetC2* bsc2();
 94 
 95   static bool is_shenandoah_wb_pre_call(Node* call);

 96   static bool is_shenandoah_lrb_call(Node* call);
 97   static bool is_shenandoah_marking_if(PhaseValues* phase, Node* n);
 98   static bool is_shenandoah_state_load(Node* n);
 99   static bool has_only_shenandoah_wb_pre_uses(Node* n);
100 
101   ShenandoahBarrierSetC2State* state() const;
102 
103   static const TypeFunc* write_ref_field_pre_entry_Type();
104   static const TypeFunc* shenandoah_clone_barrier_Type();
105   static const TypeFunc* shenandoah_load_reference_barrier_Type();
106   virtual bool has_load_barrier_nodes() const { return true; }
107 
108   // This is the entry-point for the backend to perform accesses through the Access API.
109   virtual void clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* ac) const;
110 
111   // These are general helper methods used by C2
112   virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, bool is_clone_instance, ArrayCopyPhase phase) const;
113 
114   // Support for GC barriers emitted during parsing
115   virtual bool is_gc_pre_barrier_node(Node* node) const;

 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 
 25 #ifndef SHARE_GC_SHENANDOAH_C2_SHENANDOAHBARRIERSETC2_HPP
 26 #define SHARE_GC_SHENANDOAH_C2_SHENANDOAHBARRIERSETC2_HPP
 27 
 28 #include "gc/shared/c2/barrierSetC2.hpp"
 29 #include "gc/shenandoah/c2/shenandoahSupport.hpp"
 30 #include "utilities/growableArray.hpp"
 31 
 32 class ShenandoahBarrierSetC2State : public ArenaObj {
 33 private:

 34   GrowableArray<ShenandoahLoadReferenceBarrierNode*>* _load_reference_barriers;
 35 
 36 public:
 37   ShenandoahBarrierSetC2State(Arena* comp_arena);
 38 





 39   int load_reference_barriers_count() const;
 40   ShenandoahLoadReferenceBarrierNode* load_reference_barrier(int idx) const;
 41   void add_load_reference_barrier(ShenandoahLoadReferenceBarrierNode* n);
 42   void remove_load_reference_barrier(ShenandoahLoadReferenceBarrierNode * n);
 43 };
 44 
 45 class ShenandoahBarrierSetC2 : public BarrierSetC2 {
 46 private:
 47   void shenandoah_eliminate_wb_pre(Node* call, PhaseIterGVN* igvn) const;
 48 
 49   bool satb_can_remove_pre_barrier(GraphKit* kit, PhaseValues* phase, Node* adr,
 50                                    BasicType bt, uint adr_idx) const;
 51   void satb_write_barrier_pre(GraphKit* kit, bool do_load,
 52                               Node* obj,
 53                               Node* adr,
 54                               uint alias_idx,
 55                               Node* val,
 56                               const TypeOopPtr* val_type,
 57                               Node* pre_val,
 58                               BasicType bt) const;
 59 
 60   void shenandoah_write_barrier_pre(GraphKit* kit,
 61                                     bool do_load,
 62                                     Node* obj,
 63                                     Node* adr,
 64                                     uint alias_idx,
 65                                     Node* val,
 66                                     const TypeOopPtr* val_type,
 67                                     Node* pre_val,
 68                                     BasicType bt) const;
 69 
 70   Node* byte_map_base_node(GraphKit* kit) const;
 71 
 72   void post_barrier(GraphKit* kit,
 73                     Node* ctl,
 74                     Node* store,
 75                     Node* obj,
 76                     Node* adr,
 77                     uint adr_idx,
 78                     Node* val,
 79                     BasicType bt,
 80                     bool use_precise) const;
 81 
 82   void insert_pre_barrier(GraphKit* kit, Node* base_oop, Node* offset,
 83                           Node* pre_val, bool need_mem_bar) const;
 84 
 85   static bool clone_needs_barrier(Node* src, PhaseGVN& gvn);
 86 
 87 protected:
 88   virtual Node* load_at_resolved(C2Access& access, const Type* val_type) const;
 89   virtual Node* store_at_resolved(C2Access& access, C2AccessValue& val) const;
 90   virtual Node* atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
 91                                                Node* new_val, const Type* val_type) const;
 92   virtual Node* atomic_cmpxchg_bool_at_resolved(C2AtomicParseAccess& access, Node* expected_val,
 93                                                 Node* new_val, const Type* value_type) const;
 94   virtual Node* atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* new_val, const Type* val_type) const;
 95 
 96 public:
 97   static ShenandoahBarrierSetC2* bsc2();
 98 
 99   static bool is_shenandoah_wb_pre_call(Node* call);
100   static bool is_shenandoah_clone_call(Node* call);
101   static bool is_shenandoah_lrb_call(Node* call);
102   static bool is_shenandoah_marking_if(PhaseValues* phase, Node* n);
103   static bool is_shenandoah_state_load(Node* n);
104   static bool has_only_shenandoah_wb_pre_uses(Node* n);
105 
106   ShenandoahBarrierSetC2State* state() const;
107 
108   static const TypeFunc* write_ref_field_pre_entry_Type();
109   static const TypeFunc* shenandoah_clone_barrier_Type();
110   static const TypeFunc* shenandoah_load_reference_barrier_Type();
111   virtual bool has_load_barrier_nodes() const { return true; }
112 
113   // This is the entry-point for the backend to perform accesses through the Access API.
114   virtual void clone_at_expansion(PhaseMacroExpand* phase, ArrayCopyNode* ac) const;
115 
116   // These are general helper methods used by C2
117   virtual bool array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, bool is_clone_instance, ArrayCopyPhase phase) const;
118 
119   // Support for GC barriers emitted during parsing
120   virtual bool is_gc_pre_barrier_node(Node* node) const;
< prev index next >