Does 'intrinsify' means that source code of JVM is somewhat 'conservative', but the JIT compiler can do some optimization when the JVM warms up? For example,
UNSAFE_ENTRY(void, Unsafe_SetOrderedObject(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h))
UnsafeWrapper("Unsafe_SetOrderedObject");
oop x = JNIHandles::resolve(x_h);
oop p = JNIHandles::resolve(obj);
void* addr = index_oop_from_field_offset_long(p, offset);
OrderAccess::release();
if (UseCompressedOops) {
oop_store((narrowOop*)addr, x);
} else {
oop_store((oop*)addr, x);
}
OrderAccess::fence(); <==There is a full memory barrier to ensure visibility which is NOT strictly required
UNSAFE_END
the putOrderedObject is not required to ensure immediate visiblity
, but we can see that there is a full memory barrier attached the store to a specified object, so I said the JVM is conservative
, but a JIT compiler can optimize this memory barrier out during runtime, this is what so called instrinsify
, am I right?