src/share/vm/opto/graphKit.cpp

changeset 8653
0ffee573412b
parent 8608
0d78aecb0948
child 8856
ac27a9c85bea
child 9738
18fd6d87f16f
     1.1 --- a/src/share/vm/opto/graphKit.cpp	Mon Nov 21 05:29:59 2016 +0000
     1.2 +++ b/src/share/vm/opto/graphKit.cpp	Wed Nov 23 23:01:34 2016 -0800
     1.3 @@ -1452,7 +1452,11 @@
     1.4  // factory methods in "int adr_idx"
     1.5  Node* GraphKit::make_load(Node* ctl, Node* adr, const Type* t, BasicType bt,
     1.6                            int adr_idx,
     1.7 -                          MemNode::MemOrd mo, LoadNode::ControlDependency control_dependency, bool require_atomic_access) {
     1.8 +                          MemNode::MemOrd mo,
     1.9 +                          LoadNode::ControlDependency control_dependency,
    1.10 +                          bool require_atomic_access,
    1.11 +                          bool unaligned,
    1.12 +                          bool mismatched) {
    1.13    assert(adr_idx != Compile::AliasIdxTop, "use other make_load factory" );
    1.14    const TypePtr* adr_type = NULL; // debug-mode-only argument
    1.15    debug_only(adr_type = C->get_adr_type(adr_idx));
    1.16 @@ -1465,6 +1469,12 @@
    1.17    } else {
    1.18      ld = LoadNode::make(_gvn, ctl, mem, adr, adr_type, t, bt, mo, control_dependency);
    1.19    }
    1.20 +  if (unaligned) {
    1.21 +    ld->as_Load()->set_unaligned_access();
    1.22 +  }
    1.23 +  if (mismatched) {
    1.24 +    ld->as_Load()->set_mismatched_access();
    1.25 +  }
    1.26    ld = _gvn.transform(ld);
    1.27    if ((bt == T_OBJECT) && C->do_escape_analysis() || C->eliminate_boxing()) {
    1.28      // Improve graph before escape analysis and boxing elimination.
    1.29 @@ -1476,7 +1486,9 @@
    1.30  Node* GraphKit::store_to_memory(Node* ctl, Node* adr, Node *val, BasicType bt,
    1.31                                  int adr_idx,
    1.32                                  MemNode::MemOrd mo,
    1.33 -                                bool require_atomic_access) {
    1.34 +                                bool require_atomic_access,
    1.35 +                                bool unaligned,
    1.36 +                                bool mismatched) {
    1.37    assert(adr_idx != Compile::AliasIdxTop, "use other store_to_memory factory" );
    1.38    const TypePtr* adr_type = NULL;
    1.39    debug_only(adr_type = C->get_adr_type(adr_idx));
    1.40 @@ -1489,6 +1501,12 @@
    1.41    } else {
    1.42      st = StoreNode::make(_gvn, ctl, mem, adr, adr_type, val, bt, mo);
    1.43    }
    1.44 +  if (unaligned) {
    1.45 +    st->as_Store()->set_unaligned_access();
    1.46 +  }
    1.47 +  if (mismatched) {
    1.48 +    st->as_Store()->set_mismatched_access();
    1.49 +  }
    1.50    st = _gvn.transform(st);
    1.51    set_memory(st, adr_idx);
    1.52    // Back-to-back stores can only remove intermediate store with DU info
    1.53 @@ -1588,7 +1606,8 @@
    1.54                            const TypeOopPtr* val_type,
    1.55                            BasicType bt,
    1.56                            bool use_precise,
    1.57 -                          MemNode::MemOrd mo) {
    1.58 +                          MemNode::MemOrd mo,
    1.59 +                          bool mismatched) {
    1.60    // Transformation of a value which could be NULL pointer (CastPP #NULL)
    1.61    // could be delayed during Parse (for example, in adjust_map_after_if()).
    1.62    // Execute transformation here to avoid barrier generation in such case.
    1.63 @@ -1608,7 +1627,7 @@
    1.64                NULL /* pre_val */,
    1.65                bt);
    1.66  
    1.67 -  Node* store = store_to_memory(control(), adr, val, bt, adr_idx, mo);
    1.68 +  Node* store = store_to_memory(control(), adr, val, bt, adr_idx, mo, mismatched);
    1.69    post_barrier(control(), store, obj, adr, adr_idx, val, bt, use_precise);
    1.70    return store;
    1.71  }
    1.72 @@ -1620,7 +1639,8 @@
    1.73                               const TypePtr* adr_type,
    1.74                               Node* val,
    1.75                               BasicType bt,
    1.76 -                             MemNode::MemOrd mo) {
    1.77 +                             MemNode::MemOrd mo,
    1.78 +                             bool mismatched) {
    1.79    Compile::AliasType* at = C->alias_type(adr_type);
    1.80    const TypeOopPtr* val_type = NULL;
    1.81    if (adr_type->isa_instptr()) {
    1.82 @@ -1639,7 +1659,7 @@
    1.83    if (val_type == NULL) {
    1.84      val_type = TypeInstPtr::BOTTOM;
    1.85    }
    1.86 -  return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true, mo);
    1.87 +  return store_oop(ctl, obj, adr, adr_type, val, val_type, bt, true, mo, mismatched);
    1.88  }
    1.89  
    1.90  

mercurial