65 // Resolve handle into oop
66 inline static oop resolve(jobject handle);
67 // Resolve externally provided handle into oop with some guards
68 inline static oop resolve_external_guard(jobject handle);
69 // Resolve handle into oop, result guaranteed not to be null
70 inline static oop resolve_non_null(jobject handle);
71
72 // Local handles
73 static jobject make_local(oop obj);
74 static jobject make_local(JNIEnv* env, oop obj); // Fast version when env is known
75 static jobject make_local(Thread* thread, oop obj); // Even faster version when current thread is known
76 inline static void destroy_local(jobject handle);
77
78 // Global handles
79 static jobject make_global(Handle obj);
80 static void destroy_global(jobject handle);
81
82 // Weak global handles
83 static jobject make_weak_global(Handle obj);
84 static void destroy_weak_global(jobject handle);
85
86 // Sentinel marking deleted handles in block. Note that we cannot store NULL as
87 // the sentinel, since clearing weak global JNI refs are done by storing NULL in
88 // the handle. The handle may not be reused before destroy_weak_global is called.
89 static oop deleted_handle() { return _deleted_handle; }
90
91 // Initialization
92 static void initialize();
93
94 // Debugging
95 static void print_on(outputStream* st);
96 static void print() { print_on(tty); }
97 static void verify();
98 static bool is_local_handle(Thread* thread, jobject handle);
99 static bool is_frame_handle(JavaThread* thr, jobject obj);
100 static bool is_global_handle(jobject handle);
101 static bool is_weak_global_handle(jobject handle);
102 static long global_handle_memory_usage();
103 static long weak_global_handle_memory_usage();
104
|
65 // Resolve handle into oop
66 inline static oop resolve(jobject handle);
67 // Resolve externally provided handle into oop with some guards
68 inline static oop resolve_external_guard(jobject handle);
69 // Resolve handle into oop, result guaranteed not to be null
70 inline static oop resolve_non_null(jobject handle);
71
72 // Local handles
73 static jobject make_local(oop obj);
74 static jobject make_local(JNIEnv* env, oop obj); // Fast version when env is known
75 static jobject make_local(Thread* thread, oop obj); // Even faster version when current thread is known
76 inline static void destroy_local(jobject handle);
77
78 // Global handles
79 static jobject make_global(Handle obj);
80 static void destroy_global(jobject handle);
81
82 // Weak global handles
83 static jobject make_weak_global(Handle obj);
84 static void destroy_weak_global(jobject handle);
85 static bool is_global_weak_cleared(jweak handle); // Test jweak without resolution
86
87 // Sentinel marking deleted handles in block. Note that we cannot store NULL as
88 // the sentinel, since clearing weak global JNI refs are done by storing NULL in
89 // the handle. The handle may not be reused before destroy_weak_global is called.
90 static oop deleted_handle() { return _deleted_handle; }
91
92 // Initialization
93 static void initialize();
94
95 // Debugging
96 static void print_on(outputStream* st);
97 static void print() { print_on(tty); }
98 static void verify();
99 static bool is_local_handle(Thread* thread, jobject handle);
100 static bool is_frame_handle(JavaThread* thr, jobject obj);
101 static bool is_global_handle(jobject handle);
102 static bool is_weak_global_handle(jobject handle);
103 static long global_handle_memory_usage();
104 static long weak_global_handle_memory_usage();
105
|