< prev index next >

src/hotspot/share/runtime/interfaceSupport.cpp

Print this page




  49   }
  50 }
  51 
  52 VMEntryWrapper::~VMEntryWrapper() {
  53   InterfaceSupport::check_gc_alot();
  54   if (WalkStackALot) {
  55     InterfaceSupport::walk_stack();
  56   }
  57 #ifdef COMPILER2
  58   // This option is not used by Compiler 1
  59   if (StressDerivedPointers) {
  60     InterfaceSupport::stress_derived_pointers();
  61   }
  62 #endif
  63   if (DeoptimizeALot || DeoptimizeRandom) {
  64     InterfaceSupport::deoptimizeAll();
  65   }
  66   if (ZombieALot) {
  67     InterfaceSupport::zombieAll();
  68   }
  69   if (UnlinkSymbolsALot) {
  70     InterfaceSupport::unlinkSymbols();
  71   }
  72   // do verification AFTER potential deoptimization
  73   if (VerifyStack) {
  74     InterfaceSupport::verify_stack();
  75   }
  76 }
  77 
  78 long InterfaceSupport::_number_of_calls       = 0;
  79 long InterfaceSupport::_scavenge_alot_counter = 1;
  80 long InterfaceSupport::_fullgc_alot_counter   = 1;
  81 long InterfaceSupport::_fullgc_alot_invocation = 0;
  82 
  83 Histogram* RuntimeHistogram;
  84 
  85 RuntimeHistogramElement::RuntimeHistogramElement(const char* elementName) {
  86   static volatile int RuntimeHistogram_lock = 0;
  87   _name = elementName;
  88   uintx count = 0;
  89 
  90   while (Atomic::cmpxchg(1, &RuntimeHistogram_lock, 0) != 0) {
  91     while (OrderAccess::load_acquire(&RuntimeHistogram_lock) != 0) {


 189   RegisterMap reg_map(thread);
 190   walk_stack_from(thread->last_java_vframe(&reg_map));
 191 }
 192 
 193 // invocation counter for InterfaceSupport::deoptimizeAll/zombieAll functions
 194 int deoptimizeAllCounter = 0;
 195 int zombieAllCounter = 0;
 196 
 197 void InterfaceSupport::zombieAll() {
 198   // This method is called by all threads when a thread make
 199   // transition to VM state (for example, runtime calls).
 200   // Divide number of calls by number of threads to avoid
 201   // dependence of ZombieAll events frequency on number of threads.
 202   int value = zombieAllCounter / Threads::number_of_threads();
 203   if (is_init_completed() && value > ZombieALotInterval) {
 204     zombieAllCounter = 0;
 205     VM_ZombieAll op;
 206     VMThread::execute(&op);
 207   }
 208   zombieAllCounter++;
 209 }
 210 
 211 void InterfaceSupport::unlinkSymbols() {
 212   VM_UnlinkSymbols op;
 213   VMThread::execute(&op);
 214 }
 215 
 216 void InterfaceSupport::deoptimizeAll() {
 217   // This method is called by all threads when a thread make
 218   // transition to VM state (for example, runtime calls).
 219   // Divide number of calls by number of threads to avoid
 220   // dependence of DeoptimizeAll events frequency on number of threads.
 221   int value = deoptimizeAllCounter / Threads::number_of_threads();
 222   if (is_init_completed()) {
 223     if (DeoptimizeALot && value > DeoptimizeALotInterval) {
 224       deoptimizeAllCounter = 0;
 225       VM_DeoptimizeAll op;
 226       VMThread::execute(&op);
 227     } else if (DeoptimizeRandom && (value & 0x1F) == (os::random() & 0x1F)) {
 228       VM_DeoptimizeAll op;
 229       VMThread::execute(&op);
 230     }
 231   }
 232   deoptimizeAllCounter++;
 233 }




  49   }
  50 }
  51 
  52 VMEntryWrapper::~VMEntryWrapper() {
  53   InterfaceSupport::check_gc_alot();
  54   if (WalkStackALot) {
  55     InterfaceSupport::walk_stack();
  56   }
  57 #ifdef COMPILER2
  58   // This option is not used by Compiler 1
  59   if (StressDerivedPointers) {
  60     InterfaceSupport::stress_derived_pointers();
  61   }
  62 #endif
  63   if (DeoptimizeALot || DeoptimizeRandom) {
  64     InterfaceSupport::deoptimizeAll();
  65   }
  66   if (ZombieALot) {
  67     InterfaceSupport::zombieAll();
  68   }



  69   // do verification AFTER potential deoptimization
  70   if (VerifyStack) {
  71     InterfaceSupport::verify_stack();
  72   }
  73 }
  74 
  75 long InterfaceSupport::_number_of_calls       = 0;
  76 long InterfaceSupport::_scavenge_alot_counter = 1;
  77 long InterfaceSupport::_fullgc_alot_counter   = 1;
  78 long InterfaceSupport::_fullgc_alot_invocation = 0;
  79 
  80 Histogram* RuntimeHistogram;
  81 
  82 RuntimeHistogramElement::RuntimeHistogramElement(const char* elementName) {
  83   static volatile int RuntimeHistogram_lock = 0;
  84   _name = elementName;
  85   uintx count = 0;
  86 
  87   while (Atomic::cmpxchg(1, &RuntimeHistogram_lock, 0) != 0) {
  88     while (OrderAccess::load_acquire(&RuntimeHistogram_lock) != 0) {


 186   RegisterMap reg_map(thread);
 187   walk_stack_from(thread->last_java_vframe(&reg_map));
 188 }
 189 
 190 // invocation counter for InterfaceSupport::deoptimizeAll/zombieAll functions
 191 int deoptimizeAllCounter = 0;
 192 int zombieAllCounter = 0;
 193 
 194 void InterfaceSupport::zombieAll() {
 195   // This method is called by all threads when a thread make
 196   // transition to VM state (for example, runtime calls).
 197   // Divide number of calls by number of threads to avoid
 198   // dependence of ZombieAll events frequency on number of threads.
 199   int value = zombieAllCounter / Threads::number_of_threads();
 200   if (is_init_completed() && value > ZombieALotInterval) {
 201     zombieAllCounter = 0;
 202     VM_ZombieAll op;
 203     VMThread::execute(&op);
 204   }
 205   zombieAllCounter++;





 206 }
 207 
 208 void InterfaceSupport::deoptimizeAll() {
 209   // This method is called by all threads when a thread make
 210   // transition to VM state (for example, runtime calls).
 211   // Divide number of calls by number of threads to avoid
 212   // dependence of DeoptimizeAll events frequency on number of threads.
 213   int value = deoptimizeAllCounter / Threads::number_of_threads();
 214   if (is_init_completed()) {
 215     if (DeoptimizeALot && value > DeoptimizeALotInterval) {
 216       deoptimizeAllCounter = 0;
 217       VM_DeoptimizeAll op;
 218       VMThread::execute(&op);
 219     } else if (DeoptimizeRandom && (value & 0x1F) == (os::random() & 0x1F)) {
 220       VM_DeoptimizeAll op;
 221       VMThread::execute(&op);
 222     }
 223   }
 224   deoptimizeAllCounter++;
 225 }


< prev index next >