hotspot/src/share/vm/opto/memnode.hpp
changeset 360 21d113ecbf6a
parent 247 2aeab9ac7fea
child 366 449c27706bac
equal deleted inserted replaced
357:f4edb0d9f109 360:21d113ecbf6a
   135     : MemNode(c,mem,adr,at), _type(rt) {
   135     : MemNode(c,mem,adr,at), _type(rt) {
   136     init_class_id(Class_Load);
   136     init_class_id(Class_Load);
   137   }
   137   }
   138 
   138 
   139   // Polymorphic factory method:
   139   // Polymorphic factory method:
   140   static LoadNode* make( Compile *C, Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *rt, BasicType bt );
   140   static Node* make( PhaseGVN& gvn, Node *c, Node *mem, Node *adr,
       
   141                      const TypePtr* at, const Type *rt, BasicType bt );
   141 
   142 
   142   virtual uint hash()   const;  // Check the type
   143   virtual uint hash()   const;  // Check the type
   143 
   144 
   144   // Handle algebraic identities here.  If we have an identity, return the Node
   145   // Handle algebraic identities here.  If we have an identity, return the Node
   145   // we are equivalent to.  We look for Load of a Store.
   146   // we are equivalent to.  We look for Load of a Store.
   328   // other optimizations).  Basically, it's ugly but so is the alternative.
   329   // other optimizations).  Basically, it's ugly but so is the alternative.
   329   // See comment in macro.cpp, around line 125 expand_allocate_common().
   330   // See comment in macro.cpp, around line 125 expand_allocate_common().
   330   virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
   331   virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
   331 };
   332 };
   332 
   333 
       
   334 
       
   335 //------------------------------LoadNNode--------------------------------------
       
   336 // Load a narrow oop from memory (either object or array)
       
   337 class LoadNNode : public LoadNode {
       
   338 public:
       
   339   LoadNNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const Type* t )
       
   340     : LoadNode(c,mem,adr,at,t) {}
       
   341   virtual int Opcode() const;
       
   342   virtual uint ideal_reg() const { return Op_RegN; }
       
   343   virtual int store_Opcode() const { return Op_StoreN; }
       
   344   virtual BasicType memory_type() const { return T_NARROWOOP; }
       
   345   // depends_only_on_test is almost always true, and needs to be almost always
       
   346   // true to enable key hoisting & commoning optimizations.  However, for the
       
   347   // special case of RawPtr loads from TLS top & end, the control edge carries
       
   348   // the dependence preventing hoisting past a Safepoint instead of the memory
       
   349   // edge.  (An unfortunate consequence of having Safepoints not set Raw
       
   350   // Memory; itself an unfortunate consequence of having Nodes which produce
       
   351   // results (new raw memory state) inside of loops preventing all manner of
       
   352   // other optimizations).  Basically, it's ugly but so is the alternative.
       
   353   // See comment in macro.cpp, around line 125 expand_allocate_common().
       
   354   virtual bool depends_only_on_test() const { return adr_type() != TypeRawPtr::BOTTOM; }
       
   355 };
       
   356 
   333 //------------------------------LoadKlassNode----------------------------------
   357 //------------------------------LoadKlassNode----------------------------------
   334 // Load a Klass from an object
   358 // Load a Klass from an object
   335 class LoadKlassNode : public LoadPNode {
   359 class LoadKlassNode : public LoadPNode {
   336 public:
   360 public:
   337   LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk = TypeKlassPtr::OBJECT )
   361   LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk = TypeKlassPtr::OBJECT )
   374     : MemNode(c,mem,adr,at,val,oop_store) {
   398     : MemNode(c,mem,adr,at,val,oop_store) {
   375     init_class_id(Class_Store);
   399     init_class_id(Class_Store);
   376   }
   400   }
   377 
   401 
   378   // Polymorphic factory method:
   402   // Polymorphic factory method:
   379   static StoreNode* make( Compile *C, Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, BasicType bt );
   403   static StoreNode* make( PhaseGVN& gvn, Node *c, Node *mem, Node *adr,
       
   404                           const TypePtr* at, Node *val, BasicType bt );
   380 
   405 
   381   virtual uint hash() const;    // Check the type
   406   virtual uint hash() const;    // Check the type
   382 
   407 
   383   // If the store is to Field memory and the pointer is non-null, we can
   408   // If the store is to Field memory and the pointer is non-null, we can
   384   // zero out the control input.
   409   // zero out the control input.
   484 class StorePNode : public StoreNode {
   509 class StorePNode : public StoreNode {
   485 public:
   510 public:
   486   StorePNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {}
   511   StorePNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {}
   487   virtual int Opcode() const;
   512   virtual int Opcode() const;
   488   virtual BasicType memory_type() const { return T_ADDRESS; }
   513   virtual BasicType memory_type() const { return T_ADDRESS; }
       
   514 };
       
   515 
       
   516 //------------------------------StoreNNode-------------------------------------
       
   517 // Store narrow oop to memory
       
   518 class StoreNNode : public StoreNode {
       
   519 public:
       
   520   StoreNNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {}
       
   521   virtual int Opcode() const;
       
   522   virtual BasicType memory_type() const { return T_NARROWOOP; }
   489 };
   523 };
   490 
   524 
   491 //------------------------------StoreCMNode-----------------------------------
   525 //------------------------------StoreCMNode-----------------------------------
   492 // Store card-mark byte to memory for CM
   526 // Store card-mark byte to memory for CM
   493 // The last StoreCM before a SafePoint must be preserved and occur after its "oop" store
   527 // The last StoreCM before a SafePoint must be preserved and occur after its "oop" store
   595 
   629 
   596 //------------------------------CompareAndSwapPNode---------------------------
   630 //------------------------------CompareAndSwapPNode---------------------------
   597 class CompareAndSwapPNode : public LoadStoreNode {
   631 class CompareAndSwapPNode : public LoadStoreNode {
   598 public:
   632 public:
   599   CompareAndSwapPNode( Node *c, Node *mem, Node *adr, Node *val, Node *ex) : LoadStoreNode(c, mem, adr, val, ex) { }
   633   CompareAndSwapPNode( Node *c, Node *mem, Node *adr, Node *val, Node *ex) : LoadStoreNode(c, mem, adr, val, ex) { }
       
   634   virtual int Opcode() const;
       
   635 };
       
   636 
       
   637 //------------------------------CompareAndSwapNNode---------------------------
       
   638 class CompareAndSwapNNode : public LoadStoreNode {
       
   639 public:
       
   640   CompareAndSwapNNode( Node *c, Node *mem, Node *adr, Node *val, Node *ex) : LoadStoreNode(c, mem, adr, val, ex) { }
   600   virtual int Opcode() const;
   641   virtual int Opcode() const;
   601 };
   642 };
   602 
   643 
   603 //------------------------------ClearArray-------------------------------------
   644 //------------------------------ClearArray-------------------------------------
   604 class ClearArrayNode: public Node {
   645 class ClearArrayNode: public Node {