equal
deleted
inserted
replaced
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"); |