src/share/vm/jfr/recorder/storage/jfrStorage.cpp

changeset 9928
d2c2cd90513e
parent 9858
b985cbb00e68
equal deleted inserted replaced
9927:b273df69fbfe 9928:d2c2cd90513e
338 } 338 }
339 339
340 void JfrStorage::register_full(BufferPtr buffer, Thread* thread) { 340 void JfrStorage::register_full(BufferPtr buffer, Thread* thread) {
341 assert(buffer != NULL, "invariant"); 341 assert(buffer != NULL, "invariant");
342 assert(buffer->retired(), "invariant"); 342 assert(buffer->retired(), "invariant");
343 assert(buffer->acquired_by(thread), "invariant");
343 if (!full_buffer_registration(buffer, _age_mspace, control(), thread)) { 344 if (!full_buffer_registration(buffer, _age_mspace, control(), thread)) {
344 handle_registration_failure(buffer); 345 handle_registration_failure(buffer);
345 buffer->release();
346 } 346 }
347 if (control().should_post_buffer_full_message()) { 347 if (control().should_post_buffer_full_message()) {
348 _post_box.post(MSG_FULLBUFFER); 348 _post_box.post(MSG_FULLBUFFER);
349 } 349 }
350 } 350 }
375 if (!flush_regular_buffer(buffer, thread)) { 375 if (!flush_regular_buffer(buffer, thread)) {
376 buffer->concurrent_reinitialization(); 376 buffer->concurrent_reinitialization();
377 } 377 }
378 } 378 }
379 assert(buffer->empty(), "invariant"); 379 assert(buffer->empty(), "invariant");
380 assert(buffer->identity() != NULL, "invariant");
380 control().increment_dead(); 381 control().increment_dead();
381 buffer->release();
382 buffer->set_retired(); 382 buffer->set_retired();
383 } 383 }
384 384
385 void JfrStorage::release_thread_local(BufferPtr buffer, Thread* thread) { 385 void JfrStorage::release_thread_local(BufferPtr buffer, Thread* thread) {
386 assert(buffer != NULL, "invariant"); 386 assert(buffer != NULL, "invariant");
731 public: 731 public:
732 typedef typename Mspace::Type Type; 732 typedef typename Mspace::Type Type;
733 Scavenger(JfrStorageControl& control, Mspace* mspace) : _control(control), _mspace(mspace), _count(0), _amount(0) {} 733 Scavenger(JfrStorageControl& control, Mspace* mspace) : _control(control), _mspace(mspace), _count(0), _amount(0) {}
734 bool process(Type* t) { 734 bool process(Type* t) {
735 if (t->retired()) { 735 if (t->retired()) {
736 assert(t->identity() != NULL, "invariant");
737 assert(t->empty(), "invariant");
736 assert(!t->transient(), "invariant"); 738 assert(!t->transient(), "invariant");
737 assert(!t->lease(), "invariant"); 739 assert(!t->lease(), "invariant");
738 assert(t->empty(), "invariant");
739 assert(t->identity() == NULL, "invariant");
740 ++_count; 740 ++_count;
741 _amount += t->total_size(); 741 _amount += t->total_size();
742 t->clear_retired(); 742 t->clear_retired();
743 t->release();
743 _control.decrement_dead(); 744 _control.decrement_dead();
744 mspace_release_full_critical(t, _mspace); 745 mspace_release_full_critical(t, _mspace);
745 } 746 }
746 return true; 747 return true;
747 } 748 }

mercurial