hotspot/src/share/vm/oops/method.cpp
changeset 27247 99db666dbe8e
parent 26799 0c349e16bbe8
child 27450 603dbcf4f547
child 27461 90e9e0f9c0c5
--- a/hotspot/src/share/vm/oops/method.cpp	Tue Oct 14 20:35:45 2014 +0000
+++ b/hotspot/src/share/vm/oops/method.cpp	Thu Oct 02 10:55:36 2014 +0200
@@ -1862,9 +1862,12 @@
 void Method::set_on_stack(const bool value) {
   // Set both the method itself and its constant pool.  The constant pool
   // on stack means some method referring to it is also on the stack.
-  _access_flags.set_on_stack(value);
   constants()->set_on_stack(value);
-  if (value) MetadataOnStackMark::record(this);
+
+  bool succeeded = _access_flags.set_on_stack(value);
+  if (value && succeeded) {
+    MetadataOnStackMark::record(this, Thread::current());
+  }
 }
 
 // Called when the class loader is unloaded to make all methods weak.