170 bool stub_contains(Stub* s, address pc) const { return _stub_interface->code_begin(s) <= pc && pc < _stub_interface->code_end(s); } |
170 bool stub_contains(Stub* s, address pc) const { return _stub_interface->code_begin(s) <= pc && pc < _stub_interface->code_end(s); } |
171 int stub_code_size_to_size(int code_size) const { return _stub_interface->code_size_to_size(code_size); } |
171 int stub_code_size_to_size(int code_size) const { return _stub_interface->code_size_to_size(code_size); } |
172 void stub_verify(Stub* s) { _stub_interface->verify(s); } |
172 void stub_verify(Stub* s) { _stub_interface->verify(s); } |
173 void stub_print(Stub* s) { _stub_interface->print(s); } |
173 void stub_print(Stub* s) { _stub_interface->print(s); } |
174 |
174 |
175 static void register_queue(StubQueue*); |
|
176 |
|
177 public: |
175 public: |
178 StubQueue(StubInterface* stub_interface, int buffer_size, Mutex* lock, |
176 StubQueue(StubInterface* stub_interface, int buffer_size, Mutex* lock, |
179 const char* name); |
177 const char* name); |
180 ~StubQueue(); |
178 ~StubQueue(); |
181 |
179 |
202 void remove_all(); // remove all stubs in the queue |
200 void remove_all(); // remove all stubs in the queue |
203 |
201 |
204 void deallocate_unused_tail(); // deallocate the unused tail of the underlying CodeBlob |
202 void deallocate_unused_tail(); // deallocate the unused tail of the underlying CodeBlob |
205 // only used from TemplateInterpreter::initialize() |
203 // only used from TemplateInterpreter::initialize() |
206 // Iteration |
204 // Iteration |
207 static void queues_do(void f(StubQueue* s)); // call f with each StubQueue |
|
208 void stubs_do(void f(Stub* s)); // call f with all stubs |
|
209 Stub* first() const { return number_of_stubs() > 0 ? stub_at(_queue_begin) : NULL; } |
205 Stub* first() const { return number_of_stubs() > 0 ? stub_at(_queue_begin) : NULL; } |
210 Stub* next(Stub* s) const { int i = index_of(s) + stub_size(s); |
206 Stub* next(Stub* s) const { int i = index_of(s) + stub_size(s); |
211 // Only wrap around in the non-contiguous case (see stubss.cpp) |
207 // Only wrap around in the non-contiguous case (see stubss.cpp) |
212 if (i == _buffer_limit && _queue_end < _buffer_limit) i = 0; |
208 if (i == _buffer_limit && _queue_end < _buffer_limit) i = 0; |
213 return (i == _queue_end) ? NULL : stub_at(i); |
209 return (i == _queue_end) ? NULL : stub_at(i); |
214 } |
210 } |
215 |
211 |
216 address stub_code_begin(Stub* s) const { return _stub_interface->code_begin(s); } |
|
217 address stub_code_end(Stub* s) const { return _stub_interface->code_end(s); } |
|
218 |
|
219 // Debugging/printing |
212 // Debugging/printing |
220 void verify(); // verifies the stub queue |
213 void verify(); // verifies the stub queue |
221 void print(); // prints information about the stub queue |
214 void print(); // prints information about the stub queue |
222 |
215 |
223 }; |
216 }; |