RFR: 8188055: (ref) Add Reference.refersTo predicate

Aleksey Shipilev shade at redhat.com
Wed Apr 8 09:44:10 UTC 2020


On 4/8/20 2:25 AM, Kim Barrett wrote:
> Webrev:
> https://cr.openjdk.java.net/~kbarrett/8188055/open.04/

src/hotspot/share/prims/jvm.cpp:

 *) Do we really need a typedef (L3250) for something that is used once at L3253?

3248 JVM_ENTRY(jboolean, JVM_ReferenceRefersTo(JNIEnv* env, jobject ref, jobject o))
3249   JVMWrapper("JVM_ReferenceRefersTo");
3250   typedef HeapAccess<ON_UNKNOWN_OOP_REF | AS_NO_KEEPALIVE> ReferentAccess;
3251   const int referent_offset = java_lang_ref_Reference::referent_offset;
3252   oop ref_oop = JNIHandles::resolve_non_null(ref);
3253   oop referent = ReferentAccess::oop_load_at(ref_oop, referent_offset);
3254   return referent == JNIHandles::resolve(o);
3255 JVM_END

 *) Double new-line:

3256
3257

test/hotspot/jtreg/gc/TestReferenceRefersTo.java:

*) Typo, "unex[p]ected":

 134                 fail(which + " refers to unexected value");

Otherwise seems fine.

-- 
Thanks,
-Aleksey




More information about the hotspot-gc-dev mailing list