159 static int* slow_path_entry_count_addr();
160
161 enum Condition {
162 NOT_REVOKED = 0,
163 NOT_BIASED = 1,
164 BIAS_REVOKED = 2,
165 BIAS_REVOKED_AND_REBIASED = 3
166 };
167
168 // This initialization routine should only be called once and
169 // schedules a PeriodicTask to turn on biased locking a few seconds
170 // into the VM run to avoid startup time regressions
171 static void init();
172
173 // This provides a global switch for leaving biased locking disabled
174 // for the first part of a run and enabling it later
175 static bool enabled();
176
177 // This should be called by JavaThreads to revoke the bias of an object
178 static Condition revoke_and_rebias(Handle obj, bool attempt_rebias, TRAPS);
179 static Condition revoke_and_rebias_in_handshake(Handle obj, TRAPS);
180
181 // These do not allow rebiasing; they are used by deoptimization to
182 // ensure that monitors on the stack can be migrated
183 static void revoke(GrowableArray<Handle>* objs);
184 static void revoke_at_safepoint(Handle obj);
185 static void revoke_at_safepoint(GrowableArray<Handle>* objs);
186
187 static void print_counters() { _counters.print(); }
188 static BiasedLockingCounters* counters() { return &_counters; }
189
190 // These routines are GC-related and should not be called by end
191 // users. GCs which do not do preservation of mark words do not need
192 // to call these routines.
193 static void preserve_marks();
194 static void restore_marks();
195 };
196
197 #endif // SHARE_RUNTIME_BIASEDLOCKING_HPP
|
159 static int* slow_path_entry_count_addr();
160
161 enum Condition {
162 NOT_REVOKED = 0,
163 NOT_BIASED = 1,
164 BIAS_REVOKED = 2,
165 BIAS_REVOKED_AND_REBIASED = 3
166 };
167
168 // This initialization routine should only be called once and
169 // schedules a PeriodicTask to turn on biased locking a few seconds
170 // into the VM run to avoid startup time regressions
171 static void init();
172
173 // This provides a global switch for leaving biased locking disabled
174 // for the first part of a run and enabling it later
175 static bool enabled();
176
177 // This should be called by JavaThreads to revoke the bias of an object
178 static Condition revoke_and_rebias(Handle obj, bool attempt_rebias, TRAPS);
179 static Condition revoke_own_locks_in_handshake(Handle obj, TRAPS);
180
181 // These do not allow rebiasing; they are used by deoptimization to
182 // ensure that monitors on the stack can be migrated
183 static void revoke(GrowableArray<Handle>* objs);
184 static void revoke_at_safepoint(Handle obj);
185 static void revoke_at_safepoint(GrowableArray<Handle>* objs);
186
187 static void print_counters() { _counters.print(); }
188 static BiasedLockingCounters* counters() { return &_counters; }
189
190 // These routines are GC-related and should not be called by end
191 // users. GCs which do not do preservation of mark words do not need
192 // to call these routines.
193 static void preserve_marks();
194 static void restore_marks();
195 };
196
197 #endif // SHARE_RUNTIME_BIASEDLOCKING_HPP
|