651 // Release all internal handles after operation is evaluated 652 HandleMark hm(t); 653 _cur_vm_operation = op; 654 655 if (op->evaluate_at_safepoint() && !SafepointSynchronize::is_at_safepoint()) { 656 SafepointSynchronize::begin(); 657 op->evaluate(); 658 SafepointSynchronize::end(); 659 } else { 660 op->evaluate(); 661 } 662 663 // Free memory if needed 664 if (op->is_cheap_allocated()) delete op; 665 666 _cur_vm_operation = prev_vm_operation; 667 } 668 } 669 670 671 void VMThread::oops_do(OopClosure* f, CodeBlobClosure* cf) { 672 Thread::oops_do(f, cf); 673 _vm_queue->oops_do(f); 674 } 675 676 //------------------------------------------------------------------------------------------------------------------ 677 #ifndef PRODUCT 678 679 void VMOperationQueue::verify_queue(int prio) { 680 // Check that list is correctly linked 681 int length = _queue_length[prio]; 682 VM_Operation *cur = _queue[prio]; 683 int i; 684 685 // Check forward links 686 for(i = 0; i < length; i++) { 687 cur = cur->next(); 688 assert(cur != _queue[prio], "list to short (forward)"); 689 } 690 assert(cur->next() == _queue[prio], "list to long (forward)"); 691 692 // Check backwards links 693 cur = _queue[prio]; 694 for(i = 0; i < length; i++) { 695 cur = cur->prev(); 696 assert(cur != _queue[prio], "list to short (backwards)"); 697 } 698 assert(cur->prev() == _queue[prio], "list to long (backwards)"); 699 } 700 701 #endif 702 703 void VMThread::verify() { 704 oops_do(&VerifyOopClosure::verify_oop, NULL); 705 } | 651 // Release all internal handles after operation is evaluated 652 HandleMark hm(t); 653 _cur_vm_operation = op; 654 655 if (op->evaluate_at_safepoint() && !SafepointSynchronize::is_at_safepoint()) { 656 SafepointSynchronize::begin(); 657 op->evaluate(); 658 SafepointSynchronize::end(); 659 } else { 660 op->evaluate(); 661 } 662 663 // Free memory if needed 664 if (op->is_cheap_allocated()) delete op; 665 666 _cur_vm_operation = prev_vm_operation; 667 } 668 } 669 670 671 void VMThread::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { 672 Thread::oops_do(f, cld_f, cf); 673 _vm_queue->oops_do(f); 674 } 675 676 //------------------------------------------------------------------------------------------------------------------ 677 #ifndef PRODUCT 678 679 void VMOperationQueue::verify_queue(int prio) { 680 // Check that list is correctly linked 681 int length = _queue_length[prio]; 682 VM_Operation *cur = _queue[prio]; 683 int i; 684 685 // Check forward links 686 for(i = 0; i < length; i++) { 687 cur = cur->next(); 688 assert(cur != _queue[prio], "list to short (forward)"); 689 } 690 assert(cur->next() == _queue[prio], "list to long (forward)"); 691 692 // Check backwards links 693 cur = _queue[prio]; 694 for(i = 0; i < length; i++) { 695 cur = cur->prev(); 696 assert(cur != _queue[prio], "list to short (backwards)"); 697 } 698 assert(cur->prev() == _queue[prio], "list to long (backwards)"); 699 } 700 701 #endif 702 703 void VMThread::verify() { 704 oops_do(&VerifyOopClosure::verify_oop, NULL, NULL); 705 } |