src/share/vm/opto/memnode.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/memnode.hpp

Print this page
rev 8016 : 8069191: moving predicate out of loops may cause array accesses to bypass null check
Summary: Remove CastPP nodes only during final graph reshape
Reviewed-by:


  67     debug_only(_adr_type=at; adr_type();)
  68   }
  69   MemNode( Node *c0, Node *c1, Node *c2, const TypePtr* at, Node *c3, Node *c4)
  70     : Node(c0,c1,c2,c3,c4) {
  71     init_class_id(Class_Mem);
  72     debug_only(_adr_type=at; adr_type();)
  73   }
  74 
  75 public:
  76   // Helpers for the optimizer.  Documented in memnode.cpp.
  77   static bool detect_ptr_independence(Node* p1, AllocateNode* a1,
  78                                       Node* p2, AllocateNode* a2,
  79                                       PhaseTransform* phase);
  80   static bool adr_phi_is_loop_invariant(Node* adr_phi, Node* cast);
  81 
  82   static Node *optimize_simple_memory_chain(Node *mchain, const TypeOopPtr *t_oop, Node *load, PhaseGVN *phase);
  83   static Node *optimize_memory_chain(Node *mchain, const TypePtr *t_adr, Node *load, PhaseGVN *phase);
  84   // This one should probably be a phase-specific function:
  85   static bool all_controls_dominate(Node* dom, Node* sub);
  86 
  87   // Find any cast-away of null-ness and keep its control.
  88   static  Node *Ideal_common_DU_postCCP( PhaseCCP *ccp, Node* n, Node* adr );
  89   virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
  90 
  91   virtual const class TypePtr *adr_type() const;  // returns bottom_type of address
  92 
  93   // Shared code for Ideal methods:
  94   Node *Ideal_common(PhaseGVN *phase, bool can_reshape);  // Return -1 for short-circuit NULL.
  95 
  96   // Helper function for adr_type() implementations.
  97   static const TypePtr* calculate_adr_type(const Type* t, const TypePtr* cross_check = NULL);
  98 
  99   // Raw access function, to allow copying of adr_type efficiently in
 100   // product builds and retain the debug info for debug builds.
 101   const TypePtr *raw_adr_type() const {
 102 #ifdef ASSERT
 103     return _adr_type;
 104 #else
 105     return 0;
 106 #endif
 107   }
 108 
 109   // Map a load or store opcode to its corresponding store opcode.
 110   // (Return -1 if unknown.)




  67     debug_only(_adr_type=at; adr_type();)
  68   }
  69   MemNode( Node *c0, Node *c1, Node *c2, const TypePtr* at, Node *c3, Node *c4)
  70     : Node(c0,c1,c2,c3,c4) {
  71     init_class_id(Class_Mem);
  72     debug_only(_adr_type=at; adr_type();)
  73   }
  74 
  75 public:
  76   // Helpers for the optimizer.  Documented in memnode.cpp.
  77   static bool detect_ptr_independence(Node* p1, AllocateNode* a1,
  78                                       Node* p2, AllocateNode* a2,
  79                                       PhaseTransform* phase);
  80   static bool adr_phi_is_loop_invariant(Node* adr_phi, Node* cast);
  81 
  82   static Node *optimize_simple_memory_chain(Node *mchain, const TypeOopPtr *t_oop, Node *load, PhaseGVN *phase);
  83   static Node *optimize_memory_chain(Node *mchain, const TypePtr *t_adr, Node *load, PhaseGVN *phase);
  84   // This one should probably be a phase-specific function:
  85   static bool all_controls_dominate(Node* dom, Node* sub);
  86 




  87   virtual const class TypePtr *adr_type() const;  // returns bottom_type of address
  88 
  89   // Shared code for Ideal methods:
  90   Node *Ideal_common(PhaseGVN *phase, bool can_reshape);  // Return -1 for short-circuit NULL.
  91 
  92   // Helper function for adr_type() implementations.
  93   static const TypePtr* calculate_adr_type(const Type* t, const TypePtr* cross_check = NULL);
  94 
  95   // Raw access function, to allow copying of adr_type efficiently in
  96   // product builds and retain the debug info for debug builds.
  97   const TypePtr *raw_adr_type() const {
  98 #ifdef ASSERT
  99     return _adr_type;
 100 #else
 101     return 0;
 102 #endif
 103   }
 104 
 105   // Map a load or store opcode to its corresponding store opcode.
 106   // (Return -1 if unknown.)


src/share/vm/opto/memnode.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File