equal
deleted
inserted
replaced
40 BiasedLockingCounters BiasedLocking::_counters; |
40 BiasedLockingCounters BiasedLocking::_counters; |
41 |
41 |
42 static GrowableArray<Handle>* _preserved_oop_stack = NULL; |
42 static GrowableArray<Handle>* _preserved_oop_stack = NULL; |
43 static GrowableArray<markOop>* _preserved_mark_stack = NULL; |
43 static GrowableArray<markOop>* _preserved_mark_stack = NULL; |
44 |
44 |
45 static void enable_biased_locking(Klass* k) { |
45 static void enable_biased_locking(InstanceKlass* k) { |
46 k->set_prototype_header(markOopDesc::biased_locking_prototype()); |
46 k->set_prototype_header(markOopDesc::biased_locking_prototype()); |
47 } |
47 } |
48 |
48 |
49 class VM_EnableBiasedLocking: public VM_Operation { |
49 class VM_EnableBiasedLocking: public VM_Operation { |
50 private: |
50 private: |
54 VMOp_Type type() const { return VMOp_EnableBiasedLocking; } |
54 VMOp_Type type() const { return VMOp_EnableBiasedLocking; } |
55 Mode evaluation_mode() const { return _is_cheap_allocated ? _async_safepoint : _safepoint; } |
55 Mode evaluation_mode() const { return _is_cheap_allocated ? _async_safepoint : _safepoint; } |
56 bool is_cheap_allocated() const { return _is_cheap_allocated; } |
56 bool is_cheap_allocated() const { return _is_cheap_allocated; } |
57 |
57 |
58 void doit() { |
58 void doit() { |
59 // Iterate the system dictionary enabling biased locking for all |
59 // Iterate the class loader data dictionaries enabling biased locking for all |
60 // currently loaded classes |
60 // currently loaded classes. |
61 SystemDictionary::classes_do(enable_biased_locking); |
61 ClassLoaderDataGraph::dictionary_classes_do(enable_biased_locking); |
62 // Indicate that future instances should enable it as well |
62 // Indicate that future instances should enable it as well |
63 _biased_locking_enabled = true; |
63 _biased_locking_enabled = true; |
64 |
64 |
65 log_info(biasedlocking)("Biased locking enabled"); |
65 log_info(biasedlocking)("Biased locking enabled"); |
66 } |
66 } |