< prev index next >

src/hotspot/share/aot/aotCodeHeap.cpp

Print this page
rev 54621 : imported patch 8221734-v1


 714   }
 715 }
 716 
 717 void AOTCodeHeap::sweep_dependent_methods(int* indexes, int methods_cnt) {
 718   int marked = 0;
 719   for (int i = 0; i < methods_cnt; ++i) {
 720     int code_id = indexes[i];
 721     // Invalidate aot code.
 722     if (Atomic::cmpxchg(invalid, &_code_to_aot[code_id]._state, not_set) != not_set) {
 723       if (_code_to_aot[code_id]._state == in_use) {
 724         AOTCompiledMethod* aot = _code_to_aot[code_id]._aot;
 725         assert(aot != NULL, "aot should be set");
 726         if (!aot->is_runtime_stub()) { // Something is wrong - should not invalidate stubs.
 727           aot->mark_for_deoptimization(false);
 728           marked++;
 729         }
 730       }
 731     }
 732   }
 733   if (marked > 0) {
 734     VM_Deoptimize op;
 735     VMThread::execute(&op);
 736   }
 737 }
 738 
 739 void AOTCodeHeap::sweep_dependent_methods(AOTKlassData* klass_data) {
 740   // Make dependent methods non_entrant forever.
 741   int methods_offset = klass_data->_dependent_methods_offset;
 742   if (methods_offset >= 0) {
 743     address methods_cnt_adr = _dependencies + methods_offset;
 744     int methods_cnt = *(int*)methods_cnt_adr;
 745     int* indexes = (int*)(methods_cnt_adr + 4);
 746     sweep_dependent_methods(indexes, methods_cnt);
 747   }
 748 }
 749 
 750 void AOTCodeHeap::sweep_dependent_methods(InstanceKlass* ik) {
 751   AOTKlassData* klass_data = find_klass(ik);
 752   vmassert(klass_data != NULL, "dependency data missing");
 753   sweep_dependent_methods(klass_data);
 754 }
 755 




 714   }
 715 }
 716 
 717 void AOTCodeHeap::sweep_dependent_methods(int* indexes, int methods_cnt) {
 718   int marked = 0;
 719   for (int i = 0; i < methods_cnt; ++i) {
 720     int code_id = indexes[i];
 721     // Invalidate aot code.
 722     if (Atomic::cmpxchg(invalid, &_code_to_aot[code_id]._state, not_set) != not_set) {
 723       if (_code_to_aot[code_id]._state == in_use) {
 724         AOTCompiledMethod* aot = _code_to_aot[code_id]._aot;
 725         assert(aot != NULL, "aot should be set");
 726         if (!aot->is_runtime_stub()) { // Something is wrong - should not invalidate stubs.
 727           aot->mark_for_deoptimization(false);
 728           marked++;
 729         }
 730       }
 731     }
 732   }
 733   if (marked > 0) {
 734     Deoptimization::deoptimize_all_marked();

 735   }
 736 }
 737 
 738 void AOTCodeHeap::sweep_dependent_methods(AOTKlassData* klass_data) {
 739   // Make dependent methods non_entrant forever.
 740   int methods_offset = klass_data->_dependent_methods_offset;
 741   if (methods_offset >= 0) {
 742     address methods_cnt_adr = _dependencies + methods_offset;
 743     int methods_cnt = *(int*)methods_cnt_adr;
 744     int* indexes = (int*)(methods_cnt_adr + 4);
 745     sweep_dependent_methods(indexes, methods_cnt);
 746   }
 747 }
 748 
 749 void AOTCodeHeap::sweep_dependent_methods(InstanceKlass* ik) {
 750   AOTKlassData* klass_data = find_klass(ik);
 751   vmassert(klass_data != NULL, "dependency data missing");
 752   sweep_dependent_methods(klass_data);
 753 }
 754 


< prev index next >