Mercurial > hg > truffle
comparison src/share/vm/prims/unsafe.cpp @ 4043:12d38ffcba2a
7094138: JSR 292: JRuby junit test fails in CallSite.setTargetNormal: obj->is_oop() failed: sanity check
Reviewed-by: iveresov, never
author | twisti |
---|---|
date | Tue, 25 Oct 2011 00:55:10 -0700 |
parents | 436b4a3231bf |
children | d2a62e0f25eb 56c4f88474b3 |
comparison
equal
deleted
inserted
replaced
4042:b20d64f83668 | 4043:12d38ffcba2a |
---|---|
300 return JNIHandles::make_local(env, v); | 300 return JNIHandles::make_local(env, v); |
301 UNSAFE_END | 301 UNSAFE_END |
302 | 302 |
303 UNSAFE_ENTRY(void, Unsafe_SetObjectVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) | 303 UNSAFE_ENTRY(void, Unsafe_SetObjectVolatile(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jobject x_h)) |
304 UnsafeWrapper("Unsafe_SetObjectVolatile"); | 304 UnsafeWrapper("Unsafe_SetObjectVolatile"); |
305 { | |
306 // Catch VolatileCallSite.target stores (via | |
307 // CallSite.setTargetVolatile) and check call site dependencies. | |
308 oop p = JNIHandles::resolve(obj); | |
309 if ((offset == java_lang_invoke_CallSite::target_offset_in_bytes()) && p->is_a(SystemDictionary::CallSite_klass())) { | |
310 Handle call_site (THREAD, p); | |
311 Handle method_handle(THREAD, JNIHandles::resolve(x_h)); | |
312 assert(call_site ->is_a(SystemDictionary::CallSite_klass()), "must be"); | |
313 assert(method_handle->is_a(SystemDictionary::MethodHandle_klass()), "must be"); | |
314 { | |
315 // Walk all nmethods depending on this call site. | |
316 MutexLocker mu(Compile_lock, thread); | |
317 Universe::flush_dependents_on(call_site(), method_handle()); | |
318 } | |
319 } | |
320 } | |
305 oop x = JNIHandles::resolve(x_h); | 321 oop x = JNIHandles::resolve(x_h); |
306 oop p = JNIHandles::resolve(obj); | 322 oop p = JNIHandles::resolve(obj); |
307 // Catch VolatileCallSite.target stores (via | |
308 // CallSite.setTargetVolatile) and check call site dependencies. | |
309 if ((offset == java_lang_invoke_CallSite::target_offset_in_bytes()) && p->is_a(SystemDictionary::CallSite_klass())) { | |
310 oop call_site = p; | |
311 oop method_handle = x; | |
312 assert(call_site ->is_a(SystemDictionary::CallSite_klass()), "must be"); | |
313 assert(method_handle->is_a(SystemDictionary::MethodHandle_klass()), "must be"); | |
314 { | |
315 // Walk all nmethods depending on this call site. | |
316 MutexLocker mu(Compile_lock, thread); | |
317 Universe::flush_dependents_on(call_site, method_handle); | |
318 } | |
319 } | |
320 void* addr = index_oop_from_field_offset_long(p, offset); | 323 void* addr = index_oop_from_field_offset_long(p, offset); |
321 OrderAccess::release(); | 324 OrderAccess::release(); |
322 if (UseCompressedOops) { | 325 if (UseCompressedOops) { |
323 oop_store((narrowOop*)addr, x); | 326 oop_store((narrowOop*)addr, x); |
324 } else { | 327 } else { |