111
112 // Returns the identity hash value for an oop
113 // NOTE: It may cause monitor inflation
114 static intptr_t identity_hash_value_for(Handle obj);
115 static intptr_t FastHashCode(Thread * Self, oop obj);
116
117 // java.lang.Thread support
118 static bool current_thread_holds_lock(JavaThread* thread, Handle h_obj);
119 static LockOwnership query_lock_ownership(JavaThread * self, Handle h_obj);
120
121 static JavaThread* get_lock_owner(Handle h_obj, bool doLock);
122
123 // JNI detach support
124 static void release_monitors_owned_by_thread(TRAPS);
125 static void monitors_iterate(MonitorClosure* m);
126
127 // GC: we current use aggressive monitor deflation policy
128 // Basically we deflate all monitors that are not busy.
129 // An adaptive profile-based deflation policy could be used if needed
130 static void deflate_idle_monitors();
131 // For a given monitor list: global or per-thread, deflate idle monitors
132 static int deflate_monitor_list(ObjectMonitor** listheadp,
133 ObjectMonitor** freeHeadp,
134 ObjectMonitor** freeTailp);
135 static bool deflate_monitor(ObjectMonitor* mid, oop obj,
136 ObjectMonitor** freeHeadp,
137 ObjectMonitor** freeTailp);
138 static void oops_do(OopClosure* f);
139 // Process oops in thread local used monitors
140 static void thread_local_used_oops_do(Thread* thread, OopClosure* f);
141
142 // debugging
143 static void sanity_checks(const bool verbose,
144 const unsigned int cache_line_size,
145 int *error_cnt_ptr, int *warning_cnt_ptr);
146 static int verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
147
148 private:
149 enum { _BLOCKSIZE = 128 };
150 // global list of blocks of monitors
|
111
112 // Returns the identity hash value for an oop
113 // NOTE: It may cause monitor inflation
114 static intptr_t identity_hash_value_for(Handle obj);
115 static intptr_t FastHashCode(Thread * Self, oop obj);
116
117 // java.lang.Thread support
118 static bool current_thread_holds_lock(JavaThread* thread, Handle h_obj);
119 static LockOwnership query_lock_ownership(JavaThread * self, Handle h_obj);
120
121 static JavaThread* get_lock_owner(Handle h_obj, bool doLock);
122
123 // JNI detach support
124 static void release_monitors_owned_by_thread(TRAPS);
125 static void monitors_iterate(MonitorClosure* m);
126
127 // GC: we current use aggressive monitor deflation policy
128 // Basically we deflate all monitors that are not busy.
129 // An adaptive profile-based deflation policy could be used if needed
130 static void deflate_idle_monitors();
131 static void deflate_thread_local_monitors(Thread* thread);
132
133 // For a given monitor list: global or per-thread, deflate idle monitors
134 static int deflate_monitor_list(ObjectMonitor** listheadp,
135 ObjectMonitor** freeHeadp,
136 ObjectMonitor** freeTailp);
137 static bool deflate_monitor(ObjectMonitor* mid, oop obj,
138 ObjectMonitor** freeHeadp,
139 ObjectMonitor** freeTailp);
140 static void oops_do(OopClosure* f);
141 // Process oops in thread local used monitors
142 static void thread_local_used_oops_do(Thread* thread, OopClosure* f);
143
144 // debugging
145 static void sanity_checks(const bool verbose,
146 const unsigned int cache_line_size,
147 int *error_cnt_ptr, int *warning_cnt_ptr);
148 static int verify_objmon_isinpool(ObjectMonitor *addr) PRODUCT_RETURN0;
149
150 private:
151 enum { _BLOCKSIZE = 128 };
152 // global list of blocks of monitors
|