src/hotspot/share/opto/memnode.hpp
changeset 51482 d7029542d67a
parent 51333 f6641fcf7b7e
child 53244 9807daeb47c4
child 56900 d5d542d50e3c
equal deleted inserted replaced
51481:dae00d6705ec 51482:d7029542d67a
   605   // Map a store opcode to its corresponding own opcode, trivially.
   605   // Map a store opcode to its corresponding own opcode, trivially.
   606   virtual int store_Opcode() const { return Opcode(); }
   606   virtual int store_Opcode() const { return Opcode(); }
   607 
   607 
   608   // have all possible loads of the value stored been optimized away?
   608   // have all possible loads of the value stored been optimized away?
   609   bool value_never_loaded(PhaseTransform *phase) const;
   609   bool value_never_loaded(PhaseTransform *phase) const;
       
   610 
       
   611   MemBarNode* trailing_membar() const;
   610 };
   612 };
   611 
   613 
   612 //------------------------------StoreBNode-------------------------------------
   614 //------------------------------StoreBNode-------------------------------------
   613 // Store byte to memory
   615 // Store byte to memory
   614 class StoreBNode : public StoreNode {
   616 class StoreBNode : public StoreNode {
   814   virtual const Type *bottom_type() const { return _type; }
   816   virtual const Type *bottom_type() const { return _type; }
   815   virtual uint ideal_reg() const;
   817   virtual uint ideal_reg() const;
   816   virtual const class TypePtr *adr_type() const { return _adr_type; }  // returns bottom_type of address
   818   virtual const class TypePtr *adr_type() const { return _adr_type; }  // returns bottom_type of address
   817 
   819 
   818   bool result_not_used() const;
   820   bool result_not_used() const;
       
   821   MemBarNode* trailing_membar() const;
   819 };
   822 };
   820 
   823 
   821 class LoadStoreConditionalNode : public LoadStoreNode {
   824 class LoadStoreConditionalNode : public LoadStoreNode {
   822 public:
   825 public:
   823   enum {
   826   enum {
  1140 
  1143 
  1141   virtual uint size_of() const { return sizeof(*this); }
  1144   virtual uint size_of() const { return sizeof(*this); }
  1142   // Memory type this node is serializing.  Usually either rawptr or bottom.
  1145   // Memory type this node is serializing.  Usually either rawptr or bottom.
  1143   const TypePtr* _adr_type;
  1146   const TypePtr* _adr_type;
  1144 
  1147 
       
  1148   // How is this membar related to a nearby memory access?
       
  1149   enum {
       
  1150     Standalone,
       
  1151     TrailingLoad,
       
  1152     TrailingStore,
       
  1153     LeadingStore,
       
  1154     TrailingLoadStore,
       
  1155     LeadingLoadStore
       
  1156   } _kind;
       
  1157 
       
  1158 #ifdef ASSERT
       
  1159   uint _pair_idx;
       
  1160 #endif
       
  1161 
  1145 public:
  1162 public:
  1146   enum {
  1163   enum {
  1147     Precedent = TypeFunc::Parms  // optional edge to force precedence
  1164     Precedent = TypeFunc::Parms  // optional edge to force precedence
  1148   };
  1165   };
  1149   MemBarNode(Compile* C, int alias_idx, Node* precedent);
  1166   MemBarNode(Compile* C, int alias_idx, Node* precedent);
  1157   // Factory method.  Builds a wide or narrow membar.
  1174   // Factory method.  Builds a wide or narrow membar.
  1158   // Optional 'precedent' becomes an extra edge if not null.
  1175   // Optional 'precedent' becomes an extra edge if not null.
  1159   static MemBarNode* make(Compile* C, int opcode,
  1176   static MemBarNode* make(Compile* C, int opcode,
  1160                           int alias_idx = Compile::AliasIdxBot,
  1177                           int alias_idx = Compile::AliasIdxBot,
  1161                           Node* precedent = NULL);
  1178                           Node* precedent = NULL);
       
  1179 
       
  1180   MemBarNode* trailing_membar() const;
       
  1181   MemBarNode* leading_membar() const;
       
  1182 
       
  1183   void set_trailing_load() { _kind = TrailingLoad; }
       
  1184   bool trailing_load() const { return _kind == TrailingLoad; }
       
  1185   bool trailing_store() const { return _kind == TrailingStore; }
       
  1186   bool leading_store() const { return _kind == LeadingStore; }
       
  1187   bool trailing_load_store() const { return _kind == TrailingLoadStore; }
       
  1188   bool leading_load_store() const { return _kind == LeadingLoadStore; }
       
  1189   bool trailing() const { return _kind == TrailingLoad || _kind == TrailingStore || _kind == TrailingLoadStore; }
       
  1190   bool leading() const { return _kind == LeadingStore || _kind == LeadingLoadStore; }
       
  1191   bool standalone() const { return _kind == Standalone; }
       
  1192 
       
  1193   static void set_store_pair(MemBarNode* leading, MemBarNode* trailing);
       
  1194   static void set_load_store_pair(MemBarNode* leading, MemBarNode* trailing);
       
  1195 
       
  1196   void remove(PhaseIterGVN *igvn);
  1162 };
  1197 };
  1163 
  1198 
  1164 // "Acquire" - no following ref can move before (but earlier refs can
  1199 // "Acquire" - no following ref can move before (but earlier refs can
  1165 // follow, like an early Load stalled in cache).  Requires multi-cpu
  1200 // follow, like an early Load stalled in cache).  Requires multi-cpu
  1166 // visibility.  Inserted after a volatile load.
  1201 // visibility.  Inserted after a volatile load.