Mercurial > hg > graal-compiler
comparison src/share/vm/opto/runtime.hpp @ 17780:606acabe7b5c
8031320: Use Intel RTM instructions for locks
Summary: Use RTM for inflated locks and stack locks.
Reviewed-by: iveresov, twisti, roland, dcubed
author | kvn |
---|---|
date | Thu, 20 Mar 2014 17:49:27 -0700 |
parents | 469216acdb28 |
children | b20a35eae442 |
comparison
equal
deleted
inserted
replaced
17778:a48e16541e6b | 17780:606acabe7b5c |
---|---|
27 | 27 |
28 #include "code/codeBlob.hpp" | 28 #include "code/codeBlob.hpp" |
29 #include "opto/machnode.hpp" | 29 #include "opto/machnode.hpp" |
30 #include "opto/type.hpp" | 30 #include "opto/type.hpp" |
31 #include "runtime/biasedLocking.hpp" | 31 #include "runtime/biasedLocking.hpp" |
32 #include "runtime/rtmLocking.hpp" | |
32 #include "runtime/deoptimization.hpp" | 33 #include "runtime/deoptimization.hpp" |
33 #include "runtime/vframe.hpp" | 34 #include "runtime/vframe.hpp" |
34 | 35 |
35 //------------------------------OptoRuntime------------------------------------ | 36 //------------------------------OptoRuntime------------------------------------ |
36 // Opto compiler runtime routines | 37 // Opto compiler runtime routines |
59 public: | 60 public: |
60 enum CounterTag { | 61 enum CounterTag { |
61 NoTag, | 62 NoTag, |
62 LockCounter, | 63 LockCounter, |
63 EliminatedLockCounter, | 64 EliminatedLockCounter, |
64 BiasedLockingCounter | 65 BiasedLockingCounter, |
66 RTMLockingCounter | |
65 }; | 67 }; |
66 | 68 |
67 private: | 69 private: |
68 const char * _name; | 70 const char * _name; |
69 int _count; | 71 int _count; |
83 CounterTag tag() const { return _tag; } | 85 CounterTag tag() const { return _tag; } |
84 void set_tag(CounterTag tag) { _tag = tag; } | 86 void set_tag(CounterTag tag) { _tag = tag; } |
85 | 87 |
86 NamedCounter* next() const { return _next; } | 88 NamedCounter* next() const { return _next; } |
87 void set_next(NamedCounter* next) { | 89 void set_next(NamedCounter* next) { |
88 assert(_next == NULL, "already set"); | 90 assert(_next == NULL || next == NULL, "already set"); |
89 _next = next; | 91 _next = next; |
90 } | 92 } |
91 | 93 |
92 }; | 94 }; |
93 | 95 |
98 public: | 100 public: |
99 BiasedLockingNamedCounter(const char *n) : | 101 BiasedLockingNamedCounter(const char *n) : |
100 NamedCounter(n, BiasedLockingCounter), _counters() {} | 102 NamedCounter(n, BiasedLockingCounter), _counters() {} |
101 | 103 |
102 BiasedLockingCounters* counters() { return &_counters; } | 104 BiasedLockingCounters* counters() { return &_counters; } |
105 }; | |
106 | |
107 | |
108 class RTMLockingNamedCounter : public NamedCounter { | |
109 private: | |
110 RTMLockingCounters _counters; | |
111 | |
112 public: | |
113 RTMLockingNamedCounter(const char *n) : | |
114 NamedCounter(n, RTMLockingCounter), _counters() {} | |
115 | |
116 RTMLockingCounters* counters() { return &_counters; } | |
103 }; | 117 }; |
104 | 118 |
105 typedef const TypeFunc*(*TypeFunc_generator)(); | 119 typedef const TypeFunc*(*TypeFunc_generator)(); |
106 | 120 |
107 class OptoRuntime : public AllStatic { | 121 class OptoRuntime : public AllStatic { |