comparison src/share/vm/runtime/jniHandles.cpp @ 1616:38e8278318ca

6656830: assert((*p)->is_oop(),"expected an oop while scanning weak refs") Reviewed-by: dcubed, kvn, twisti
author never
date Mon, 21 Jun 2010 14:26:17 -0700
parents c18cbe5936b8
children f95d63e2154a
comparison
equal deleted inserted replaced
1615:ff38d05ea86f 1616:38e8278318ca
64 } 64 }
65 } 65 }
66 66
67 67
68 jobject JNIHandles::make_global(Handle obj) { 68 jobject JNIHandles::make_global(Handle obj) {
69 assert(!Universe::heap()->is_gc_active(), "can't extend the root set during GC");
69 jobject res = NULL; 70 jobject res = NULL;
70 if (!obj.is_null()) { 71 if (!obj.is_null()) {
71 // ignore null handles 72 // ignore null handles
72 MutexLocker ml(JNIGlobalHandle_lock); 73 MutexLocker ml(JNIGlobalHandle_lock);
73 assert(Universe::heap()->is_in_reserved(obj()), "sanity check"); 74 assert(Universe::heap()->is_in_reserved(obj()), "sanity check");
79 return res; 80 return res;
80 } 81 }
81 82
82 83
83 jobject JNIHandles::make_weak_global(Handle obj) { 84 jobject JNIHandles::make_weak_global(Handle obj) {
85 assert(!Universe::heap()->is_gc_active(), "can't extend the root set during GC");
84 jobject res = NULL; 86 jobject res = NULL;
85 if (!obj.is_null()) { 87 if (!obj.is_null()) {
86 // ignore null handles 88 // ignore null handles
87 MutexLocker ml(JNIGlobalHandle_lock); 89 MutexLocker ml(JNIGlobalHandle_lock);
88 assert(Universe::heap()->is_in_reserved(obj()), "sanity check"); 90 assert(Universe::heap()->is_in_reserved(obj()), "sanity check");