comparison src/share/vm/runtime/sharedRuntime.cpp @ 22442:7eda81bed2f3

added comment explaining why SharedRuntime::register_finalizer performs a dynamic check that an object has a finalizer
author Doug Simon <doug.simon@oracle.com>
date Thu, 20 Aug 2015 22:57:39 +0200
parents c28cb37b2e1d
children d77654050ba4
comparison
equal deleted inserted replaced
22441:fd3d534aecca 22442:7eda81bed2f3
1012 JRT_END 1012 JRT_END
1013 1013
1014 1014
1015 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj)) 1015 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj))
1016 #if INCLUDE_JVMCI 1016 #if INCLUDE_JVMCI
1017 // This removes the requirement for JVMCI compilers to emit code
1018 // performing a dynamic check that obj has a finalizer before
1019 // calling this routine. There should be no performance impact
1020 // for C1 since it emits a dynamic check. C2 and the interpreter
1021 // uses other runtime routines for registering finalizers.
1017 if (!obj->klass()->has_finalizer()) { 1022 if (!obj->klass()->has_finalizer()) {
1018 return; 1023 return;
1019 } 1024 }
1020 #endif 1025 #endif
1021 assert(obj->is_oop(), "must be a valid oop"); 1026 assert(obj->is_oop(), "must be a valid oop");