2299 case vmIntrinsics::_reverseBytes_s: n = new ReverseBytesSNode( 0, arg); break;
2300 case vmIntrinsics::_reverseBytes_i: n = new ReverseBytesINode( 0, arg); break;
2301 case vmIntrinsics::_reverseBytes_l: n = new ReverseBytesLNode( 0, arg); break;
2302 default: fatal_unexpected_iid(id); break;
2303 }
2304 set_result(_gvn.transform(n));
2305 return true;
2306 }
2307
2308 //----------------------------inline_unsafe_access----------------------------
2309
2310 // Helper that guards and inserts a pre-barrier.
2311 void LibraryCallKit::insert_pre_barrier(Node* base_oop, Node* offset,
2312 Node* pre_val, bool need_mem_bar) {
2313 // We could be accessing the referent field of a reference object. If so, when G1
2314 // is enabled, we need to log the value in the referent field in an SATB buffer.
2315 // This routine performs some compile time filters and generates suitable
2316 // runtime filters that guard the pre-barrier code.
2317 // Also add memory barrier for non volatile load from the referent field
2318 // to prevent commoning of loads across safepoint.
2319 if (!(UseG1GC || (UseShenandoahGC && (ShenandoahSATBBarrier || ShenandoahConditionalSATBBarrier))) && !need_mem_bar)
2320 return;
2321
2322 // Some compile time checks.
2323
2324 // If offset is a constant, is it java_lang_ref_Reference::_reference_offset?
2325 const TypeX* otype = offset->find_intptr_t_type();
2326 if (otype != NULL && otype->is_con() &&
2327 otype->get_con() != java_lang_ref_Reference::referent_offset) {
2328 // Constant offset but not the reference_offset so just return
2329 return;
2330 }
2331
2332 // We only need to generate the runtime guards for instances.
2333 const TypeOopPtr* btype = base_oop->bottom_type()->isa_oopptr();
2334 if (btype != NULL) {
2335 if (btype->isa_aryptr()) {
2336 // Array type so nothing to do
2337 return;
2338 }
2339
|
2299 case vmIntrinsics::_reverseBytes_s: n = new ReverseBytesSNode( 0, arg); break;
2300 case vmIntrinsics::_reverseBytes_i: n = new ReverseBytesINode( 0, arg); break;
2301 case vmIntrinsics::_reverseBytes_l: n = new ReverseBytesLNode( 0, arg); break;
2302 default: fatal_unexpected_iid(id); break;
2303 }
2304 set_result(_gvn.transform(n));
2305 return true;
2306 }
2307
2308 //----------------------------inline_unsafe_access----------------------------
2309
2310 // Helper that guards and inserts a pre-barrier.
2311 void LibraryCallKit::insert_pre_barrier(Node* base_oop, Node* offset,
2312 Node* pre_val, bool need_mem_bar) {
2313 // We could be accessing the referent field of a reference object. If so, when G1
2314 // is enabled, we need to log the value in the referent field in an SATB buffer.
2315 // This routine performs some compile time filters and generates suitable
2316 // runtime filters that guard the pre-barrier code.
2317 // Also add memory barrier for non volatile load from the referent field
2318 // to prevent commoning of loads across safepoint.
2319 if (!(UseG1GC || (UseShenandoahGC && ShenandoahSATBBarrier)) && !need_mem_bar)
2320 return;
2321
2322 // Some compile time checks.
2323
2324 // If offset is a constant, is it java_lang_ref_Reference::_reference_offset?
2325 const TypeX* otype = offset->find_intptr_t_type();
2326 if (otype != NULL && otype->is_con() &&
2327 otype->get_con() != java_lang_ref_Reference::referent_offset) {
2328 // Constant offset but not the reference_offset so just return
2329 return;
2330 }
2331
2332 // We only need to generate the runtime guards for instances.
2333 const TypeOopPtr* btype = base_oop->bottom_type()->isa_oopptr();
2334 if (btype != NULL) {
2335 if (btype->isa_aryptr()) {
2336 // Array type so nothing to do
2337 return;
2338 }
2339
|