8025004: -XX:+CheckUnhandledOops asserts for JDK 8 Solaris fastdebug binaries
Summary: Remove unnecessary volatile keyword on stack locals within instanceKlass.cpp to work around Solaris Studio C++ compiler issue
Reviewed-by: coleenp, dcubed
Contributed-by: lois.foltan@oracle.com
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp Thu Oct 03 12:39:58 2013 +0400
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Thu Oct 03 18:50:58 2013 -0400
@@ -456,14 +456,14 @@
return java_lang_Class::signers(java_mirror());
}
-volatile oop InstanceKlass::init_lock() const {
+oop InstanceKlass::init_lock() const {
// return the init lock from the mirror
return java_lang_Class::init_lock(java_mirror());
}
void InstanceKlass::eager_initialize_impl(instanceKlassHandle this_oop) {
EXCEPTION_MARK;
- volatile oop init_lock = this_oop->init_lock();
+ oop init_lock = this_oop->init_lock();
ObjectLocker ol(init_lock, THREAD);
// abort if someone beat us to the initialization
@@ -608,7 +608,7 @@
// verification & rewriting
{
- volatile oop init_lock = this_oop->init_lock();
+ oop init_lock = this_oop->init_lock();
ObjectLocker ol(init_lock, THREAD);
// rewritten will have been set if loader constraint error found
// on an earlier link attempt
@@ -731,7 +731,7 @@
// refer to the JVM book page 47 for description of steps
// Step 1
{
- volatile oop init_lock = this_oop->init_lock();
+ oop init_lock = this_oop->init_lock();
ObjectLocker ol(init_lock, THREAD);
Thread *self = THREAD; // it's passed the current thread
@@ -879,7 +879,7 @@
}
void InstanceKlass::set_initialization_state_and_notify_impl(instanceKlassHandle this_oop, ClassState state, TRAPS) {
- volatile oop init_lock = this_oop->init_lock();
+ oop init_lock = this_oop->init_lock();
ObjectLocker ol(init_lock, THREAD);
this_oop->set_init_state(state);
ol.notify_all(CHECK);
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp Thu Oct 03 12:39:58 2013 +0400
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp Thu Oct 03 18:50:58 2013 -0400
@@ -995,7 +995,7 @@
// Must be one per class and it has to be a VM internal object so java code
// cannot lock it (like the mirror).
// It has to be an object not a Mutex because it's held through java calls.
- volatile oop init_lock() const;
+ oop init_lock() const;
private:
// Static methods that are used to implement member methods where an exposed this pointer