src/hotspot/share/opto/memnode.hpp
changeset 57582 a79a819a8218
parent 55307 ed12027517c0
child 57804 9b7b9f16dfd9
equal deleted inserted replaced
57581:57a391a23f7f 57582:a79a819a8218
   152 class LoadNode : public MemNode {
   152 class LoadNode : public MemNode {
   153 public:
   153 public:
   154   // Some loads (from unsafe) should be pinned: they don't depend only
   154   // Some loads (from unsafe) should be pinned: they don't depend only
   155   // on the dominating test.  The field _control_dependency below records
   155   // on the dominating test.  The field _control_dependency below records
   156   // whether that node depends only on the dominating test.
   156   // whether that node depends only on the dominating test.
   157   // Methods used to build LoadNodes pass an argument of type enum
   157   // Pinned and UnknownControl are similar, but differ in that Pinned
   158   // ControlDependency instead of a boolean because those methods
   158   // loads are not allowed to float across safepoints, whereas UnknownControl
   159   // typically have multiple boolean parameters with default values:
   159   // loads are allowed to do that. Therefore, Pinned is stricter.
   160   // passing the wrong boolean to one of these parameters by mistake
       
   161   // goes easily unnoticed. Using an enum, the compiler can check that
       
   162   // the type of a value and the type of the parameter match.
       
   163   enum ControlDependency {
   160   enum ControlDependency {
   164     Pinned,
   161     Pinned,
       
   162     UnknownControl,
   165     DependsOnlyOnTest
   163     DependsOnlyOnTest
   166   };
   164   };
   167 
   165 
   168 private:
   166 private:
   169   // LoadNode::hash() doesn't take the _control_dependency field
   167   // LoadNode::hash() doesn't take the _control_dependency field
   266   Node* convert_to_signed_load(PhaseGVN& gvn);
   264   Node* convert_to_signed_load(PhaseGVN& gvn);
   267 
   265 
   268   void copy_barrier_info(const Node* src) { _barrier = src->as_Load()->_barrier; }
   266   void copy_barrier_info(const Node* src) { _barrier = src->as_Load()->_barrier; }
   269   uint barrier_data() { return _barrier; }
   267   uint barrier_data() { return _barrier; }
   270   void set_barrier_data(uint barrier_data) { _barrier |= barrier_data; }
   268   void set_barrier_data(uint barrier_data) { _barrier |= barrier_data; }
       
   269 
       
   270   void pin() { _control_dependency = Pinned; }
       
   271   bool has_unknown_control_dependency() const { return _control_dependency == UnknownControl; }
   271 
   272 
   272 #ifndef PRODUCT
   273 #ifndef PRODUCT
   273   virtual void dump_spec(outputStream *st) const;
   274   virtual void dump_spec(outputStream *st) const;
   274 #endif
   275 #endif
   275 #ifdef ASSERT
   276 #ifdef ASSERT