src/share/vm/opto/library_call.cpp

changeset 6479
2113136690bc
parent 6048
a57a165b8296
child 6489
50fdb38839eb
     1.1 --- a/src/share/vm/opto/library_call.cpp	Thu Nov 07 11:47:11 2013 +0100
     1.2 +++ b/src/share/vm/opto/library_call.cpp	Fri Nov 15 11:05:32 2013 -0800
     1.3 @@ -1057,7 +1057,7 @@
     1.4    const Type* thread_type  = TypeOopPtr::make_from_klass(thread_klass)->cast_to_ptr_type(TypePtr::NotNull);
     1.5    Node* thread = _gvn.transform(new (C) ThreadLocalNode());
     1.6    Node* p = basic_plus_adr(top()/*!oop*/, thread, in_bytes(JavaThread::threadObj_offset()));
     1.7 -  Node* threadObj = make_load(NULL, p, thread_type, T_OBJECT);
     1.8 +  Node* threadObj = make_load(NULL, p, thread_type, T_OBJECT, MemNode::unordered);
     1.9    tls_output = thread;
    1.10    return threadObj;
    1.11  }
    1.12 @@ -2640,7 +2640,7 @@
    1.13    if (need_mem_bar) insert_mem_bar(Op_MemBarCPUOrder);
    1.14  
    1.15    if (!is_store) {
    1.16 -    Node* p = make_load(control(), adr, value_type, type, adr_type, is_volatile);
    1.17 +    Node* p = make_load(control(), adr, value_type, type, adr_type, MemNode::unordered, is_volatile);
    1.18      // load value
    1.19      switch (type) {
    1.20      case T_BOOLEAN:
    1.21 @@ -2684,13 +2684,14 @@
    1.22        break;
    1.23      }
    1.24  
    1.25 +    MemNode::MemOrd mo = is_volatile ? MemNode::release : MemNode::unordered;
    1.26      if (type != T_OBJECT ) {
    1.27 -      (void) store_to_memory(control(), adr, val, type, adr_type, is_volatile);
    1.28 +      (void) store_to_memory(control(), adr, val, type, adr_type, mo, is_volatile);
    1.29      } else {
    1.30        // Possibly an oop being stored to Java heap or native memory
    1.31        if (!TypePtr::NULL_PTR->higher_equal(_gvn.type(heap_base_oop))) {
    1.32          // oop to Java heap.
    1.33 -        (void) store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type);
    1.34 +        (void) store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type, mo);
    1.35        } else {
    1.36          // We can't tell at compile time if we are storing in the Java heap or outside
    1.37          // of it. So we need to emit code to conditionally do the proper type of
    1.38 @@ -2702,11 +2703,11 @@
    1.39          __ if_then(heap_base_oop, BoolTest::ne, null(), PROB_UNLIKELY(0.999)); {
    1.40            // Sync IdealKit and graphKit.
    1.41            sync_kit(ideal);
    1.42 -          Node* st = store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type);
    1.43 +          Node* st = store_oop_to_unknown(control(), heap_base_oop, adr, adr_type, val, type, mo);
    1.44            // Update IdealKit memory.
    1.45            __ sync_kit(this);
    1.46          } __ else_(); {
    1.47 -          __ store(__ ctrl(), adr, val, type, alias_type->index(), is_volatile);
    1.48 +          __ store(__ ctrl(), adr, val, type, alias_type->index(), mo, is_volatile);
    1.49          } __ end_if();
    1.50          // Final sync IdealKit and GraphKit.
    1.51          final_sync(ideal);
    1.52 @@ -2979,12 +2980,12 @@
    1.53        Node *newval_enc = _gvn.transform(new (C) EncodePNode(newval, newval->bottom_type()->make_narrowoop()));
    1.54        if (kind == LS_xchg) {
    1.55          load_store = _gvn.transform(new (C) GetAndSetNNode(control(), mem, adr,
    1.56 -                                                              newval_enc, adr_type, value_type->make_narrowoop()));
    1.57 +                                                           newval_enc, adr_type, value_type->make_narrowoop()));
    1.58        } else {
    1.59          assert(kind == LS_cmpxchg, "wrong LoadStore operation");
    1.60          Node *oldval_enc = _gvn.transform(new (C) EncodePNode(oldval, oldval->bottom_type()->make_narrowoop()));
    1.61          load_store = _gvn.transform(new (C) CompareAndSwapNNode(control(), mem, adr,
    1.62 -                                                                   newval_enc, oldval_enc));
    1.63 +                                                                newval_enc, oldval_enc));
    1.64        }
    1.65      } else
    1.66  #endif
    1.67 @@ -3090,9 +3091,9 @@
    1.68    const bool require_atomic_access = true;
    1.69    Node* store;
    1.70    if (type == T_OBJECT) // reference stores need a store barrier.
    1.71 -    store = store_oop_to_unknown(control(), base, adr, adr_type, val, type);
    1.72 +    store = store_oop_to_unknown(control(), base, adr, adr_type, val, type, MemNode::release);
    1.73    else {
    1.74 -    store = store_to_memory(control(), adr, val, type, adr_type, require_atomic_access);
    1.75 +    store = store_to_memory(control(), adr, val, type, adr_type, MemNode::release, require_atomic_access);
    1.76    }
    1.77    insert_mem_bar(Op_MemBarCPUOrder);
    1.78    return true;
    1.79 @@ -3152,7 +3153,7 @@
    1.80      Node* insp = basic_plus_adr(kls, in_bytes(InstanceKlass::init_state_offset()));
    1.81      // Use T_BOOLEAN for InstanceKlass::_init_state so the compiler
    1.82      // can generate code to load it as unsigned byte.
    1.83 -    Node* inst = make_load(NULL, insp, TypeInt::UBYTE, T_BOOLEAN);
    1.84 +    Node* inst = make_load(NULL, insp, TypeInt::UBYTE, T_BOOLEAN, MemNode::unordered);
    1.85      Node* bits = intcon(InstanceKlass::fully_initialized);
    1.86      test = _gvn.transform(new (C) SubINode(inst, bits));
    1.87      // The 'test' is non-zero if we need to take a slow path.
    1.88 @@ -3176,14 +3177,14 @@
    1.89    kls = null_check(kls, T_OBJECT);
    1.90    ByteSize offset = TRACE_ID_OFFSET;
    1.91    Node* insp = basic_plus_adr(kls, in_bytes(offset));
    1.92 -  Node* tvalue = make_load(NULL, insp, TypeLong::LONG, T_LONG);
    1.93 +  Node* tvalue = make_load(NULL, insp, TypeLong::LONG, T_LONG, MemNode::unordered);
    1.94    Node* bits = longcon(~0x03l); // ignore bit 0 & 1
    1.95    Node* andl = _gvn.transform(new (C) AndLNode(tvalue, bits));
    1.96    Node* clsused = longcon(0x01l); // set the class bit
    1.97    Node* orl = _gvn.transform(new (C) OrLNode(tvalue, clsused));
    1.98  
    1.99    const TypePtr *adr_type = _gvn.type(insp)->isa_ptr();
   1.100 -  store_to_memory(control(), insp, orl, T_LONG, adr_type);
   1.101 +  store_to_memory(control(), insp, orl, T_LONG, adr_type, MemNode::unordered);
   1.102    set_result(andl);
   1.103    return true;
   1.104  }
   1.105 @@ -3192,15 +3193,15 @@
   1.106    Node* tls_ptr = NULL;
   1.107    Node* cur_thr = generate_current_thread(tls_ptr);
   1.108    Node* p = basic_plus_adr(top()/*!oop*/, tls_ptr, in_bytes(JavaThread::osthread_offset()));
   1.109 -  Node* osthread = make_load(NULL, p, TypeRawPtr::NOTNULL, T_ADDRESS);
   1.110 +  Node* osthread = make_load(NULL, p, TypeRawPtr::NOTNULL, T_ADDRESS, MemNode::unordered);
   1.111    p = basic_plus_adr(top()/*!oop*/, osthread, in_bytes(OSThread::thread_id_offset()));
   1.112  
   1.113    Node* threadid = NULL;
   1.114    size_t thread_id_size = OSThread::thread_id_size();
   1.115    if (thread_id_size == (size_t) BytesPerLong) {
   1.116 -    threadid = ConvL2I(make_load(control(), p, TypeLong::LONG, T_LONG));
   1.117 +    threadid = ConvL2I(make_load(control(), p, TypeLong::LONG, T_LONG, MemNode::unordered));
   1.118    } else if (thread_id_size == (size_t) BytesPerInt) {
   1.119 -    threadid = make_load(control(), p, TypeInt::INT, T_INT);
   1.120 +    threadid = make_load(control(), p, TypeInt::INT, T_INT, MemNode::unordered);
   1.121    } else {
   1.122      ShouldNotReachHere();
   1.123    }
   1.124 @@ -3275,11 +3276,11 @@
   1.125  
   1.126    // (b) Interrupt bit on TLS must be false.
   1.127    Node* p = basic_plus_adr(top()/*!oop*/, tls_ptr, in_bytes(JavaThread::osthread_offset()));
   1.128 -  Node* osthread = make_load(NULL, p, TypeRawPtr::NOTNULL, T_ADDRESS);
   1.129 +  Node* osthread = make_load(NULL, p, TypeRawPtr::NOTNULL, T_ADDRESS, MemNode::unordered);
   1.130    p = basic_plus_adr(top()/*!oop*/, osthread, in_bytes(OSThread::interrupted_offset()));
   1.131  
   1.132    // Set the control input on the field _interrupted read to prevent it floating up.
   1.133 -  Node* int_bit = make_load(control(), p, TypeInt::BOOL, T_INT);
   1.134 +  Node* int_bit = make_load(control(), p, TypeInt::BOOL, T_INT, MemNode::unordered);
   1.135    Node* cmp_bit = _gvn.transform(new (C) CmpINode(int_bit, intcon(0)));
   1.136    Node* bol_bit = _gvn.transform(new (C) BoolNode(cmp_bit, BoolTest::ne));
   1.137  
   1.138 @@ -3347,7 +3348,7 @@
   1.139  // Given a klass oop, load its java mirror (a java.lang.Class oop).
   1.140  Node* LibraryCallKit::load_mirror_from_klass(Node* klass) {
   1.141    Node* p = basic_plus_adr(klass, in_bytes(Klass::java_mirror_offset()));
   1.142 -  return make_load(NULL, p, TypeInstPtr::MIRROR, T_OBJECT);
   1.143 +  return make_load(NULL, p, TypeInstPtr::MIRROR, T_OBJECT, MemNode::unordered);
   1.144  }
   1.145  
   1.146  //-----------------------load_klass_from_mirror_common-------------------------
   1.147 @@ -3384,7 +3385,7 @@
   1.148    // Branch around if the given klass has the given modifier bit set.
   1.149    // Like generate_guard, adds a new path onto the region.
   1.150    Node* modp = basic_plus_adr(kls, in_bytes(Klass::access_flags_offset()));
   1.151 -  Node* mods = make_load(NULL, modp, TypeInt::INT, T_INT);
   1.152 +  Node* mods = make_load(NULL, modp, TypeInt::INT, T_INT, MemNode::unordered);
   1.153    Node* mask = intcon(modifier_mask);
   1.154    Node* bits = intcon(modifier_bits);
   1.155    Node* mbit = _gvn.transform(new (C) AndINode(mods, mask));
   1.156 @@ -3501,7 +3502,7 @@
   1.157  
   1.158    case vmIntrinsics::_getModifiers:
   1.159      p = basic_plus_adr(kls, in_bytes(Klass::modifier_flags_offset()));
   1.160 -    query_value = make_load(NULL, p, TypeInt::INT, T_INT);
   1.161 +    query_value = make_load(NULL, p, TypeInt::INT, T_INT, MemNode::unordered);
   1.162      break;
   1.163  
   1.164    case vmIntrinsics::_isInterface:
   1.165 @@ -3559,7 +3560,7 @@
   1.166        // Be sure to pin the oop load to the guard edge just created:
   1.167        Node* is_array_ctrl = region->in(region->req()-1);
   1.168        Node* cma = basic_plus_adr(kls, in_bytes(ArrayKlass::component_mirror_offset()));
   1.169 -      Node* cmo = make_load(is_array_ctrl, cma, TypeInstPtr::MIRROR, T_OBJECT);
   1.170 +      Node* cmo = make_load(is_array_ctrl, cma, TypeInstPtr::MIRROR, T_OBJECT, MemNode::unordered);
   1.171        phi->add_req(cmo);
   1.172      }
   1.173      query_value = null();  // non-array case is null
   1.174 @@ -3567,7 +3568,7 @@
   1.175  
   1.176    case vmIntrinsics::_getClassAccessFlags:
   1.177      p = basic_plus_adr(kls, in_bytes(Klass::access_flags_offset()));
   1.178 -    query_value = make_load(NULL, p, TypeInt::INT, T_INT);
   1.179 +    query_value = make_load(NULL, p, TypeInt::INT, T_INT, MemNode::unordered);
   1.180      break;
   1.181  
   1.182    default:
   1.183 @@ -3933,7 +3934,7 @@
   1.184                       vtable_index*vtableEntry::size()) * wordSize +
   1.185                       vtableEntry::method_offset_in_bytes();
   1.186    Node* entry_addr  = basic_plus_adr(obj_klass, entry_offset);
   1.187 -  Node* target_call = make_load(NULL, entry_addr, TypePtr::NOTNULL, T_ADDRESS);
   1.188 +  Node* target_call = make_load(NULL, entry_addr, TypePtr::NOTNULL, T_ADDRESS, MemNode::unordered);
   1.189  
   1.190    // Compare the target method with the expected method (e.g., Object.hashCode).
   1.191    const TypePtr* native_call_addr = TypeMetadataPtr::make(method);
   1.192 @@ -4059,7 +4060,7 @@
   1.193  
   1.194    // Get the header out of the object, use LoadMarkNode when available
   1.195    Node* header_addr = basic_plus_adr(obj, oopDesc::mark_offset_in_bytes());
   1.196 -  Node* header = make_load(control(), header_addr, TypeX_X, TypeX_X->basic_type());
   1.197 +  Node* header = make_load(control(), header_addr, TypeX_X, TypeX_X->basic_type(), MemNode::unordered);
   1.198  
   1.199    // Test the header to see if it is unlocked.
   1.200    Node *lock_mask      = _gvn.MakeConX(markOopDesc::biased_lock_mask_in_place);
   1.201 @@ -5480,7 +5481,7 @@
   1.202          // Store a zero to the immediately preceding jint:
   1.203          Node* x1 = _gvn.transform(new(C) AddXNode(start, MakeConX(-bump_bit)));
   1.204          Node* p1 = basic_plus_adr(dest, x1);
   1.205 -        mem = StoreNode::make(_gvn, control(), mem, p1, adr_type, intcon(0), T_INT);
   1.206 +        mem = StoreNode::make(_gvn, control(), mem, p1, adr_type, intcon(0), T_INT, MemNode::unordered);
   1.207          mem = _gvn.transform(mem);
   1.208        }
   1.209      }
   1.210 @@ -5530,8 +5531,8 @@
   1.211          ((src_off ^ dest_off) & (BytesPerLong-1)) == 0) {
   1.212        Node* sptr = basic_plus_adr(src,  src_off);
   1.213        Node* dptr = basic_plus_adr(dest, dest_off);
   1.214 -      Node* sval = make_load(control(), sptr, TypeInt::INT, T_INT, adr_type);
   1.215 -      store_to_memory(control(), dptr, sval, T_INT, adr_type);
   1.216 +      Node* sval = make_load(control(), sptr, TypeInt::INT, T_INT, adr_type, MemNode::unordered);
   1.217 +      store_to_memory(control(), dptr, sval, T_INT, adr_type, MemNode::unordered);
   1.218        src_off += BytesPerInt;
   1.219        dest_off += BytesPerInt;
   1.220      } else {
   1.221 @@ -5596,7 +5597,7 @@
   1.222    // super_check_offset, for the desired klass.
   1.223    int sco_offset = in_bytes(Klass::super_check_offset_offset());
   1.224    Node* p3 = basic_plus_adr(dest_elem_klass, sco_offset);
   1.225 -  Node* n3 = new(C) LoadINode(NULL, memory(p3), p3, _gvn.type(p3)->is_ptr());
   1.226 +  Node* n3 = new(C) LoadINode(NULL, memory(p3), p3, _gvn.type(p3)->is_ptr(), TypeInt::INT, MemNode::unordered);
   1.227    Node* check_offset = ConvI2X(_gvn.transform(n3));
   1.228    Node* check_value  = dest_elem_klass;
   1.229  
   1.230 @@ -5737,7 +5738,7 @@
   1.231    Node* base = makecon(TypeRawPtr::make(StubRoutines::crc_table_addr()));
   1.232    Node* offset = _gvn.transform(new (C) LShiftINode(result, intcon(0x2)));
   1.233    Node* adr = basic_plus_adr(top(), base, ConvI2X(offset));
   1.234 -  result = make_load(control(), adr, TypeInt::INT, T_INT);
   1.235 +  result = make_load(control(), adr, TypeInt::INT, T_INT, MemNode::unordered);
   1.236  
   1.237    crc = _gvn.transform(new (C) URShiftINode(crc, intcon(8)));
   1.238    result = _gvn.transform(new (C) XorINode(crc, result));
   1.239 @@ -5838,7 +5839,7 @@
   1.240    const TypeOopPtr* object_type = TypeOopPtr::make_from_klass(klass);
   1.241  
   1.242    Node* no_ctrl = NULL;
   1.243 -  Node* result = make_load(no_ctrl, adr, object_type, T_OBJECT);
   1.244 +  Node* result = make_load(no_ctrl, adr, object_type, T_OBJECT, MemNode::unordered);
   1.245  
   1.246    // Use the pre-barrier to record the value in the referent field
   1.247    pre_barrier(false /* do_load */,
   1.248 @@ -5885,7 +5886,7 @@
   1.249    const Type *type = TypeOopPtr::make_from_klass(field_klass->as_klass());
   1.250  
   1.251    // Build the load.
   1.252 -  Node* loadedField = make_load(NULL, adr, type, bt, adr_type, is_vol);
   1.253 +  Node* loadedField = make_load(NULL, adr, type, bt, adr_type, MemNode::unordered, is_vol);
   1.254    return loadedField;
   1.255  }
   1.256  

mercurial