Mercurial > hg > truffle
comparison src/share/vm/prims/unsafe.cpp @ 3901:aa67216400d3
7085404: JSR 292: VolatileCallSites should have push notification too
Reviewed-by: never, kvn
author | twisti |
---|---|
date | Fri, 02 Sep 2011 00:36:18 -0700 |
parents | 19241ae0d839 |
children | e6b1331a51d2 |
comparison
equal
deleted
inserted
replaced
3900:a32de5085326 | 3901:aa67216400d3 |
---|---|
300 | 300 |
301 UNSAFE_ENTRY(void, Unsafe_SetObjectVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) | 301 UNSAFE_ENTRY(void, Unsafe_SetObjectVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) |
302 UnsafeWrapper("Unsafe_SetObjectVolatile"); | 302 UnsafeWrapper("Unsafe_SetObjectVolatile"); |
303 oop x = JNIHandles::resolve(x_h); | 303 oop x = JNIHandles::resolve(x_h); |
304 oop p = JNIHandles::resolve(obj); | 304 oop p = JNIHandles::resolve(obj); |
305 // Catch VolatileCallSite.target stores (via | |
306 // CallSite.setTargetVolatile) and check call site dependencies. | |
307 if ((offset == java_lang_invoke_CallSite::target_offset_in_bytes()) && p->is_a(SystemDictionary::CallSite_klass())) { | |
308 oop call_site = p; | |
309 oop method_handle = x; | |
310 assert(call_site ->is_a(SystemDictionary::CallSite_klass()), "must be"); | |
311 assert(method_handle->is_a(SystemDictionary::MethodHandle_klass()), "must be"); | |
312 { | |
313 // Walk all nmethods depending on this call site. | |
314 MutexLocker mu(Compile_lock, thread); | |
315 Universe::flush_dependents_on(call_site, method_handle); | |
316 } | |
317 } | |
305 void* addr = index_oop_from_field_offset_long(p, offset); | 318 void* addr = index_oop_from_field_offset_long(p, offset); |
306 OrderAccess::release(); | 319 OrderAccess::release(); |
307 if (UseCompressedOops) { | 320 if (UseCompressedOops) { |
308 oop_store((narrowOop*)addr, x); | 321 oop_store((narrowOop*)addr, x); |
309 } else { | 322 } else { |