diff src/share/vm/ci/ciObject.cpp @ 1478:5571b97fc1ec

More JNI global handle clean ups.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Fri, 26 Nov 2010 19:45:05 +0100
parents 3483ec571caf
children 2d26b0046e0d
line wrap: on
line diff
--- a/src/share/vm/ci/ciObject.cpp	Fri Nov 26 13:52:15 2010 +0100
+++ b/src/share/vm/ci/ciObject.cpp	Fri Nov 26 19:45:05 2010 +0100
@@ -48,14 +48,20 @@
 // ciObject::ciObject
 ciObject::ciObject(oop o) {
   ASSERT_IN_VM;
-  if (ciObjectFactory::is_initialized() && !UseC1X) {
-    _handle = JNIHandles::make_local(o);
+  if (ciObjectFactory::is_initialized()) {
+    if (UseC1X) {
+      _handle = JNIHandles::make_global(o);
+      _temp_global = true;
+    } else {
+      _handle = JNIHandles::make_local(o);
+    }
   } else {
     _handle = JNIHandles::make_global(o);
   }
   _klass = NULL;
   _ident = 0;
   init_flags_from(o);
+  _temp_global = false;
 }
 
 // ------------------------------------------------------------------
@@ -63,14 +69,20 @@
 //
 ciObject::ciObject(Handle h) {
   ASSERT_IN_VM;
-  if (ciObjectFactory::is_initialized() && !UseC1X) {
-    _handle = JNIHandles::make_local(h());
+  if (ciObjectFactory::is_initialized()) {
+    if (UseC1X) {
+      _handle = JNIHandles::make_global(h);
+      _temp_global = true;
+    } else {
+      _handle = JNIHandles::make_local(h());
+    }
   } else {
     _handle = JNIHandles::make_global(h);
   }
   _klass = NULL;
   _ident = 0;
   init_flags_from(h());
+  _temp_global = false;
 }
 
 // ------------------------------------------------------------------
@@ -84,6 +96,7 @@
   _handle = NULL;
   _klass = klass;
   _ident = 0;
+  _temp_global = false;
 }
 
 // ------------------------------------------------------------------
@@ -95,6 +108,7 @@
   _handle = NULL;
   _klass = NULL;
   _ident = 0;
+  _temp_global = false;
 }
 
 // ------------------------------------------------------------------