hotspot/src/share/vm/runtime/vframe.cpp
changeset 46271 979ebd346ecf
parent 38133 78b95467b9f1
child 46327 91576389a517
equal deleted inserted replaced
46270:2e7898927798 46271:979ebd346ecf
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   153     }
   153     }
   154   }
   154   }
   155 }
   155 }
   156 
   156 
   157 void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) {
   157 void javaVFrame::print_lock_info_on(outputStream* st, int frame_count) {
   158   ResourceMark rm;
   158   Thread* THREAD = Thread::current();
       
   159   ResourceMark rm(THREAD);
   159 
   160 
   160   // If this is the first frame and it is java.lang.Object.wait(...)
   161   // If this is the first frame and it is java.lang.Object.wait(...)
   161   // then print out the receiver. Locals are not always available,
   162   // then print out the receiver. Locals are not always available,
   162   // e.g., compiled native frames have no scope so there are no locals.
   163   // e.g., compiled native frames have no scope so there are no locals.
   163   if (frame_count == 0) {
   164   if (frame_count == 0) {
   199         if (monitor->owner_is_scalar_replaced()) {
   200         if (monitor->owner_is_scalar_replaced()) {
   200           Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
   201           Klass* k = java_lang_Class::as_Klass(monitor->owner_klass());
   201           // format below for lockbits matches this one.
   202           // format below for lockbits matches this one.
   202           st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name());
   203           st->print("\t- eliminated <owner is scalar replaced> (a %s)", k->external_name());
   203         } else {
   204         } else {
   204           oop obj = monitor->owner();
   205           Handle obj(THREAD, monitor->owner());
   205           if (obj != NULL) {
   206           if (obj() != NULL) {
   206             print_locked_object_class_name(st, obj, "eliminated");
   207             print_locked_object_class_name(st, obj, "eliminated");
   207           }
   208           }
   208         }
   209         }
   209         continue;
   210         continue;
   210       }
   211       }
   250             // We own the monitor which is not as interesting so
   251             // We own the monitor which is not as interesting so
   251             // disable the extra printing below.
   252             // disable the extra printing below.
   252             mark = NULL;
   253             mark = NULL;
   253           }
   254           }
   254         }
   255         }
   255         print_locked_object_class_name(st, monitor->owner(), lock_state);
   256         print_locked_object_class_name(st, Handle(THREAD, monitor->owner()), lock_state);
   256         if (ObjectMonitor::Knob_Verbose && mark != NULL) {
   257         if (ObjectMonitor::Knob_Verbose && mark != NULL) {
   257           st->print("\t- lockbits=");
   258           st->print("\t- lockbits=");
   258           mark->print_on(st);
   259           mark->print_on(st);
   259           st->cr();
   260           st->cr();
   260         }
   261         }
   307          index < oop_mask.number_of_entries(), "invariant");
   308          index < oop_mask.number_of_entries(), "invariant");
   308 
   309 
   309   // categorize using oop_mask
   310   // categorize using oop_mask
   310   if (oop_mask.is_oop(index)) {
   311   if (oop_mask.is_oop(index)) {
   311     // reference (oop) "r"
   312     // reference (oop) "r"
   312     Handle h(addr != NULL ? (*(oop*)addr) : (oop)NULL);
   313     Handle h(Thread::current(), addr != NULL ? (*(oop*)addr) : (oop)NULL);
   313     return new StackValue(h);
   314     return new StackValue(h);
   314   }
   315   }
   315   // value (integer) "v"
   316   // value (integer) "v"
   316   return new StackValue(addr != NULL ? *addr : 0);
   317   return new StackValue(addr != NULL ? *addr : 0);
   317 }
   318 }