150 int walk_stack_counter = 0; 151 152 void InterfaceSupport::walk_stack_from(vframe* start_vf) { 153 // walk 154 int i = 0; 155 for (vframe* f = start_vf; f; f = f->sender() ) { 156 if (i < 50) vframe_array[i++] = f; 157 } 158 } 159 160 161 void InterfaceSupport::walk_stack() { 162 JavaThread* thread = JavaThread::current(); 163 walk_stack_counter++; 164 if (!thread->has_last_Java_frame()) return; 165 ResourceMark rm(thread); 166 RegisterMap reg_map(thread); 167 walk_stack_from(thread->last_java_vframe(®_map)); 168 } 169 170 171 # ifdef ENABLE_ZAP_DEAD_LOCALS 172 173 static int zap_traversals = 0; 174 175 void InterfaceSupport::zap_dead_locals_old() { 176 JavaThread* thread = JavaThread::current(); 177 if (zap_traversals == -1) // edit constant for debugging 178 warning("I am here"); 179 int zap_frame_count = 0; // count frames to help debugging 180 for (StackFrameStream sfs(thread); !sfs.is_done(); sfs.next()) { 181 sfs.current()->zap_dead_locals(thread, sfs.register_map()); 182 ++zap_frame_count; 183 } 184 ++zap_traversals; 185 } 186 187 # endif 188 189 // invocation counter for InterfaceSupport::deoptimizeAll/zombieAll functions 190 int deoptimizeAllCounter = 0; 191 int zombieAllCounter = 0; 192 193 void InterfaceSupport::zombieAll() { 194 // This method is called by all threads when a thread make 195 // transition to VM state (for example, runtime calls). 196 // Divide number of calls by number of threads to avoid 197 // dependence of ZombieAll events frequency on number of threads. 198 int value = zombieAllCounter / Threads::number_of_threads(); 199 if (is_init_completed() && value > ZombieALotInterval) { 200 zombieAllCounter = 0; 201 VM_ZombieAll op; 202 VMThread::execute(&op); 203 } 204 zombieAllCounter++; 205 } 206 207 void InterfaceSupport::unlinkSymbols() { 208 VM_UnlinkSymbols op; | 150 int walk_stack_counter = 0; 151 152 void InterfaceSupport::walk_stack_from(vframe* start_vf) { 153 // walk 154 int i = 0; 155 for (vframe* f = start_vf; f; f = f->sender() ) { 156 if (i < 50) vframe_array[i++] = f; 157 } 158 } 159 160 161 void InterfaceSupport::walk_stack() { 162 JavaThread* thread = JavaThread::current(); 163 walk_stack_counter++; 164 if (!thread->has_last_Java_frame()) return; 165 ResourceMark rm(thread); 166 RegisterMap reg_map(thread); 167 walk_stack_from(thread->last_java_vframe(®_map)); 168 } 169 170 // invocation counter for InterfaceSupport::deoptimizeAll/zombieAll functions 171 int deoptimizeAllCounter = 0; 172 int zombieAllCounter = 0; 173 174 void InterfaceSupport::zombieAll() { 175 // This method is called by all threads when a thread make 176 // transition to VM state (for example, runtime calls). 177 // Divide number of calls by number of threads to avoid 178 // dependence of ZombieAll events frequency on number of threads. 179 int value = zombieAllCounter / Threads::number_of_threads(); 180 if (is_init_completed() && value > ZombieALotInterval) { 181 zombieAllCounter = 0; 182 VM_ZombieAll op; 183 VMThread::execute(&op); 184 } 185 zombieAllCounter++; 186 } 187 188 void InterfaceSupport::unlinkSymbols() { 189 VM_UnlinkSymbols op; |