486 // semantics, if the stored value is an object reference that might
487 // point to a new object and may become externally visible.
488 StoreNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, MemOrd mo)
489 : MemNode(c, mem, adr, at, val), _mo(mo) {
490 init_class_id(Class_Store);
491 }
492 StoreNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Node *oop_store, MemOrd mo)
493 : MemNode(c, mem, adr, at, val, oop_store), _mo(mo) {
494 init_class_id(Class_Store);
495 }
496
497 inline bool is_unordered() const { return !is_release(); }
498 inline bool is_release() const {
499 assert((_mo == unordered || _mo == release), "unexpected");
500 return _mo == release;
501 }
502
503 // Conservatively release stores of object references in order to
504 // ensure visibility of object initialization.
505 static inline MemOrd release_if_reference(const BasicType t) {
506 const MemOrd mo = (t == T_ARRAY ||
507 t == T_ADDRESS || // Might be the address of an object reference (`boxing').
508 t == T_OBJECT) ? release : unordered;
509 return mo;
510 }
511
512 // Polymorphic factory method
513 //
514 // We must ensure that stores of object references will be visible
515 // only after the object's initialization. So the callers of this
516 // procedure must indicate that the store requires `release'
517 // semantics, if the stored value is an object reference that might
518 // point to a new object and may become externally visible.
519 static StoreNode* make(PhaseGVN& gvn, Node *c, Node *mem, Node *adr,
520 const TypePtr* at, Node *val, BasicType bt, MemOrd mo);
521
522 virtual uint hash() const; // Check the type
523
524 // If the store is to Field memory and the pointer is non-null, we can
525 // zero out the control input.
|
486 // semantics, if the stored value is an object reference that might
487 // point to a new object and may become externally visible.
488 StoreNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, MemOrd mo)
489 : MemNode(c, mem, adr, at, val), _mo(mo) {
490 init_class_id(Class_Store);
491 }
492 StoreNode(Node *c, Node *mem, Node *adr, const TypePtr* at, Node *val, Node *oop_store, MemOrd mo)
493 : MemNode(c, mem, adr, at, val, oop_store), _mo(mo) {
494 init_class_id(Class_Store);
495 }
496
497 inline bool is_unordered() const { return !is_release(); }
498 inline bool is_release() const {
499 assert((_mo == unordered || _mo == release), "unexpected");
500 return _mo == release;
501 }
502
503 // Conservatively release stores of object references in order to
504 // ensure visibility of object initialization.
505 static inline MemOrd release_if_reference(const BasicType t) {
506 // AArch64 doesn't need a release store here because object
507 // initialization contains the necessary barriers.
508 AARCH64_ONLY(return unordered);
509
510 const MemOrd mo = (t == T_ARRAY ||
511 t == T_ADDRESS || // Might be the address of an object reference (`boxing').
512 t == T_OBJECT) ? release : unordered;
513 return mo;
514 }
515
516 // Polymorphic factory method
517 //
518 // We must ensure that stores of object references will be visible
519 // only after the object's initialization. So the callers of this
520 // procedure must indicate that the store requires `release'
521 // semantics, if the stored value is an object reference that might
522 // point to a new object and may become externally visible.
523 static StoreNode* make(PhaseGVN& gvn, Node *c, Node *mem, Node *adr,
524 const TypePtr* at, Node *val, BasicType bt, MemOrd mo);
525
526 virtual uint hash() const; // Check the type
527
528 // If the store is to Field memory and the pointer is non-null, we can
529 // zero out the control input.
|