< prev index next >

src/hotspot/share/opto/memnode.cpp

Print this page




  32 #include "oops/objArrayKlass.hpp"
  33 #include "opto/addnode.hpp"
  34 #include "opto/arraycopynode.hpp"
  35 #include "opto/cfgnode.hpp"
  36 #include "opto/compile.hpp"
  37 #include "opto/connode.hpp"
  38 #include "opto/convertnode.hpp"
  39 #include "opto/loopnode.hpp"
  40 #include "opto/machnode.hpp"
  41 #include "opto/matcher.hpp"
  42 #include "opto/memnode.hpp"
  43 #include "opto/mulnode.hpp"
  44 #include "opto/narrowptrnode.hpp"
  45 #include "opto/phaseX.hpp"
  46 #include "opto/regmask.hpp"
  47 #include "opto/rootnode.hpp"
  48 #include "utilities/align.hpp"
  49 #include "utilities/copy.hpp"
  50 #include "utilities/macros.hpp"
  51 #include "utilities/vmError.hpp"
  52 #if INCLUDE_ZGC
  53 #include "gc/z/c2/zBarrierSetC2.hpp"
  54 #endif
  55 
  56 // Portions of code courtesy of Clifford Click
  57 
  58 // Optimization - Graph Style
  59 
  60 static Node *step_through_mergemem(PhaseGVN *phase, MergeMemNode *mmem,  const TypePtr *tp, const TypePtr *adr_check, outputStream *st);
  61 
  62 //=============================================================================
  63 uint MemNode::size_of() const { return sizeof(*this); }
  64 
  65 const TypePtr *MemNode::adr_type() const {
  66   Node* adr = in(Address);
  67   if (adr == NULL)  return NULL; // node is dead
  68   const TypePtr* cross_check = NULL;
  69   DEBUG_ONLY(cross_check = _adr_type);
  70   return calculate_adr_type(adr->bottom_type(), cross_check);
  71 }
  72 
  73 bool MemNode::check_if_adr_maybe_raw(Node* adr) {
  74   if (adr != NULL) {


2834   t = phase->type( in(MemNode::OopStore) );
2835   if( t == Type::TOP ) return Type::TOP;
2836 
2837   return StoreNode::Value( phase );
2838 }
2839 
2840 
2841 //=============================================================================
2842 //----------------------------------SCMemProjNode------------------------------
2843 const Type* SCMemProjNode::Value(PhaseGVN* phase) const
2844 {
2845   return bottom_type();
2846 }
2847 
2848 //=============================================================================
2849 //----------------------------------LoadStoreNode------------------------------
2850 LoadStoreNode::LoadStoreNode( Node *c, Node *mem, Node *adr, Node *val, const TypePtr* at, const Type* rt, uint required )
2851   : Node(required),
2852     _type(rt),
2853     _adr_type(at),
2854     _has_barrier(false)
2855 {
2856   init_req(MemNode::Control, c  );
2857   init_req(MemNode::Memory , mem);
2858   init_req(MemNode::Address, adr);
2859   init_req(MemNode::ValueIn, val);
2860   init_class_id(Class_LoadStore);
2861 }
2862 
2863 uint LoadStoreNode::ideal_reg() const {
2864   return _type->ideal_reg();
2865 }
2866 
2867 bool LoadStoreNode::result_not_used() const {
2868   for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
2869     Node *x = fast_out(i);
2870     if (x->Opcode() == Op_SCMemProj) continue;
2871     return false;
2872   }
2873   return true;
2874 }




  32 #include "oops/objArrayKlass.hpp"
  33 #include "opto/addnode.hpp"
  34 #include "opto/arraycopynode.hpp"
  35 #include "opto/cfgnode.hpp"
  36 #include "opto/compile.hpp"
  37 #include "opto/connode.hpp"
  38 #include "opto/convertnode.hpp"
  39 #include "opto/loopnode.hpp"
  40 #include "opto/machnode.hpp"
  41 #include "opto/matcher.hpp"
  42 #include "opto/memnode.hpp"
  43 #include "opto/mulnode.hpp"
  44 #include "opto/narrowptrnode.hpp"
  45 #include "opto/phaseX.hpp"
  46 #include "opto/regmask.hpp"
  47 #include "opto/rootnode.hpp"
  48 #include "utilities/align.hpp"
  49 #include "utilities/copy.hpp"
  50 #include "utilities/macros.hpp"
  51 #include "utilities/vmError.hpp"



  52 
  53 // Portions of code courtesy of Clifford Click
  54 
  55 // Optimization - Graph Style
  56 
  57 static Node *step_through_mergemem(PhaseGVN *phase, MergeMemNode *mmem,  const TypePtr *tp, const TypePtr *adr_check, outputStream *st);
  58 
  59 //=============================================================================
  60 uint MemNode::size_of() const { return sizeof(*this); }
  61 
  62 const TypePtr *MemNode::adr_type() const {
  63   Node* adr = in(Address);
  64   if (adr == NULL)  return NULL; // node is dead
  65   const TypePtr* cross_check = NULL;
  66   DEBUG_ONLY(cross_check = _adr_type);
  67   return calculate_adr_type(adr->bottom_type(), cross_check);
  68 }
  69 
  70 bool MemNode::check_if_adr_maybe_raw(Node* adr) {
  71   if (adr != NULL) {


2831   t = phase->type( in(MemNode::OopStore) );
2832   if( t == Type::TOP ) return Type::TOP;
2833 
2834   return StoreNode::Value( phase );
2835 }
2836 
2837 
2838 //=============================================================================
2839 //----------------------------------SCMemProjNode------------------------------
2840 const Type* SCMemProjNode::Value(PhaseGVN* phase) const
2841 {
2842   return bottom_type();
2843 }
2844 
2845 //=============================================================================
2846 //----------------------------------LoadStoreNode------------------------------
2847 LoadStoreNode::LoadStoreNode( Node *c, Node *mem, Node *adr, Node *val, const TypePtr* at, const Type* rt, uint required )
2848   : Node(required),
2849     _type(rt),
2850     _adr_type(at),
2851     _barrier(0)
2852 {
2853   init_req(MemNode::Control, c  );
2854   init_req(MemNode::Memory , mem);
2855   init_req(MemNode::Address, adr);
2856   init_req(MemNode::ValueIn, val);
2857   init_class_id(Class_LoadStore);
2858 }
2859 
2860 uint LoadStoreNode::ideal_reg() const {
2861   return _type->ideal_reg();
2862 }
2863 
2864 bool LoadStoreNode::result_not_used() const {
2865   for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) {
2866     Node *x = fast_out(i);
2867     if (x->Opcode() == Op_SCMemProj) continue;
2868     return false;
2869   }
2870   return true;
2871 }


< prev index next >