src/share/vm/opto/graphKit.hpp

changeset 6479
2113136690bc
parent 5991
b2ee5dc63353
child 6503
a9becfeecd1b
     1.1 --- a/src/share/vm/opto/graphKit.hpp	Thu Nov 07 11:47:11 2013 +0100
     1.2 +++ b/src/share/vm/opto/graphKit.hpp	Fri Nov 15 11:05:32 2013 -0800
     1.3 @@ -510,36 +510,50 @@
     1.4  
     1.5    // Create a LoadNode, reading from the parser's memory state.
     1.6    // (Note:  require_atomic_access is useful only with T_LONG.)
     1.7 +  //
     1.8 +  // We choose the unordered semantics by default because we have
     1.9 +  // adapted the `do_put_xxx' and `do_get_xxx' procedures for the case
    1.10 +  // of volatile fields.
    1.11    Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
    1.12 -                  bool require_atomic_access = false) {
    1.13 +                  MemNode::MemOrd mo, bool require_atomic_access = false) {
    1.14      // This version computes alias_index from bottom_type
    1.15      return make_load(ctl, adr, t, bt, adr->bottom_type()->is_ptr(),
    1.16 -                     require_atomic_access);
    1.17 +                     mo, require_atomic_access);
    1.18    }
    1.19 -  Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, const TypePtr* adr_type, bool require_atomic_access = false) {
    1.20 +  Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, const TypePtr* adr_type,
    1.21 +                  MemNode::MemOrd mo, bool require_atomic_access = false) {
    1.22      // This version computes alias_index from an address type
    1.23      assert(adr_type != NULL, "use other make_load factory");
    1.24      return make_load(ctl, adr, t, bt, C->get_alias_index(adr_type),
    1.25 -                     require_atomic_access);
    1.26 +                     mo, require_atomic_access);
    1.27    }
    1.28    // This is the base version which is given an alias index.
    1.29 -  Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, int adr_idx, bool require_atomic_access = false);
    1.30 +  Node* make_load(Node* ctl, Node* adr, const Type* t, BasicType bt, int adr_idx,
    1.31 +                  MemNode::MemOrd mo, bool require_atomic_access = false);
    1.32  
    1.33    // Create & transform a StoreNode and store the effect into the
    1.34    // parser's memory state.
    1.35 +  //
    1.36 +  // We must ensure that stores of object references will be visible
    1.37 +  // only after the object's initialization. So the clients of this
    1.38 +  // procedure must indicate that the store requires `release'
    1.39 +  // semantics, if the stored value is an object reference that might
    1.40 +  // point to a new object and may become externally visible.
    1.41    Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt,
    1.42                          const TypePtr* adr_type,
    1.43 +                        MemNode::MemOrd mo,
    1.44                          bool require_atomic_access = false) {
    1.45      // This version computes alias_index from an address type
    1.46      assert(adr_type != NULL, "use other store_to_memory factory");
    1.47      return store_to_memory(ctl, adr, val, bt,
    1.48                             C->get_alias_index(adr_type),
    1.49 -                           require_atomic_access);
    1.50 +                           mo, require_atomic_access);
    1.51    }
    1.52    // This is the base version which is given alias index
    1.53    // Return the new StoreXNode
    1.54    Node* store_to_memory(Node* ctl, Node* adr, Node* val, BasicType bt,
    1.55                          int adr_idx,
    1.56 +                        MemNode::MemOrd,
    1.57                          bool require_atomic_access = false);
    1.58  
    1.59  
    1.60 @@ -557,40 +571,44 @@
    1.61  
    1.62    Node* store_oop(Node* ctl,
    1.63                    Node* obj,   // containing obj
    1.64 -                  Node* adr,  // actual adress to store val at
    1.65 +                  Node* adr,   // actual adress to store val at
    1.66                    const TypePtr* adr_type,
    1.67                    Node* val,
    1.68                    const TypeOopPtr* val_type,
    1.69                    BasicType bt,
    1.70 -                  bool use_precise);
    1.71 +                  bool use_precise,
    1.72 +                  MemNode::MemOrd mo);
    1.73  
    1.74    Node* store_oop_to_object(Node* ctl,
    1.75                              Node* obj,   // containing obj
    1.76 -                            Node* adr,  // actual adress to store val at
    1.77 +                            Node* adr,   // actual adress to store val at
    1.78                              const TypePtr* adr_type,
    1.79                              Node* val,
    1.80                              const TypeOopPtr* val_type,
    1.81 -                            BasicType bt) {
    1.82 -    return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, false);
    1.83 +                            BasicType bt,
    1.84 +                            MemNode::MemOrd mo) {
    1.85 +    return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, false, mo);
    1.86    }
    1.87  
    1.88    Node* store_oop_to_array(Node* ctl,
    1.89                             Node* obj,   // containing obj
    1.90 -                           Node* adr,  // actual adress to store val at
    1.91 +                           Node* adr,   // actual adress to store val at
    1.92                             const TypePtr* adr_type,
    1.93                             Node* val,
    1.94                             const TypeOopPtr* val_type,
    1.95 -                           BasicType bt) {
    1.96 -    return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true);
    1.97 +                           BasicType bt,
    1.98 +                           MemNode::MemOrd mo) {
    1.99 +    return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true, mo);
   1.100    }
   1.101  
   1.102    // Could be an array or object we don't know at compile time (unsafe ref.)
   1.103    Node* store_oop_to_unknown(Node* ctl,
   1.104                               Node* obj,   // containing obj
   1.105 -                             Node* adr,  // actual adress to store val at
   1.106 +                             Node* adr,   // actual adress to store val at
   1.107                               const TypePtr* adr_type,
   1.108                               Node* val,
   1.109 -                             BasicType bt);
   1.110 +                             BasicType bt,
   1.111 +                             MemNode::MemOrd mo);
   1.112  
   1.113    // For the few case where the barriers need special help
   1.114    void pre_barrier(bool do_load, Node* ctl,

mercurial