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 |
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 { |