1.1 --- a/src/share/vm/opto/library_call.cpp Tue May 20 06:32:58 2008 -0700 1.2 +++ b/src/share/vm/opto/library_call.cpp Wed May 21 10:45:07 2008 -0700 1.3 @@ -2168,7 +2168,7 @@ 1.4 // (They don't if CAS fails, but it isn't worth checking.) 1.5 pre_barrier(control(), base, adr, alias_idx, newval, value_type, T_OBJECT); 1.6 #ifdef _LP64 1.7 - if (adr->bottom_type()->is_narrow()) { 1.8 + if (adr->bottom_type()->is_ptr_to_narrowoop()) { 1.9 cas = _gvn.transform(new (C, 5) CompareAndSwapNNode(control(), mem, adr, 1.10 EncodePNode::encode(&_gvn, newval), 1.11 EncodePNode::encode(&_gvn, oldval))); 1.12 @@ -2838,6 +2838,8 @@ 1.13 _sp += nargs; // set original stack for use by uncommon_trap 1.14 mirror = do_null_check(mirror, T_OBJECT); 1.15 _sp -= nargs; 1.16 + // If mirror or obj is dead, only null-path is taken. 1.17 + if (stopped()) return true; 1.18 1.19 enum { _normal_path = 1, _slow_path = 2, PATH_LIMIT }; 1.20 RegionNode* result_reg = new(C, PATH_LIMIT) RegionNode(PATH_LIMIT); 1.21 @@ -3827,24 +3829,22 @@ 1.22 if (!stopped()) { 1.23 // Copy the fastest available way. 1.24 // (No need for PreserveJVMState, since we're using it all up now.) 1.25 + // TODO: generate fields/elements copies for small objects instead. 1.26 Node* src = obj; 1.27 Node* dest = raw_obj; 1.28 - Node* end = dest; 1.29 Node* size = _gvn.transform(alloc_siz); 1.30 1.31 // Exclude the header. 1.32 int base_off = instanceOopDesc::base_offset_in_bytes(); 1.33 if (UseCompressedOops) { 1.34 - // copy the header gap though. 1.35 - Node* sptr = basic_plus_adr(src, base_off); 1.36 - Node* dptr = basic_plus_adr(dest, base_off); 1.37 - Node* sval = make_load(control(), sptr, TypeInt::INT, T_INT, raw_adr_type); 1.38 - store_to_memory(control(), dptr, sval, T_INT, raw_adr_type); 1.39 - base_off += sizeof(int); 1.40 + assert(base_off % BytesPerLong != 0, "base with compressed oops"); 1.41 + // With compressed oops base_offset_in_bytes is 12 which creates 1.42 + // the gap since countx is rounded by 8 bytes below. 1.43 + // Copy klass and the gap. 1.44 + base_off = instanceOopDesc::klass_offset_in_bytes(); 1.45 } 1.46 src = basic_plus_adr(src, base_off); 1.47 dest = basic_plus_adr(dest, base_off); 1.48 - end = basic_plus_adr(end, size); 1.49 1.50 // Compute the length also, if needed: 1.51 Node* countx = size;