22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoaderDataGraph.hpp"
27 #include "jfr/jfrEvents.hpp"
28 #include "jfr/support/jfrThreadId.hpp"
29 #include "logging/log.hpp"
30 #include "memory/resourceArea.hpp"
31 #include "oops/klass.inline.hpp"
32 #include "oops/markOop.hpp"
33 #include "oops/oop.inline.hpp"
34 #include "runtime/atomic.hpp"
35 #include "runtime/basicLock.hpp"
36 #include "runtime/biasedLocking.hpp"
37 #include "runtime/handles.inline.hpp"
38 #include "runtime/task.hpp"
39 #include "runtime/threadSMR.hpp"
40 #include "runtime/vframe.hpp"
41 #include "runtime/vmThread.hpp"
42 #include "runtime/vm_operations.hpp"
43
44
45 static bool _biased_locking_enabled = false;
46 BiasedLockingCounters BiasedLocking::_counters;
47
48 static GrowableArray<Handle>* _preserved_oop_stack = NULL;
49 static GrowableArray<markOop>* _preserved_mark_stack = NULL;
50
51 static void enable_biased_locking(InstanceKlass* k) {
52 k->set_prototype_header(markOopDesc::biased_locking_prototype());
53 }
54
55 class VM_EnableBiasedLocking: public VM_Operation {
56 private:
57 bool _is_cheap_allocated;
58 public:
59 VM_EnableBiasedLocking(bool is_cheap_allocated) { _is_cheap_allocated = is_cheap_allocated; }
60 VMOp_Type type() const { return VMOp_EnableBiasedLocking; }
61 Mode evaluation_mode() const { return _is_cheap_allocated ? _async_safepoint : _safepoint; }
62 bool is_cheap_allocated() const { return _is_cheap_allocated; }
|
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoaderDataGraph.hpp"
27 #include "jfr/jfrEvents.hpp"
28 #include "jfr/support/jfrThreadId.hpp"
29 #include "logging/log.hpp"
30 #include "memory/resourceArea.hpp"
31 #include "oops/klass.inline.hpp"
32 #include "oops/markOop.hpp"
33 #include "oops/oop.inline.hpp"
34 #include "runtime/atomic.hpp"
35 #include "runtime/basicLock.hpp"
36 #include "runtime/biasedLocking.hpp"
37 #include "runtime/handles.inline.hpp"
38 #include "runtime/task.hpp"
39 #include "runtime/threadSMR.hpp"
40 #include "runtime/vframe.hpp"
41 #include "runtime/vmThread.hpp"
42 #include "runtime/vmOperations.hpp"
43
44
45 static bool _biased_locking_enabled = false;
46 BiasedLockingCounters BiasedLocking::_counters;
47
48 static GrowableArray<Handle>* _preserved_oop_stack = NULL;
49 static GrowableArray<markOop>* _preserved_mark_stack = NULL;
50
51 static void enable_biased_locking(InstanceKlass* k) {
52 k->set_prototype_header(markOopDesc::biased_locking_prototype());
53 }
54
55 class VM_EnableBiasedLocking: public VM_Operation {
56 private:
57 bool _is_cheap_allocated;
58 public:
59 VM_EnableBiasedLocking(bool is_cheap_allocated) { _is_cheap_allocated = is_cheap_allocated; }
60 VMOp_Type type() const { return VMOp_EnableBiasedLocking; }
61 Mode evaluation_mode() const { return _is_cheap_allocated ? _async_safepoint : _safepoint; }
62 bool is_cheap_allocated() const { return _is_cheap_allocated; }
|