src/hotspot/share/code/pcDesc.cpp
changeset 54960 e46fe26d7f77
parent 47216 71c04702a3d5
equal deleted inserted replaced
54959:00425a850a2f 54960:e46fe26d7f77
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2019, 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.
    38 
    38 
    39 address PcDesc::real_pc(const CompiledMethod* code) const {
    39 address PcDesc::real_pc(const CompiledMethod* code) const {
    40   return code->code_begin() + pc_offset();
    40   return code->code_begin() + pc_offset();
    41 }
    41 }
    42 
    42 
    43 void PcDesc::print(CompiledMethod* code) {
    43 void PcDesc::print_on(outputStream* st, CompiledMethod* code) {
    44 #ifndef PRODUCT
    44 #ifndef PRODUCT
    45   ResourceMark rm;
    45   ResourceMark rm;
    46   tty->print_cr("PcDesc(pc=" PTR_FORMAT " offset=%x bits=%x):", p2i(real_pc(code)), pc_offset(), _flags);
    46   st->print("PcDesc(pc=" PTR_FORMAT " offset=%x bits=%x):", p2i(real_pc(code)), pc_offset(), _flags);
    47 
    47 
    48   if (scope_decode_offset() == DebugInformationRecorder::serialized_null) {
    48   if (scope_decode_offset() == DebugInformationRecorder::serialized_null) {
       
    49     st->cr();
    49     return;
    50     return;
    50   }
    51   }
       
    52 
       
    53   int tab = 8;
       
    54   int pos = st->position() + 2; // current column plus two spaces
       
    55   pos = ((pos+tab-1)/tab)*tab;
    51 
    56 
    52   for (ScopeDesc* sd = code->scope_desc_at(real_pc(code));
    57   for (ScopeDesc* sd = code->scope_desc_at(real_pc(code));
    53        sd != NULL;
    58        sd != NULL;
    54        sd = sd->sender()) {
    59        sd = sd->sender()) {
    55     sd->print_on(tty);
    60     sd->print_on(st);
    56   }
    61   }
    57 #endif
    62 #endif
    58 }
    63 }
    59 
    64 
    60 bool PcDesc::verify(CompiledMethod* code) {
    65 bool PcDesc::verify(CompiledMethod* code) {