src/share/vm/opto/memnode.hpp

Print this page
rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.

*** 132,155 **** }; //------------------------------LoadNode--------------------------------------- // Load value; requires Memory and Address class LoadNode : public MemNode { protected: ! virtual uint cmp( const Node &n ) const; virtual uint size_of() const; // Size is bigger const Type* const _type; // What kind of value is loaded? public: ! LoadNode( Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *rt ) ! : MemNode(c,mem,adr,at), _type(rt) { init_class_id(Class_Load); } // Polymorphic factory method: ! static Node* make( PhaseGVN& gvn, Node *c, Node *mem, Node *adr, ! const TypePtr* at, const Type *rt, BasicType bt ); virtual uint hash() const; // Check the type // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for Load of a Store. --- 132,170 ---- }; //------------------------------LoadNode--------------------------------------- // Load value; requires Memory and Address class LoadNode : public MemNode { + public: + typedef enum { unordered = 0, acquire } Sem; + + private: + // On platforms with weak memory ordering (e.g., PPC, Ia64) we distinguish + // loads that can be reordered, and such requiring acquire semantics to + // adhere to the Java specification. The required behaviour is stored in + // this field. + const Sem _sem; + protected: ! virtual uint cmp(const Node &n) const; virtual uint size_of() const; // Size is bigger const Type* const _type; // What kind of value is loaded? public: ! LoadNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *rt, Sem sem) ! : MemNode(c,mem,adr,at), _type(rt), _sem(sem) { init_class_id(Class_Load); } + inline bool is_unordered() const { return !is_acquire(); } + inline bool is_acquire() const { + assert(_sem == unordered || _sem == acquire, "unexpected"); + return _sem == acquire; + } // Polymorphic factory method: ! static Node* make(PhaseGVN& gvn, Node *c, Node *mem, Node *adr, ! const TypePtr* at, const Type *rt, BasicType bt, Sem sem); virtual uint hash() const; // Check the type // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for Load of a Store.
*** 208,219 **** //------------------------------LoadBNode-------------------------------------- // Load a byte (8bits signed) from memory class LoadBNode : public LoadNode { public: ! LoadBNode( Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti = TypeInt::BYTE ) ! : LoadNode(c,mem,adr,at,ti) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *Value(PhaseTransform *phase) const; virtual int store_Opcode() const { return Op_StoreB; } --- 223,234 ---- //------------------------------LoadBNode-------------------------------------- // Load a byte (8bits signed) from memory class LoadBNode : public LoadNode { public: ! LoadBNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, Sem sem) ! : LoadNode(c, mem, adr, at, ti, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *Value(PhaseTransform *phase) const; virtual int store_Opcode() const { return Op_StoreB; }
*** 222,233 **** //------------------------------LoadUBNode------------------------------------- // Load a unsigned byte (8bits unsigned) from memory class LoadUBNode : public LoadNode { public: ! LoadUBNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt* ti = TypeInt::UBYTE ) ! : LoadNode(c, mem, adr, at, ti) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *Value(PhaseTransform *phase) const; virtual int store_Opcode() const { return Op_StoreB; } --- 237,248 ---- //------------------------------LoadUBNode------------------------------------- // Load a unsigned byte (8bits unsigned) from memory class LoadUBNode : public LoadNode { public: ! LoadUBNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt* ti, Sem sem) ! : LoadNode(c, mem, adr, at, ti, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *Value(PhaseTransform *phase) const; virtual int store_Opcode() const { return Op_StoreB; }
*** 236,247 **** //------------------------------LoadUSNode------------------------------------- // Load an unsigned short/char (16bits unsigned) from memory class LoadUSNode : public LoadNode { public: ! LoadUSNode( Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti = TypeInt::CHAR ) ! : LoadNode(c,mem,adr,at,ti) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *Value(PhaseTransform *phase) const; virtual int store_Opcode() const { return Op_StoreC; } --- 251,262 ---- //------------------------------LoadUSNode------------------------------------- // Load an unsigned short/char (16bits unsigned) from memory class LoadUSNode : public LoadNode { public: ! LoadUSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, Sem sem) ! : LoadNode(c, mem, adr, at, ti, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *Value(PhaseTransform *phase) const; virtual int store_Opcode() const { return Op_StoreC; }
*** 250,261 **** //------------------------------LoadSNode-------------------------------------- // Load a short (16bits signed) from memory class LoadSNode : public LoadNode { public: ! LoadSNode( Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti = TypeInt::SHORT ) ! : LoadNode(c,mem,adr,at,ti) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *Value(PhaseTransform *phase) const; virtual int store_Opcode() const { return Op_StoreC; } --- 265,276 ---- //------------------------------LoadSNode-------------------------------------- // Load a short (16bits signed) from memory class LoadSNode : public LoadNode { public: ! LoadSNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, Sem sem) ! : LoadNode(c, mem, adr, at, ti, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *Value(PhaseTransform *phase) const; virtual int store_Opcode() const { return Op_StoreC; }
*** 264,287 **** //------------------------------LoadINode-------------------------------------- // Load an integer from memory class LoadINode : public LoadNode { public: ! LoadINode( Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti = TypeInt::INT ) ! : LoadNode(c,mem,adr,at,ti) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual int store_Opcode() const { return Op_StoreI; } virtual BasicType memory_type() const { return T_INT; } }; //------------------------------LoadRangeNode---------------------------------- // Load an array length from the array class LoadRangeNode : public LoadINode { public: ! LoadRangeNode( Node *c, Node *mem, Node *adr, const TypeInt *ti = TypeInt::POS ) ! : LoadINode(c,mem,adr,TypeAryPtr::RANGE,ti) {} virtual int Opcode() const; virtual const Type *Value( PhaseTransform *phase ) const; virtual Node *Identity( PhaseTransform *phase ); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); }; --- 279,302 ---- //------------------------------LoadINode-------------------------------------- // Load an integer from memory class LoadINode : public LoadNode { public: ! LoadINode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeInt *ti, Sem sem) ! : LoadNode(c, mem, adr, at, ti, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual int store_Opcode() const { return Op_StoreI; } virtual BasicType memory_type() const { return T_INT; } }; //------------------------------LoadRangeNode---------------------------------- // Load an array length from the array class LoadRangeNode : public LoadINode { public: ! LoadRangeNode(Node *c, Node *mem, Node *adr, const TypeInt *ti = TypeInt::POS) ! : LoadINode(c, mem, adr, TypeAryPtr::RANGE, ti, LoadNode::unordered) {} virtual int Opcode() const; virtual const Type *Value( PhaseTransform *phase ) const; virtual Node *Identity( PhaseTransform *phase ); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); };
*** 296,317 **** } virtual uint size_of() const { return sizeof(*this); } const bool _require_atomic_access; // is piecewise load forbidden? public: ! LoadLNode( Node *c, Node *mem, Node *adr, const TypePtr* at, ! const TypeLong *tl = TypeLong::LONG, ! bool require_atomic_access = false ) ! : LoadNode(c,mem,adr,at,tl) ! , _require_atomic_access(require_atomic_access) ! {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegL; } virtual int store_Opcode() const { return Op_StoreL; } virtual BasicType memory_type() const { return T_LONG; } bool require_atomic_access() { return _require_atomic_access; } ! static LoadLNode* make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt); #ifndef PRODUCT virtual void dump_spec(outputStream *st) const { LoadNode::dump_spec(st); if (_require_atomic_access) st->print(" Atomic!"); } --- 311,330 ---- } virtual uint size_of() const { return sizeof(*this); } const bool _require_atomic_access; // is piecewise load forbidden? public: ! LoadLNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const TypeLong *tl, ! bool require_atomic_access, Sem sem) ! : LoadNode(c, mem, adr, at, tl, sem), _require_atomic_access(require_atomic_access) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegL; } virtual int store_Opcode() const { return Op_StoreL; } virtual BasicType memory_type() const { return T_LONG; } bool require_atomic_access() { return _require_atomic_access; } ! static LoadLNode* make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, ! const Type* rt, Sem sem); #ifndef PRODUCT virtual void dump_spec(outputStream *st) const { LoadNode::dump_spec(st); if (_require_atomic_access) st->print(" Atomic!"); }
*** 320,373 **** //------------------------------LoadL_unalignedNode---------------------------- // Load a long from unaligned memory class LoadL_unalignedNode : public LoadLNode { public: ! LoadL_unalignedNode( Node *c, Node *mem, Node *adr, const TypePtr* at ) ! : LoadLNode(c,mem,adr,at) {} virtual int Opcode() const; }; //------------------------------LoadFNode-------------------------------------- // Load a float (64 bits) from memory class LoadFNode : public LoadNode { public: ! LoadFNode( Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t = Type::FLOAT ) ! : LoadNode(c,mem,adr,at,t) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegF; } virtual int store_Opcode() const { return Op_StoreF; } virtual BasicType memory_type() const { return T_FLOAT; } }; //------------------------------LoadDNode-------------------------------------- // Load a double (64 bits) from memory class LoadDNode : public LoadNode { public: ! LoadDNode( Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t = Type::DOUBLE ) ! : LoadNode(c,mem,adr,at,t) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegD; } virtual int store_Opcode() const { return Op_StoreD; } virtual BasicType memory_type() const { return T_DOUBLE; } }; //------------------------------LoadD_unalignedNode---------------------------- // Load a double from unaligned memory class LoadD_unalignedNode : public LoadDNode { public: ! LoadD_unalignedNode( Node *c, Node *mem, Node *adr, const TypePtr* at ) ! : LoadDNode(c,mem,adr,at) {} virtual int Opcode() const; }; //------------------------------LoadPNode-------------------------------------- // Load a pointer from memory (either object or array) class LoadPNode : public LoadNode { public: ! LoadPNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypePtr* t ) ! : LoadNode(c,mem,adr,at,t) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } virtual int store_Opcode() const { return Op_StoreP; } virtual BasicType memory_type() const { return T_ADDRESS; } // depends_only_on_test is almost always true, and needs to be almost always --- 333,386 ---- //------------------------------LoadL_unalignedNode---------------------------- // Load a long from unaligned memory class LoadL_unalignedNode : public LoadLNode { public: ! LoadL_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Sem sem) ! : LoadLNode(c, mem, adr, at, TypeLong::LONG, false, sem) {} virtual int Opcode() const; }; //------------------------------LoadFNode-------------------------------------- // Load a float (64 bits) from memory class LoadFNode : public LoadNode { public: ! LoadFNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t, Sem sem) ! : LoadNode(c, mem, adr, at, t, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegF; } virtual int store_Opcode() const { return Op_StoreF; } virtual BasicType memory_type() const { return T_FLOAT; } }; //------------------------------LoadDNode-------------------------------------- // Load a double (64 bits) from memory class LoadDNode : public LoadNode { public: ! LoadDNode(Node *c, Node *mem, Node *adr, const TypePtr* at, const Type *t, Sem sem) ! : LoadNode(c, mem, adr, at, t, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegD; } virtual int store_Opcode() const { return Op_StoreD; } virtual BasicType memory_type() const { return T_DOUBLE; } }; //------------------------------LoadD_unalignedNode---------------------------- // Load a double from unaligned memory class LoadD_unalignedNode : public LoadDNode { public: ! LoadD_unalignedNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Sem sem) ! : LoadDNode(c, mem, adr, at, Type::DOUBLE, sem) {} virtual int Opcode() const; }; //------------------------------LoadPNode-------------------------------------- // Load a pointer from memory (either object or array) class LoadPNode : public LoadNode { public: ! LoadPNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypePtr* t, Sem sem) ! : LoadNode(c, mem, adr, at, t, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } virtual int store_Opcode() const { return Op_StoreP; } virtual BasicType memory_type() const { return T_ADDRESS; } // depends_only_on_test is almost always true, and needs to be almost always
*** 385,396 **** //------------------------------LoadNNode-------------------------------------- // Load a narrow oop from memory (either object or array) class LoadNNode : public LoadNode { public: ! LoadNNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const Type* t ) ! : LoadNode(c,mem,adr,at,t) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegN; } virtual int store_Opcode() const { return Op_StoreN; } virtual BasicType memory_type() const { return T_NARROWOOP; } // depends_only_on_test is almost always true, and needs to be almost always --- 398,409 ---- //------------------------------LoadNNode-------------------------------------- // Load a narrow oop from memory (either object or array) class LoadNNode : public LoadNode { public: ! LoadNNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const Type* t, Sem sem) ! : LoadNode(c, mem, adr, at, t, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegN; } virtual int store_Opcode() const { return Op_StoreN; } virtual BasicType memory_type() const { return T_NARROWOOP; } // depends_only_on_test is almost always true, and needs to be almost always
*** 407,418 **** //------------------------------LoadKlassNode---------------------------------- // Load a Klass from an object class LoadKlassNode : public LoadPNode { public: ! LoadKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk ) ! : LoadPNode(c,mem,adr,at,tk) {} virtual int Opcode() const; virtual const Type *Value( PhaseTransform *phase ) const; virtual Node *Identity( PhaseTransform *phase ); virtual bool depends_only_on_test() const { return true; } --- 420,431 ---- //------------------------------LoadKlassNode---------------------------------- // Load a Klass from an object class LoadKlassNode : public LoadPNode { public: ! LoadKlassNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk, Sem sem) ! : LoadPNode(c, mem, adr, at, tk, sem) {} virtual int Opcode() const; virtual const Type *Value( PhaseTransform *phase ) const; virtual Node *Identity( PhaseTransform *phase ); virtual bool depends_only_on_test() const { return true; }
*** 423,434 **** //------------------------------LoadNKlassNode--------------------------------- // Load a narrow Klass from an object. class LoadNKlassNode : public LoadNNode { public: ! LoadNKlassNode( Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowKlass *tk ) ! : LoadNNode(c,mem,adr,at,tk) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegN; } virtual int store_Opcode() const { return Op_StoreNKlass; } virtual BasicType memory_type() const { return T_NARROWKLASS; } --- 436,447 ---- //------------------------------LoadNKlassNode--------------------------------- // Load a narrow Klass from an object. class LoadNKlassNode : public LoadNNode { public: ! LoadNKlassNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeNarrowKlass *tk, Sem sem) ! : LoadNNode(c, mem, adr, at, tk, sem) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegN; } virtual int store_Opcode() const { return Op_StoreNKlass; } virtual BasicType memory_type() const { return T_NARROWKLASS; }
*** 439,468 **** //------------------------------StoreNode-------------------------------------- // Store value; requires Store, Address and Value class StoreNode : public MemNode { protected: virtual uint cmp( const Node &n ) const; virtual bool depends_only_on_test() const { return false; } Node *Ideal_masked_input (PhaseGVN *phase, uint mask); Node *Ideal_sign_extended_input(PhaseGVN *phase, int num_bits); public: ! StoreNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) ! : MemNode(c,mem,adr,at,val) { init_class_id(Class_Store); } ! StoreNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Node *oop_store ) ! : MemNode(c,mem,adr,at,val,oop_store) { init_class_id(Class_Store); } ! // Polymorphic factory method: ! static StoreNode* make( PhaseGVN& gvn, Node *c, Node *mem, Node *adr, ! const TypePtr* at, Node *val, BasicType bt ); virtual uint hash() const; // Check the type // If the store is to Field memory and the pointer is non-null, we can // zero out the control input. --- 452,517 ---- //------------------------------StoreNode-------------------------------------- // Store value; requires Store, Address and Value class StoreNode : public MemNode { + public: + typedef enum { unordered = 0, release } Sem; + private: + // On platforms with weak memory ordering (e.g., PPC, Ia64) we distinguish + // stores that can be reordered, and such requiring release semantics to + // adhere to the Java specification. The required behaviour is stored in + // this field. + const Sem _sem; + // Needed for proper cloning. + virtual uint size_of() const { return sizeof(*this); } protected: virtual uint cmp( const Node &n ) const; virtual bool depends_only_on_test() const { return false; } Node *Ideal_masked_input (PhaseGVN *phase, uint mask); Node *Ideal_sign_extended_input(PhaseGVN *phase, int num_bits); public: ! // We must ensure that stores of object references will be visible ! // only after the object's initialization. So the callers of this ! // procedure must indicate that the store requires `release' ! // semantics, if the stored value is an object reference that might ! // point to a new object and may become externally visible. ! StoreNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : MemNode(c, mem, adr, at, val), _sem(sem) { init_class_id(Class_Store); } ! StoreNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Node *oop_store, Sem sem) ! : MemNode(c, mem, adr, at, val, oop_store), _sem(sem) { init_class_id(Class_Store); } ! inline bool is_unordered() const { return !is_release(); } ! inline bool is_release() const { ! assert((_sem == unordered || _sem == release), "unexpected"); ! return _sem == release; ! } ! ! // Conservatively release stores of object references in order to ! // ensure visibility of object initialization. ! static inline Sem release_if_reference(const BasicType t) { ! const Sem s = (t == T_ARRAY || ! t == T_ADDRESS || // Might be the address of an object reference (`boxing'). ! t == T_OBJECT) ? release : unordered; ! return s; ! } ! ! // Polymorphic factory method ! // ! // We must ensure that stores of object references will be visible ! // only after the object's initialization. So the callers of this ! // procedure must indicate that the store requires `release' ! // semantics, if the stored value is an object reference that might ! // point to a new object and may become externally visible. ! static StoreNode* make(PhaseGVN& gvn, Node *c, Node *mem, Node *adr, ! const TypePtr* at, Node *val, BasicType bt, Sem sem); virtual uint hash() const; // Check the type // If the store is to Field memory and the pointer is non-null, we can // zero out the control input.
*** 489,519 **** //------------------------------StoreBNode------------------------------------- // Store byte to memory class StoreBNode : public StoreNode { public: ! StoreBNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual BasicType memory_type() const { return T_BYTE; } }; //------------------------------StoreCNode------------------------------------- // Store char/short to memory class StoreCNode : public StoreNode { public: ! StoreCNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual BasicType memory_type() const { return T_CHAR; } }; //------------------------------StoreINode------------------------------------- // Store int to memory class StoreINode : public StoreNode { public: ! StoreINode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_INT; } }; //------------------------------StoreLNode------------------------------------- --- 538,571 ---- //------------------------------StoreBNode------------------------------------- // Store byte to memory class StoreBNode : public StoreNode { public: ! StoreBNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : StoreNode(c, mem, adr, at, val, sem) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual BasicType memory_type() const { return T_BYTE; } }; //------------------------------StoreCNode------------------------------------- // Store char/short to memory class StoreCNode : public StoreNode { public: ! StoreCNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : StoreNode(c, mem, adr, at, val, sem) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual BasicType memory_type() const { return T_CHAR; } }; //------------------------------StoreINode------------------------------------- // Store int to memory class StoreINode : public StoreNode { public: ! StoreINode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : StoreNode(c, mem, adr, at, val, sem) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_INT; } }; //------------------------------StoreLNode-------------------------------------
*** 526,544 **** } virtual uint size_of() const { return sizeof(*this); } const bool _require_atomic_access; // is piecewise store forbidden? public: ! StoreLNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, ! bool require_atomic_access = false ) ! : StoreNode(c,mem,adr,at,val) ! , _require_atomic_access(require_atomic_access) ! {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_LONG; } bool require_atomic_access() { return _require_atomic_access; } ! static StoreLNode* make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val); #ifndef PRODUCT virtual void dump_spec(outputStream *st) const { StoreNode::dump_spec(st); if (_require_atomic_access) st->print(" Atomic!"); } --- 578,593 ---- } virtual uint size_of() const { return sizeof(*this); } const bool _require_atomic_access; // is piecewise store forbidden? public: ! StoreLNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, bool require_atomic_access, Sem sem) ! : StoreNode(c, mem, adr, at, val, sem), _require_atomic_access(require_atomic_access) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_LONG; } bool require_atomic_access() { return _require_atomic_access; } ! static StoreLNode* make_atomic(Compile *C, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, Sem sem); #ifndef PRODUCT virtual void dump_spec(outputStream *st) const { StoreNode::dump_spec(st); if (_require_atomic_access) st->print(" Atomic!"); }
*** 547,593 **** //------------------------------StoreFNode------------------------------------- // Store float to memory class StoreFNode : public StoreNode { public: ! StoreFNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_FLOAT; } }; //------------------------------StoreDNode------------------------------------- // Store double to memory class StoreDNode : public StoreNode { public: ! StoreDNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_DOUBLE; } }; //------------------------------StorePNode------------------------------------- // Store pointer to memory class StorePNode : public StoreNode { public: ! StorePNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_ADDRESS; } }; //------------------------------StoreNNode------------------------------------- // Store narrow oop to memory class StoreNNode : public StoreNode { public: ! StoreNNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNode(c,mem,adr,at,val) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_NARROWOOP; } }; //------------------------------StoreNKlassNode-------------------------------------- // Store narrow klass to memory class StoreNKlassNode : public StoreNNode { public: ! StoreNKlassNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val ) : StoreNNode(c,mem,adr,at,val) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_NARROWKLASS; } }; //------------------------------StoreCMNode----------------------------------- --- 596,647 ---- //------------------------------StoreFNode------------------------------------- // Store float to memory class StoreFNode : public StoreNode { public: ! StoreFNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : StoreNode(c, mem, adr, at, val, sem) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_FLOAT; } }; //------------------------------StoreDNode------------------------------------- // Store double to memory class StoreDNode : public StoreNode { public: ! StoreDNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : StoreNode(c, mem, adr, at, val, sem) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_DOUBLE; } }; //------------------------------StorePNode------------------------------------- // Store pointer to memory class StorePNode : public StoreNode { public: ! StorePNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : StoreNode(c, mem, adr, at, val, sem) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_ADDRESS; } }; //------------------------------StoreNNode------------------------------------- // Store narrow oop to memory class StoreNNode : public StoreNode { public: ! StoreNNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : StoreNode(c, mem, adr, at, val, sem) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_NARROWOOP; } }; //------------------------------StoreNKlassNode-------------------------------------- // Store narrow klass to memory class StoreNKlassNode : public StoreNNode { public: ! StoreNKlassNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Sem sem) ! : StoreNNode(c, mem, adr, at, val, sem) {} virtual int Opcode() const; virtual BasicType memory_type() const { return T_NARROWKLASS; } }; //------------------------------StoreCMNode-----------------------------------
*** 604,614 **** virtual uint size_of() const { return sizeof(*this); } int _oop_alias_idx; // The alias_idx of OopStore public: StoreCMNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Node *oop_store, int oop_alias_idx ) : ! StoreNode(c,mem,adr,at,val,oop_store), _oop_alias_idx(oop_alias_idx) { assert(_oop_alias_idx >= Compile::AliasIdxRaw || _oop_alias_idx == Compile::AliasIdxBot && Compile::current()->AliasLevel() == 0, "bad oop alias idx"); } --- 658,668 ---- virtual uint size_of() const { return sizeof(*this); } int _oop_alias_idx; // The alias_idx of OopStore public: StoreCMNode( Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Node *oop_store, int oop_alias_idx ) : ! StoreNode(c, mem, adr, at, val, oop_store, StoreNode::release), _oop_alias_idx(oop_alias_idx) { assert(_oop_alias_idx >= Compile::AliasIdxRaw || _oop_alias_idx == Compile::AliasIdxBot && Compile::current()->AliasLevel() == 0, "bad oop alias idx"); }
*** 624,635 **** // Load-locked a pointer from memory (either object or array). // On Sparc & Intel this is implemented as a normal pointer load. // On PowerPC and friends it's a real load-locked. class LoadPLockedNode : public LoadPNode { public: ! LoadPLockedNode( Node *c, Node *mem, Node *adr ) ! : LoadPNode(c,mem,adr,TypeRawPtr::BOTTOM, TypeRawPtr::BOTTOM) {} virtual int Opcode() const; virtual int store_Opcode() const { return Op_StorePConditional; } virtual bool depends_only_on_test() const { return true; } }; --- 678,689 ---- // Load-locked a pointer from memory (either object or array). // On Sparc & Intel this is implemented as a normal pointer load. // On PowerPC and friends it's a real load-locked. class LoadPLockedNode : public LoadPNode { public: ! LoadPLockedNode(Node *c, Node *mem, Node *adr, Sem sem) ! : LoadPNode(c, mem, adr, TypeRawPtr::BOTTOM, TypeRawPtr::BOTTOM, sem) {} virtual int Opcode() const; virtual int store_Opcode() const { return Op_StorePConditional; } virtual bool depends_only_on_test() const { return true; } };