diff 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
line wrap: on
line diff
--- a/src/share/vm/runtime/sharedRuntime.cpp	Thu Aug 20 21:56:50 2015 +0200
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Thu Aug 20 22:57:39 2015 +0200
@@ -1014,6 +1014,11 @@
 
 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj))
 #if INCLUDE_JVMCI
+  // This removes the requirement for JVMCI compilers to emit code
+  // performing a dynamic check that obj has a finalizer before
+  // calling this routine. There should be no performance impact
+  // for C1 since it emits a dynamic check. C2 and the interpreter
+  // uses other runtime routines for registering finalizers.
   if (!obj->klass()->has_finalizer()) {
     return;
   }