< prev index next >

src/hotspot/share/runtime/thread.cpp

Print this page




3183 
3184 oop JavaThread::current_park_blocker() {
3185   // Support for JSR-166 locks
3186   oop thread_oop = threadObj();
3187   if (thread_oop != NULL &&
3188       JDK_Version::current().supports_thread_park_blocker()) {
3189     return java_lang_Thread::park_blocker(thread_oop);
3190   }
3191   return NULL;
3192 }
3193 
3194 
3195 void JavaThread::print_stack_on(outputStream* st) {
3196   if (!has_last_Java_frame()) return;
3197   ResourceMark rm;
3198   HandleMark   hm;
3199 
3200   RegisterMap reg_map(this);
3201   vframe* start_vf = last_java_vframe(&reg_map);
3202   int count = 0;
3203   for (vframe* f = start_vf; f; f = f->sender()) {
3204     if (f->is_java_frame()) {
3205       javaVFrame* jvf = javaVFrame::cast(f);
3206       java_lang_Throwable::print_stack_element(st, jvf->method(), jvf->bci());
3207 
3208       // Print out lock information
3209       if (JavaMonitorsInStackTrace) {
3210         jvf->print_lock_info_on(st, count);
3211       }
3212     } else {
3213       // Ignore non-Java frames
3214     }
3215 
3216     // Bail-out case for too deep stacks
3217     count++;
3218     if (MaxJavaStackTraceDepth == count) return;
3219   }
3220 }
3221 
3222 
3223 // JVMTI PopFrame support
3224 void JavaThread::popframe_preserve_args(ByteSize size_in_bytes, void* start) {
3225   assert(_popframe_preserved_args == NULL, "should not wipe out old PopFrame preserved arguments");
3226   if (in_bytes(size_in_bytes) != 0) {
3227     _popframe_preserved_args = NEW_C_HEAP_ARRAY(char, in_bytes(size_in_bytes), mtThread);
3228     _popframe_preserved_args_size = in_bytes(size_in_bytes);
3229     Copy::conjoint_jbytes(start, _popframe_preserved_args, _popframe_preserved_args_size);
3230   }
3231 }
3232 
3233 void* JavaThread::popframe_preserved_args() {
3234   return _popframe_preserved_args;
3235 }
3236 
3237 ByteSize JavaThread::popframe_preserved_args_size() {
3238   return in_ByteSize(_popframe_preserved_args_size);




3183 
3184 oop JavaThread::current_park_blocker() {
3185   // Support for JSR-166 locks
3186   oop thread_oop = threadObj();
3187   if (thread_oop != NULL &&
3188       JDK_Version::current().supports_thread_park_blocker()) {
3189     return java_lang_Thread::park_blocker(thread_oop);
3190   }
3191   return NULL;
3192 }
3193 
3194 
3195 void JavaThread::print_stack_on(outputStream* st) {
3196   if (!has_last_Java_frame()) return;
3197   ResourceMark rm;
3198   HandleMark   hm;
3199 
3200   RegisterMap reg_map(this);
3201   vframe* start_vf = last_java_vframe(&reg_map);
3202   int count = 0;
3203   for (vframe* f = start_vf; f != NULL; f = f->sender()) {
3204     if (f->is_java_frame()) {
3205       javaVFrame* jvf = javaVFrame::cast(f);
3206       java_lang_Throwable::print_stack_element(st, jvf->method(), jvf->bci());
3207 
3208       // Print out lock information
3209       if (JavaMonitorsInStackTrace) {
3210         jvf->print_lock_info_on(st, count);
3211       }
3212     } else {
3213       // Ignore non-Java frames
3214     }
3215 
3216     // Bail-out case for too deep stacks if MaxJavaStackTraceDepth > 0
3217     count++;
3218     if (MaxJavaStackTraceDepth > 0 && MaxJavaStackTraceDepth == count) return;
3219   }
3220 }
3221 
3222 
3223 // JVMTI PopFrame support
3224 void JavaThread::popframe_preserve_args(ByteSize size_in_bytes, void* start) {
3225   assert(_popframe_preserved_args == NULL, "should not wipe out old PopFrame preserved arguments");
3226   if (in_bytes(size_in_bytes) != 0) {
3227     _popframe_preserved_args = NEW_C_HEAP_ARRAY(char, in_bytes(size_in_bytes), mtThread);
3228     _popframe_preserved_args_size = in_bytes(size_in_bytes);
3229     Copy::conjoint_jbytes(start, _popframe_preserved_args, _popframe_preserved_args_size);
3230   }
3231 }
3232 
3233 void* JavaThread::popframe_preserved_args() {
3234   return _popframe_preserved_args;
3235 }
3236 
3237 ByteSize JavaThread::popframe_preserved_args_size() {
3238   return in_ByteSize(_popframe_preserved_args_size);


< prev index next >