< prev index next >

src/hotspot/share/opto/memnode.hpp

Print this page




  94   static bool all_controls_dominate(Node* dom, Node* sub);
  95 
  96   virtual const class TypePtr *adr_type() const;  // returns bottom_type of address
  97 
  98   // Shared code for Ideal methods:
  99   Node *Ideal_common(PhaseGVN *phase, bool can_reshape);  // Return -1 for short-circuit NULL.
 100 
 101   // Helper function for adr_type() implementations.
 102   static const TypePtr* calculate_adr_type(const Type* t, const TypePtr* cross_check = NULL);
 103 
 104   // Raw access function, to allow copying of adr_type efficiently in
 105   // product builds and retain the debug info for debug builds.
 106   const TypePtr *raw_adr_type() const {
 107 #ifdef ASSERT
 108     return _adr_type;
 109 #else
 110     return 0;
 111 #endif
 112   }
 113 




 114   // Map a load or store opcode to its corresponding store opcode.
 115   // (Return -1 if unknown.)
 116   virtual int store_Opcode() const { return -1; }
 117 
 118   // What is the type of the value in memory?  (T_VOID mean "unspecified".)
 119   virtual BasicType memory_type() const = 0;
 120   virtual int memory_size() const {
 121 #ifdef ASSERT
 122     return type2aelembytes(memory_type(), true);
 123 #else
 124     return type2aelembytes(memory_type());
 125 #endif
 126   }
 127 
 128   // Search through memory states which precede this node (load or store).
 129   // Look for an exact match for the address, with no intervening
 130   // aliased stores.
 131   Node* find_previous_store(PhaseTransform* phase);
 132 
 133   // Can this node (load or store) accurately see a stored value in


 505   static Node* make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* at,
 506                     const TypeKlassPtr* tk = TypeKlassPtr::OBJECT);
 507 };
 508 
 509 //------------------------------LoadNKlassNode---------------------------------
 510 // Load a narrow Klass from an object.
 511 class LoadNKlassNode : public LoadNNode {
 512 public:
 513   LoadNKlassNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowKlass *tk, MemOrd mo)
 514     : LoadNNode(c, mem, adr, at, tk, mo) {}
 515   virtual int Opcode() const;
 516   virtual uint ideal_reg() const { return Op_RegN; }
 517   virtual int store_Opcode() const { return Op_StoreNKlass; }
 518   virtual BasicType memory_type() const { return T_NARROWKLASS; }
 519 
 520   virtual const Type* Value(PhaseGVN* phase) const;
 521   virtual Node* Identity(PhaseGVN* phase);
 522   virtual bool depends_only_on_test() const { return true; }
 523 };
 524 



























 525 
 526 //------------------------------StoreNode--------------------------------------
 527 // Store value; requires Store, Address and Value
 528 class StoreNode : public MemNode {
 529 private:
 530   // On platforms with weak memory ordering (e.g., PPC, Ia64) we distinguish
 531   // stores that can be reordered, and such requiring release semantics to
 532   // adhere to the Java specification.  The required behaviour is stored in
 533   // this field.
 534   const MemOrd _mo;
 535   // Needed for proper cloning.
 536   virtual uint size_of() const { return sizeof(*this); }
 537 protected:
 538   virtual bool cmp( const Node &n ) const;
 539   virtual bool depends_only_on_test() const { return false; }
 540 
 541   Node *Ideal_masked_input       (PhaseGVN *phase, uint mask);
 542   Node *Ideal_sign_extended_input(PhaseGVN *phase, int  num_bits);
 543 
 544 public:




  94   static bool all_controls_dominate(Node* dom, Node* sub);
  95 
  96   virtual const class TypePtr *adr_type() const;  // returns bottom_type of address
  97 
  98   // Shared code for Ideal methods:
  99   Node *Ideal_common(PhaseGVN *phase, bool can_reshape);  // Return -1 for short-circuit NULL.
 100 
 101   // Helper function for adr_type() implementations.
 102   static const TypePtr* calculate_adr_type(const Type* t, const TypePtr* cross_check = NULL);
 103 
 104   // Raw access function, to allow copying of adr_type efficiently in
 105   // product builds and retain the debug info for debug builds.
 106   const TypePtr *raw_adr_type() const {
 107 #ifdef ASSERT
 108     return _adr_type;
 109 #else
 110     return 0;
 111 #endif
 112   }
 113 
 114 #ifdef ASSERT
 115   void set_adr_type(const TypePtr* adr_type) { _adr_type = adr_type; }
 116 #endif
 117   
 118   // Map a load or store opcode to its corresponding store opcode.
 119   // (Return -1 if unknown.)
 120   virtual int store_Opcode() const { return -1; }
 121 
 122   // What is the type of the value in memory?  (T_VOID mean "unspecified".)
 123   virtual BasicType memory_type() const = 0;
 124   virtual int memory_size() const {
 125 #ifdef ASSERT
 126     return type2aelembytes(memory_type(), true);
 127 #else
 128     return type2aelembytes(memory_type());
 129 #endif
 130   }
 131 
 132   // Search through memory states which precede this node (load or store).
 133   // Look for an exact match for the address, with no intervening
 134   // aliased stores.
 135   Node* find_previous_store(PhaseTransform* phase);
 136 
 137   // Can this node (load or store) accurately see a stored value in


 509   static Node* make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* at,
 510                     const TypeKlassPtr* tk = TypeKlassPtr::OBJECT);
 511 };
 512 
 513 //------------------------------LoadNKlassNode---------------------------------
 514 // Load a narrow Klass from an object.
 515 class LoadNKlassNode : public LoadNNode {
 516 public:
 517   LoadNKlassNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowKlass *tk, MemOrd mo)
 518     : LoadNNode(c, mem, adr, at, tk, mo) {}
 519   virtual int Opcode() const;
 520   virtual uint ideal_reg() const { return Op_RegN; }
 521   virtual int store_Opcode() const { return Op_StoreNKlass; }
 522   virtual BasicType memory_type() const { return T_NARROWKLASS; }
 523 
 524   virtual const Type* Value(PhaseGVN* phase) const;
 525   virtual Node* Identity(PhaseGVN* phase);
 526   virtual bool depends_only_on_test() const { return true; }
 527 };
 528 
 529 // Retrieve the null free property from an array klass. This is
 530 // treated a bit like a field that would be read from the klass
 531 // structure at runtime except, the implementation encodes the
 532 // property as a bit in the klass header field of the array. This
 533 // implementation detail is hidden under this node so it doesn't make
 534 // a difference for high level optimizations. At final graph reshaping
 535 // time, this node is turned into the actual logical operations that
 536 // extract the property from the klass pointer. For this to work
 537 // correctly, GetNullFreePropertyNode must take a LoadKlass/LoadNKlass
 538 // input. The Ideal transformation splits the GetNullFreePropertyNode
 539 // through phis, Value returns a constant if the node's input is a
 540 // constant. These 2 should guarantee GetNullFreePropertyNode does
 541 // indeed have a LoadKlass/LoadNKlass input at final graph reshaping
 542 // time.
 543 class GetNullFreePropertyNode : public Node {
 544 public:
 545   GetNullFreePropertyNode(Node* klass) : Node(NULL, klass) {}
 546   virtual int Opcode() const;
 547   virtual const Type* Value(PhaseGVN* phase) const;
 548   virtual Node* Ideal(PhaseGVN *phase, bool can_reshape);
 549   virtual const Type* bottom_type() const {
 550     if (in(1)->bottom_type()->isa_klassptr()) {
 551       return TypeLong::LONG;
 552     }
 553     return TypeInt::INT;
 554   }
 555 };
 556 
 557 //------------------------------StoreNode--------------------------------------
 558 // Store value; requires Store, Address and Value
 559 class StoreNode : public MemNode {
 560 private:
 561   // On platforms with weak memory ordering (e.g., PPC, Ia64) we distinguish
 562   // stores that can be reordered, and such requiring release semantics to
 563   // adhere to the Java specification.  The required behaviour is stored in
 564   // this field.
 565   const MemOrd _mo;
 566   // Needed for proper cloning.
 567   virtual uint size_of() const { return sizeof(*this); }
 568 protected:
 569   virtual bool cmp( const Node &n ) const;
 570   virtual bool depends_only_on_test() const { return false; }
 571 
 572   Node *Ideal_masked_input       (PhaseGVN *phase, uint mask);
 573   Node *Ideal_sign_extended_input(PhaseGVN *phase, int  num_bits);
 574 
 575 public:


< prev index next >