src/share/vm/code/scopeDesc.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6910618 Sdiff src/share/vm/code

src/share/vm/code/scopeDesc.cpp

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *
  23  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_scopeDesc.cpp.incl"
  27 
  28 
  29 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute) {
  30   _code          = code;
  31   _decode_offset = decode_offset;
  32   _objects       = decode_object_values(obj_decode_offset);
  33   _reexecute     = reexecute;

  34   decode_body();
  35 }
  36 
  37 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, bool reexecute) {
  38   _code          = code;
  39   _decode_offset = decode_offset;
  40   _objects       = decode_object_values(DebugInformationRecorder::serialized_null);
  41   _reexecute     = reexecute;

  42   decode_body();
  43 }
  44 
  45 
  46 ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
  47   _code          = parent->_code;
  48   _decode_offset = parent->_sender_decode_offset;
  49   _objects       = parent->_objects;
  50   _reexecute     = false; //reexecute only applies to the first scope

  51   decode_body();
  52 }
  53 
  54 
  55 void ScopeDesc::decode_body() {
  56   if (decode_offset() == DebugInformationRecorder::serialized_null) {
  57     // This is a sentinel record, which is only relevant to
  58     // approximate queries.  Decode a reasonable frame.
  59     _sender_decode_offset = DebugInformationRecorder::serialized_null;
  60     _method = methodHandle(_code->method());
  61     _bci = InvocationEntryBci;
  62     _locals_decode_offset = DebugInformationRecorder::serialized_null;
  63     _expressions_decode_offset = DebugInformationRecorder::serialized_null;
  64     _monitors_decode_offset = DebugInformationRecorder::serialized_null;
  65   } else {
  66     // decode header
  67     DebugInfoReadStream* stream  = stream_at(decode_offset());
  68 
  69     _sender_decode_offset = stream->read_int();
  70     _method = methodHandle((methodOop) stream->read_oop());


 158   }
 159 }
 160 
 161 void ScopeDesc::print_on(outputStream* st) const {
 162   print_on(st, NULL);
 163 }
 164 
 165 void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
 166   // header
 167   if (pd != NULL) {
 168     tty->print_cr("ScopeDesc(pc=" PTR_FORMAT " offset=%x):", pd->real_pc(_code), pd->pc_offset());
 169   }
 170 
 171   print_value_on(st);
 172   // decode offsets
 173   if (WizardMode) {
 174     st->print("ScopeDesc[%d]@" PTR_FORMAT " ", _decode_offset, _code->instructions_begin());
 175     st->print_cr(" offset:     %d",    _decode_offset);
 176     st->print_cr(" bci:        %d",    bci());
 177     st->print_cr(" reexecute:  %s",    should_reexecute() ? "true" : "false");

 178     st->print_cr(" locals:     %d",    _locals_decode_offset);
 179     st->print_cr(" stack:      %d",    _expressions_decode_offset);
 180     st->print_cr(" monitor:    %d",    _monitors_decode_offset);
 181     st->print_cr(" sender:     %d",    _sender_decode_offset);
 182   }
 183   // locals
 184   { GrowableArray<ScopeValue*>* l = ((ScopeDesc*) this)->locals();
 185     if (l != NULL) {
 186       tty->print_cr("   Locals");
 187       for (int index = 0; index < l->length(); index++) {
 188         st->print("    - l%d: ", index);
 189         l->at(index)->print_on(st);
 190         st->cr();
 191       }
 192     }
 193   }
 194   // expressions
 195   { GrowableArray<ScopeValue*>* l = ((ScopeDesc*) this)->expressions();
 196     if (l != NULL) {
 197       st->print_cr("   Expression stack");




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *
  23  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_scopeDesc.cpp.incl"
  27 
  28 
  29 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop) {
  30   _code          = code;
  31   _decode_offset = decode_offset;
  32   _objects       = decode_object_values(obj_decode_offset);
  33   _reexecute     = reexecute;
  34   _return_oop    = return_oop;
  35   decode_body();
  36 }
  37 
  38 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool return_oop) {
  39   _code          = code;
  40   _decode_offset = decode_offset;
  41   _objects       = decode_object_values(DebugInformationRecorder::serialized_null);
  42   _reexecute     = reexecute;
  43   _return_oop    = return_oop;
  44   decode_body();
  45 }
  46 
  47 
  48 ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
  49   _code          = parent->_code;
  50   _decode_offset = parent->_sender_decode_offset;
  51   _objects       = parent->_objects;
  52   _reexecute     = false; //reexecute only applies to the first scope
  53   _return_oop    = false;
  54   decode_body();
  55 }
  56 
  57 
  58 void ScopeDesc::decode_body() {
  59   if (decode_offset() == DebugInformationRecorder::serialized_null) {
  60     // This is a sentinel record, which is only relevant to
  61     // approximate queries.  Decode a reasonable frame.
  62     _sender_decode_offset = DebugInformationRecorder::serialized_null;
  63     _method = methodHandle(_code->method());
  64     _bci = InvocationEntryBci;
  65     _locals_decode_offset = DebugInformationRecorder::serialized_null;
  66     _expressions_decode_offset = DebugInformationRecorder::serialized_null;
  67     _monitors_decode_offset = DebugInformationRecorder::serialized_null;
  68   } else {
  69     // decode header
  70     DebugInfoReadStream* stream  = stream_at(decode_offset());
  71 
  72     _sender_decode_offset = stream->read_int();
  73     _method = methodHandle((methodOop) stream->read_oop());


 161   }
 162 }
 163 
 164 void ScopeDesc::print_on(outputStream* st) const {
 165   print_on(st, NULL);
 166 }
 167 
 168 void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
 169   // header
 170   if (pd != NULL) {
 171     tty->print_cr("ScopeDesc(pc=" PTR_FORMAT " offset=%x):", pd->real_pc(_code), pd->pc_offset());
 172   }
 173 
 174   print_value_on(st);
 175   // decode offsets
 176   if (WizardMode) {
 177     st->print("ScopeDesc[%d]@" PTR_FORMAT " ", _decode_offset, _code->instructions_begin());
 178     st->print_cr(" offset:     %d",    _decode_offset);
 179     st->print_cr(" bci:        %d",    bci());
 180     st->print_cr(" reexecute:  %s",    should_reexecute() ? "true" : "false");
 181     st->print_cr(" return_oop: %s",    return_oop() ? "true" : "false");
 182     st->print_cr(" locals:     %d",    _locals_decode_offset);
 183     st->print_cr(" stack:      %d",    _expressions_decode_offset);
 184     st->print_cr(" monitor:    %d",    _monitors_decode_offset);
 185     st->print_cr(" sender:     %d",    _sender_decode_offset);
 186   }
 187   // locals
 188   { GrowableArray<ScopeValue*>* l = ((ScopeDesc*) this)->locals();
 189     if (l != NULL) {
 190       tty->print_cr("   Locals");
 191       for (int index = 0; index < l->length(); index++) {
 192         st->print("    - l%d: ", index);
 193         l->at(index)->print_on(st);
 194         st->cr();
 195       }
 196     }
 197   }
 198   // expressions
 199   { GrowableArray<ScopeValue*>* l = ((ScopeDesc*) this)->expressions();
 200     if (l != NULL) {
 201       st->print_cr("   Expression stack");


src/share/vm/code/scopeDesc.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File