src/hotspot/share/code/stubs.cpp
changeset 52857 7e268f863ff0
parent 48097 8707ca0f414a
child 54623 1126f0607c70
equal deleted inserted replaced
52856:5f3b9b633731 52857:7e268f863ff0
   115 }
   115 }
   116 
   116 
   117 
   117 
   118 Stub* StubQueue::request(int requested_code_size) {
   118 Stub* StubQueue::request(int requested_code_size) {
   119   assert(requested_code_size > 0, "requested_code_size must be > 0");
   119   assert(requested_code_size > 0, "requested_code_size must be > 0");
   120   if (_mutex != NULL) _mutex->lock();
   120   if (_mutex != NULL) _mutex->lock_without_safepoint_check();
   121   Stub* s = current_stub();
   121   Stub* s = current_stub();
   122   int requested_size = align_up(stub_code_size_to_size(requested_code_size), CodeEntryAlignment);
   122   int requested_size = align_up(stub_code_size_to_size(requested_code_size), CodeEntryAlignment);
   123   if (requested_size <= available_space()) {
   123   if (requested_size <= available_space()) {
   124     if (is_contiguous()) {
   124     if (is_contiguous()) {
   125       // Queue: |...|XXXXXXX|.............|
   125       // Queue: |...|XXXXXXX|.............|
   205 
   205 
   206 
   206 
   207 void StubQueue::verify() {
   207 void StubQueue::verify() {
   208   // verify only if initialized
   208   // verify only if initialized
   209   if (_stub_buffer == NULL) return;
   209   if (_stub_buffer == NULL) return;
   210   MutexLockerEx lock(_mutex);
   210   MutexLockerEx lock(_mutex, Mutex::_no_safepoint_check_flag);
   211   // verify index boundaries
   211   // verify index boundaries
   212   guarantee(0 <= _buffer_size, "buffer size must be positive");
   212   guarantee(0 <= _buffer_size, "buffer size must be positive");
   213   guarantee(0 <= _buffer_limit && _buffer_limit <= _buffer_size , "_buffer_limit out of bounds");
   213   guarantee(0 <= _buffer_limit && _buffer_limit <= _buffer_size , "_buffer_limit out of bounds");
   214   guarantee(0 <= _queue_begin  && _queue_begin  <  _buffer_limit, "_queue_begin out of bounds");
   214   guarantee(0 <= _queue_begin  && _queue_begin  <  _buffer_limit, "_queue_begin out of bounds");
   215   guarantee(0 <= _queue_end    && _queue_end    <= _buffer_limit, "_queue_end   out of bounds");
   215   guarantee(0 <= _queue_end    && _queue_end    <= _buffer_limit, "_queue_end   out of bounds");
   232   guarantee(_queue_begin != _queue_end || n == 0, "buffer indices must be the same");
   232   guarantee(_queue_begin != _queue_end || n == 0, "buffer indices must be the same");
   233 }
   233 }
   234 
   234 
   235 
   235 
   236 void StubQueue::print() {
   236 void StubQueue::print() {
   237   MutexLockerEx lock(_mutex);
   237   MutexLockerEx lock(_mutex, Mutex::_no_safepoint_check_flag);
   238   for (Stub* s = first(); s != NULL; s = next(s)) {
   238   for (Stub* s = first(); s != NULL; s = next(s)) {
   239     stub_print(s);
   239     stub_print(s);
   240   }
   240   }
   241 }
   241 }
   242