comparison src/share/vm/runtime/sharedRuntime.cpp @ 22525:d77654050ba4

Move assert in SharedRuntime::register_finalizer.
author twisti
date Wed, 02 Sep 2015 12:51:21 -1000
parents 7eda81bed2f3
children 0251714a52fe
comparison
equal deleted inserted replaced
22524:ce7078904238 22525:d77654050ba4
1011 os::yield_all(attempts); 1011 os::yield_all(attempts);
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 assert(obj->is_oop(), "must be a valid oop");
1016 #if INCLUDE_JVMCI 1017 #if INCLUDE_JVMCI
1017 // This removes the requirement for JVMCI compilers to emit code 1018 // This removes the requirement for JVMCI compilers to emit code
1018 // performing a dynamic check that obj has a finalizer before 1019 // performing a dynamic check that obj has a finalizer before
1019 // calling this routine. There should be no performance impact 1020 // calling this routine. There should be no performance impact
1020 // for C1 since it emits a dynamic check. C2 and the interpreter 1021 // for C1 since it emits a dynamic check. C2 and the interpreter
1021 // uses other runtime routines for registering finalizers. 1022 // uses other runtime routines for registering finalizers.
1022 if (!obj->klass()->has_finalizer()) { 1023 if (!obj->klass()->has_finalizer()) {
1023 return; 1024 return;
1024 } 1025 }
1025 #endif 1026 #endif
1026 assert(obj->is_oop(), "must be a valid oop");
1027 assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise"); 1027 assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise");
1028 InstanceKlass::register_finalizer(instanceOop(obj), CHECK); 1028 InstanceKlass::register_finalizer(instanceOop(obj), CHECK);
1029 JRT_END 1029 JRT_END
1030 1030
1031 1031