< prev index next >
src/share/vm/runtime/biasedLocking.cpp
Print this page
*** 40,52 ****
BiasedLockingCounters BiasedLocking::_counters;
static GrowableArray<Handle>* _preserved_oop_stack = NULL;
static GrowableArray<markOop>* _preserved_mark_stack = NULL;
! static void enable_biased_locking(Klass* k) {
k->set_prototype_header(markOopDesc::biased_locking_prototype());
! }
class VM_EnableBiasedLocking: public VM_Operation {
private:
bool _is_cheap_allocated;
public:
--- 40,56 ----
BiasedLockingCounters BiasedLocking::_counters;
static GrowableArray<Handle>* _preserved_oop_stack = NULL;
static GrowableArray<markOop>* _preserved_mark_stack = NULL;
! class EnableBiasedLocking : public KlassClosure {
! void do_klass(Klass* k) {
! if (k->is_instance_klass()) {
k->set_prototype_header(markOopDesc::biased_locking_prototype());
! }
! }
! };
class VM_EnableBiasedLocking: public VM_Operation {
private:
bool _is_cheap_allocated;
public:
*** 56,66 ****
bool is_cheap_allocated() const { return _is_cheap_allocated; }
void doit() {
// Iterate the system dictionary enabling biased locking for all
// currently loaded classes
! SystemDictionary::classes_do(enable_biased_locking);
// Indicate that future instances should enable it as well
_biased_locking_enabled = true;
log_info(biasedlocking)("Biased locking enabled");
}
--- 60,71 ----
bool is_cheap_allocated() const { return _is_cheap_allocated; }
void doit() {
// Iterate the system dictionary enabling biased locking for all
// currently loaded classes
! EnableBiasedLocking enable_biased_locking;
! ClassLoaderDataGraph::loaded_classes_do(&enable_biased_locking);
// Indicate that future instances should enable it as well
_biased_locking_enabled = true;
log_info(biasedlocking)("Biased locking enabled");
}
< prev index next >