< prev index next >

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

Print this page




  43     ShenandoahStore,
  44     ShenandoahValue,
  45     ShenandoahOopStore,
  46     ShenandoahNone
  47   };
  48 
  49   static bool verify_helper(Node* in, Node_Stack& phis, VectorSet& visited, verify_type t, bool trace, Unique_Node_List& barriers_used);
  50   static void report_verify_failure(const char* msg, Node* n1 = NULL, Node* n2 = NULL);
  51   static void verify_raw_mem(RootNode* root);
  52 #endif
  53   static Node* dom_mem(Node* mem, Node* ctrl, int alias, Node*& mem_ctrl, PhaseIdealLoop* phase);
  54   static Node* no_branches(Node* c, Node* dom, bool allow_one_proj, PhaseIdealLoop* phase);
  55   static bool is_heap_state_test(Node* iff, int mask);
  56   static bool try_common_gc_state_load(Node *n, PhaseIdealLoop *phase);
  57   static bool has_safepoint_between(Node* start, Node* stop, PhaseIdealLoop *phase);
  58   static Node* find_bottom_mem(Node* ctrl, PhaseIdealLoop* phase);
  59   static void follow_barrier_uses(Node* n, Node* ctrl, Unique_Node_List& uses, PhaseIdealLoop* phase);
  60   static void test_null(Node*& ctrl, Node* val, Node*& null_ctrl, PhaseIdealLoop* phase);
  61   static void test_heap_stable(Node*& ctrl, Node* raw_mem, Node*& heap_stable_ctrl,
  62                                PhaseIdealLoop* phase);
  63   static void call_lrb_stub(Node*& ctrl, Node*& val, Node*& result_mem, Node* raw_mem, PhaseIdealLoop* phase);
  64   static Node* clone_null_check(Node*& c, Node* val, Node* unc_ctrl, PhaseIdealLoop* phase);
  65   static void fix_null_check(Node* unc, Node* unc_ctrl, Node* new_unc_ctrl, Unique_Node_List& uses,
  66                              PhaseIdealLoop* phase);
  67   static void in_cset_fast_test(Node*& ctrl, Node*& not_cset_ctrl, Node* val, Node* raw_mem, PhaseIdealLoop* phase);
  68   static void move_heap_stable_test_out_of_loop(IfNode* iff, PhaseIdealLoop* phase);
  69   static void merge_back_to_back_tests(Node* n, PhaseIdealLoop* phase);
  70   static bool identical_backtoback_ifs(Node *n, PhaseIdealLoop* phase);
  71   static void fix_ctrl(Node* barrier, Node* region, const MemoryGraphFixer& fixer, Unique_Node_List& uses, Unique_Node_List& uses_to_ignore, uint last, PhaseIdealLoop* phase);
  72   static IfNode* find_unswitching_candidate(const IdealLoopTree *loop, PhaseIdealLoop* phase);
  73 
  74 public:
  75   static bool is_dominator(Node* d_c, Node* n_c, Node* d, Node* n, PhaseIdealLoop* phase);
  76   static bool is_dominator_same_ctrl(Node* c, Node* d, Node* n, PhaseIdealLoop* phase);
  77 
  78   static bool is_gc_state_load(Node* n);
  79   static bool is_heap_stable_test(Node* iff);
  80 
  81   static bool expand(Compile* C, PhaseIterGVN& igvn);
  82   static void pin_and_expand(PhaseIdealLoop* phase);
  83   static void optimize_after_expansion(VectorSet& visited, Node_Stack& nstack, Node_List& old_new, PhaseIdealLoop* phase);


 210 
 211 class ShenandoahCompareAndExchangeNNode : public CompareAndExchangeNNode {
 212 public:
 213   ShenandoahCompareAndExchangeNNode(Node *c, Node *mem, Node *adr, Node *val, Node *ex, const TypePtr* at, const Type* t, MemNode::MemOrd mem_ord)
 214     : CompareAndExchangeNNode(c, mem, adr, val, ex, at, t, mem_ord) { }
 215 
 216   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape) {
 217     if (in(ExpectedIn) != NULL && phase->type(in(ExpectedIn)) == TypeNarrowOop::NULL_PTR) {
 218       return new CompareAndExchangeNNode(in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address), in(MemNode::ValueIn), in(ExpectedIn), adr_type(), bottom_type(), order());
 219     }
 220     return NULL;
 221   }
 222 
 223   virtual int Opcode() const;
 224 };
 225 
 226 class ShenandoahLoadReferenceBarrierNode : public Node {
 227 public:
 228   enum {
 229     Control,
 230     ValueIn

 231   };
 232 
 233   enum Strength {
 234     NONE, WEAK, STRONG, NA
 235   };
 236 
 237   ShenandoahLoadReferenceBarrierNode(Node* ctrl, Node* val);
 238 
 239   virtual int Opcode() const;
 240   virtual const Type* bottom_type() const;
 241   virtual const Type* Value(PhaseGVN* phase) const;
 242   virtual const class TypePtr *adr_type() const { return TypeOopPtr::BOTTOM; }
 243   virtual uint match_edge(uint idx) const {
 244     return idx >= ValueIn;
 245   }
 246   virtual uint ideal_reg() const { return Op_RegP; }
 247 
 248   virtual Node* Identity(PhaseGVN* phase);
 249 
 250   uint size_of() const {
 251     return sizeof(*this);
 252   }
 253 
 254   Strength get_barrier_strength();
 255   CallStaticJavaNode* pin_and_expand_null_check(PhaseIterGVN& igvn);
 256 
 257 private:


  43     ShenandoahStore,
  44     ShenandoahValue,
  45     ShenandoahOopStore,
  46     ShenandoahNone
  47   };
  48 
  49   static bool verify_helper(Node* in, Node_Stack& phis, VectorSet& visited, verify_type t, bool trace, Unique_Node_List& barriers_used);
  50   static void report_verify_failure(const char* msg, Node* n1 = NULL, Node* n2 = NULL);
  51   static void verify_raw_mem(RootNode* root);
  52 #endif
  53   static Node* dom_mem(Node* mem, Node* ctrl, int alias, Node*& mem_ctrl, PhaseIdealLoop* phase);
  54   static Node* no_branches(Node* c, Node* dom, bool allow_one_proj, PhaseIdealLoop* phase);
  55   static bool is_heap_state_test(Node* iff, int mask);
  56   static bool try_common_gc_state_load(Node *n, PhaseIdealLoop *phase);
  57   static bool has_safepoint_between(Node* start, Node* stop, PhaseIdealLoop *phase);
  58   static Node* find_bottom_mem(Node* ctrl, PhaseIdealLoop* phase);
  59   static void follow_barrier_uses(Node* n, Node* ctrl, Unique_Node_List& uses, PhaseIdealLoop* phase);
  60   static void test_null(Node*& ctrl, Node* val, Node*& null_ctrl, PhaseIdealLoop* phase);
  61   static void test_heap_stable(Node*& ctrl, Node* raw_mem, Node*& heap_stable_ctrl,
  62                                PhaseIdealLoop* phase);
  63   static void call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, Node*& result_mem, Node* raw_mem, PhaseIdealLoop* phase);
  64   static Node* clone_null_check(Node*& c, Node* val, Node* unc_ctrl, PhaseIdealLoop* phase);
  65   static void fix_null_check(Node* unc, Node* unc_ctrl, Node* new_unc_ctrl, Unique_Node_List& uses,
  66                              PhaseIdealLoop* phase);
  67   static void in_cset_fast_test(Node*& ctrl, Node*& not_cset_ctrl, Node* val, Node* raw_mem, PhaseIdealLoop* phase);
  68   static void move_heap_stable_test_out_of_loop(IfNode* iff, PhaseIdealLoop* phase);
  69   static void merge_back_to_back_tests(Node* n, PhaseIdealLoop* phase);
  70   static bool identical_backtoback_ifs(Node *n, PhaseIdealLoop* phase);
  71   static void fix_ctrl(Node* barrier, Node* region, const MemoryGraphFixer& fixer, Unique_Node_List& uses, Unique_Node_List& uses_to_ignore, uint last, PhaseIdealLoop* phase);
  72   static IfNode* find_unswitching_candidate(const IdealLoopTree *loop, PhaseIdealLoop* phase);
  73 
  74 public:
  75   static bool is_dominator(Node* d_c, Node* n_c, Node* d, Node* n, PhaseIdealLoop* phase);
  76   static bool is_dominator_same_ctrl(Node* c, Node* d, Node* n, PhaseIdealLoop* phase);
  77 
  78   static bool is_gc_state_load(Node* n);
  79   static bool is_heap_stable_test(Node* iff);
  80 
  81   static bool expand(Compile* C, PhaseIterGVN& igvn);
  82   static void pin_and_expand(PhaseIdealLoop* phase);
  83   static void optimize_after_expansion(VectorSet& visited, Node_Stack& nstack, Node_List& old_new, PhaseIdealLoop* phase);


 210 
 211 class ShenandoahCompareAndExchangeNNode : public CompareAndExchangeNNode {
 212 public:
 213   ShenandoahCompareAndExchangeNNode(Node *c, Node *mem, Node *adr, Node *val, Node *ex, const TypePtr* at, const Type* t, MemNode::MemOrd mem_ord)
 214     : CompareAndExchangeNNode(c, mem, adr, val, ex, at, t, mem_ord) { }
 215 
 216   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape) {
 217     if (in(ExpectedIn) != NULL && phase->type(in(ExpectedIn)) == TypeNarrowOop::NULL_PTR) {
 218       return new CompareAndExchangeNNode(in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address), in(MemNode::ValueIn), in(ExpectedIn), adr_type(), bottom_type(), order());
 219     }
 220     return NULL;
 221   }
 222 
 223   virtual int Opcode() const;
 224 };
 225 
 226 class ShenandoahLoadReferenceBarrierNode : public Node {
 227 public:
 228   enum {
 229     Control,
 230     ValueIn,
 231     LoadAddr
 232   };
 233 
 234   enum Strength {
 235     NONE, WEAK, STRONG, NA
 236   };
 237 
 238   ShenandoahLoadReferenceBarrierNode(Node* ctrl, Node* val, Node* load_addr);
 239 
 240   virtual int Opcode() const;
 241   virtual const Type* bottom_type() const;
 242   virtual const Type* Value(PhaseGVN* phase) const;
 243   virtual const class TypePtr *adr_type() const { return TypeOopPtr::BOTTOM; }
 244   virtual uint match_edge(uint idx) const {
 245     return idx >= ValueIn;
 246   }
 247   virtual uint ideal_reg() const { return Op_RegP; }
 248 
 249   virtual Node* Identity(PhaseGVN* phase);
 250 
 251   uint size_of() const {
 252     return sizeof(*this);
 253   }
 254 
 255   Strength get_barrier_strength();
 256   CallStaticJavaNode* pin_and_expand_null_check(PhaseIterGVN& igvn);
 257 
 258 private:
< prev index next >