src/share/vm/prims/jvmtiEnvThreadState.cpp

Print this page




 204 }
 205 
 206 
 207 bool JvmtiEnvThreadState::has_frame_pops() {
 208   return _frame_pops == NULL? false : (_frame_pops->length() > 0);
 209 }
 210 
 211 void JvmtiEnvThreadState::set_frame_pop(int frame_number) {
 212 #ifdef ASSERT
 213   uint32_t debug_bits = 0;
 214 #endif
 215   assert(get_thread() == Thread::current() || JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits),
 216          "frame pop data only accessible from same thread or while suspended");
 217   JvmtiFramePop fpop(frame_number);
 218   JvmtiEventController::set_frame_pop(this, fpop);
 219 }
 220 
 221 
 222 void JvmtiEnvThreadState::clear_frame_pop(int frame_number) {
 223 #ifdef ASSERT

 224   uint32_t debug_bits = 0;
 225 #endif
 226   assert(get_thread() == Thread::current() || JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits),
 227          "frame pop data only accessible from same thread or while suspended");

 228   JvmtiFramePop fpop(frame_number);
 229   JvmtiEventController::clear_frame_pop(this, fpop);
 230 }
 231 
 232 
 233 void JvmtiEnvThreadState::clear_to_frame_pop(int frame_number)  {
 234 #ifdef ASSERT
 235   uint32_t debug_bits = 0;
 236 #endif
 237   assert(get_thread() == Thread::current() || JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits),
 238          "frame pop data only accessible from same thread or while suspended");
 239   JvmtiFramePop fpop(frame_number);
 240   JvmtiEventController::clear_to_frame_pop(this, fpop);
 241 }
 242 
 243 
 244 bool JvmtiEnvThreadState::is_frame_pop(int cur_frame_number) {
 245 #ifdef ASSERT

 246   uint32_t debug_bits = 0;
 247 #endif
 248   assert(get_thread() == Thread::current() || JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits),
 249          "frame pop data only accessible from same thread or while suspended");

 250   if (!get_thread()->is_interp_only_mode() || _frame_pops == NULL) {
 251     return false;
 252   }
 253   JvmtiFramePop fp(cur_frame_number);
 254   return get_frame_pops()->contains(fp);
 255 }
 256 
 257 
 258 class VM_GetCurrentLocation : public VM_Operation {
 259  private:
 260    JavaThread *_thread;
 261    jmethodID _method_id;
 262    int _bci;
 263 
 264  public:
 265   VM_GetCurrentLocation(JavaThread *thread) {
 266      _thread = thread;
 267    }
 268   VMOp_Type type() const { return VMOp_GetCurrentLocation; }
 269   void doit() {




 204 }
 205 
 206 
 207 bool JvmtiEnvThreadState::has_frame_pops() {
 208   return _frame_pops == NULL? false : (_frame_pops->length() > 0);
 209 }
 210 
 211 void JvmtiEnvThreadState::set_frame_pop(int frame_number) {
 212 #ifdef ASSERT
 213   uint32_t debug_bits = 0;
 214 #endif
 215   assert(get_thread() == Thread::current() || JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits),
 216          "frame pop data only accessible from same thread or while suspended");
 217   JvmtiFramePop fpop(frame_number);
 218   JvmtiEventController::set_frame_pop(this, fpop);
 219 }
 220 
 221 
 222 void JvmtiEnvThreadState::clear_frame_pop(int frame_number) {
 223 #ifdef ASSERT
 224   Thread* cur =  Thread::current();
 225   uint32_t debug_bits = 0;
 226 #endif
 227   assert(get_thread() == cur || (cur->is_VM_thread() && SafepointSynchronize::is_at_safepoint()) ||
 228          JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits),
 229          "frame pop data only accessible from same thread, at safepoint or while suspended");
 230   JvmtiFramePop fpop(frame_number);
 231   JvmtiEventController::clear_frame_pop(this, fpop);
 232 }
 233 
 234 
 235 void JvmtiEnvThreadState::clear_to_frame_pop(int frame_number)  {
 236 #ifdef ASSERT
 237   uint32_t debug_bits = 0;
 238 #endif
 239   assert(get_thread() == Thread::current() || JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits),
 240          "frame pop data only accessible from same thread or while suspended");
 241   JvmtiFramePop fpop(frame_number);
 242   JvmtiEventController::clear_to_frame_pop(this, fpop);
 243 }
 244 
 245 
 246 bool JvmtiEnvThreadState::is_frame_pop(int cur_frame_number) {
 247 #ifdef ASSERT
 248   Thread* cur =  Thread::current();
 249   uint32_t debug_bits = 0;
 250 #endif
 251   assert(get_thread() == cur || (cur->is_VM_thread() && SafepointSynchronize::is_at_safepoint()) ||
 252          JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits),
 253          "frame pop data only accessible from same thread, at safepoint or while suspended");
 254   if (!get_thread()->is_interp_only_mode() || _frame_pops == NULL) {
 255     return false;
 256   }
 257   JvmtiFramePop fp(cur_frame_number);
 258   return get_frame_pops()->contains(fp);
 259 }
 260 
 261 
 262 class VM_GetCurrentLocation : public VM_Operation {
 263  private:
 264    JavaThread *_thread;
 265    jmethodID _method_id;
 266    int _bci;
 267 
 268  public:
 269   VM_GetCurrentLocation(JavaThread *thread) {
 270      _thread = thread;
 271    }
 272   VMOp_Type type() const { return VMOp_GetCurrentLocation; }
 273   void doit() {