@@ -66,9 +66,9 @@ class JvmtiBreakpoints;
66
66
class GrowableElement : public CHeapObj <mtInternal> {
67
67
public:
68
68
virtual ~GrowableElement () {}
69
- virtual address getCacheValue () =0;
70
- virtual bool equals (GrowableElement* e) =0;
71
- virtual GrowableElement * clone () =0;
69
+ virtual address getCacheValue () =0;
70
+ virtual bool equals (const GrowableElement* e) const =0;
71
+ virtual GrowableElement* clone () =0;
72
72
};
73
73
74
74
class GrowableCache {
@@ -88,8 +88,6 @@ class GrowableCache {
88
88
// (but NOT when cached elements are recomputed).
89
89
void (*_listener_fun)(void *, address*);
90
90
91
- static bool equals (void *, GrowableElement *);
92
-
93
91
// recache all elements after size change, notify listener
94
92
void recache ();
95
93
@@ -104,7 +102,7 @@ class GrowableCache {
104
102
// get the value of the index element in the collection
105
103
GrowableElement* at (int index);
106
104
// find the index of the element, -1 if it doesn't exist
107
- int find (GrowableElement* e);
105
+ int find (const GrowableElement* e) const ;
108
106
// append a copy of the element to the end of the collection, notify listener
109
107
void append (GrowableElement* e);
110
108
// remove the element at index, notify listener
@@ -165,7 +163,7 @@ class JvmtiBreakpoint : public GrowableElement {
165
163
JvmtiBreakpoint () : _method(nullptr ), _bci(0 ) {}
166
164
JvmtiBreakpoint (Method* m_method, jlocation location);
167
165
virtual ~JvmtiBreakpoint ();
168
- bool equals (JvmtiBreakpoint& bp);
166
+ bool equals (const JvmtiBreakpoint& bp) const ;
169
167
void copy (JvmtiBreakpoint& bp);
170
168
address getBcp () const ;
171
169
void each_method_version_do (method_action meth_act);
@@ -177,7 +175,7 @@ class JvmtiBreakpoint : public GrowableElement {
177
175
178
176
// GrowableElement implementation
179
177
address getCacheValue () { return getBcp (); }
180
- bool equals (GrowableElement* e) { return equals ((JvmtiBreakpoint&) *e); }
178
+ bool equals (const GrowableElement* e) const { return equals ((const JvmtiBreakpoint&) *e); }
181
179
182
180
GrowableElement *clone () {
183
181
JvmtiBreakpoint *bp = new JvmtiBreakpoint ();
0 commit comments