src/share/vm/opto/library_call.cpp

Print this page
rev 10065 : 8147844: new method j.l.Runtime.onSpinWait() and the corresponding x86 hotspot instrinsic
Summary: adds c1 & c2 x86 intrinsics for j.l.Runtime.onSpinWait() that utilize the 'pause' instruction
Contributed-by: ikrylov, ygaevsky
Reviewed-by: iveresov, vlivanov, kvn

*** 276,285 **** --- 276,286 ---- typedef enum { LS_xadd, LS_xchg, LS_cmpxchg } LoadStoreKind; bool inline_unsafe_load_store(BasicType type, LoadStoreKind kind); bool inline_unsafe_ordered_store(BasicType type); bool inline_unsafe_fence(vmIntrinsics::ID id); + bool inline_onspinwait(); bool inline_fp_conversions(vmIntrinsics::ID id); bool inline_number_methods(vmIntrinsics::ID id); bool inline_reference_get(); bool inline_Class_cast(); bool inline_aescrypt_Block(vmIntrinsics::ID id);
*** 636,645 **** --- 637,648 ---- case vmIntrinsics::_loadFence: case vmIntrinsics::_storeFence: case vmIntrinsics::_fullFence: return inline_unsafe_fence(intrinsic_id()); + case vmIntrinsics::_onSpinWait: return inline_onspinwait(); + case vmIntrinsics::_currentThread: return inline_native_currentThread(); case vmIntrinsics::_isInterrupted: return inline_native_isInterrupted(); #ifdef TRACE_HAVE_INTRINSICS case vmIntrinsics::_classID: return inline_native_classID();
*** 2885,2894 **** --- 2888,2902 ---- fatal_unexpected_iid(id); return false; } } + bool LibraryCallKit::inline_onspinwait() { + insert_mem_bar(Op_OnSpinWait); + return true; + } + bool LibraryCallKit::klass_needs_init_guard(Node* kls) { if (!kls->is_Con()) { return true; } const TypeKlassPtr* klsptr = kls->bottom_type()->isa_klassptr();