< prev index next >

src/hotspot/cpu/aarch64/frame_aarch64.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.


 751       } else if (cb->name()) {
 752         printf("CodeBlob %s\n", cb->name());
 753       }
 754     }
 755   }
 756 }
 757 
 758 extern "C" void npf() {
 759   CodeBlob *cb = CodeCache::find_blob((address)nextpc);
 760   // C2 does not always chain the frame pointers when it can, instead
 761   // preferring to use fixed offsets from SP, so a simple leave() does
 762   // not work.  Instead, it adds the frame size to SP then pops FP and
 763   // LR.  We have to do the same thing to get a good call chain.
 764   if (cb && cb->frame_size())
 765     nextfp = nextsp + wordSize * (cb->frame_size() - 2);
 766   internal_pf (nextsp, nextfp, nextpc, -1);
 767 }
 768 
 769 extern "C" void pf(unsigned long sp, unsigned long fp, unsigned long pc,
 770                    unsigned long bcx, unsigned long thread) {

 771   if (!reg_map) {
 772     reg_map = NEW_C_HEAP_OBJ(RegisterMap, mtNone);
 773     ::new (reg_map) RegisterMap((JavaThread*)thread, false);
 774   } else {
 775     *reg_map = RegisterMap((JavaThread*)thread, false);
 776   }
 777 
 778   {
 779     CodeBlob *cb = CodeCache::find_blob((address)pc);
 780     if (cb && cb->frame_size())
 781       fp = sp + wordSize * (cb->frame_size() - 2);
 782   }
 783   internal_pf(sp, fp, pc, bcx);
 784 }
 785 
 786 // support for printing out where we are in a Java method
 787 // needs to be passed current fp and bcp register values
 788 // prints method name, bc index and bytecode name
 789 extern "C" void pm(unsigned long fp, unsigned long bcx) {
 790   DESCRIBE_FP_OFFSET(interpreter_frame_method);
 791   unsigned long *p = (unsigned long *)fp;
 792   Method* m = (Method*)p[frame::interpreter_frame_method_offset];
 793   printbc(m, bcx);
 794 }
 795 
 796 #ifndef PRODUCT
 797 // This is a generic constructor which is only used by pns() in debug.cpp.


   1 /*
   2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.


 751       } else if (cb->name()) {
 752         printf("CodeBlob %s\n", cb->name());
 753       }
 754     }
 755   }
 756 }
 757 
 758 extern "C" void npf() {
 759   CodeBlob *cb = CodeCache::find_blob((address)nextpc);
 760   // C2 does not always chain the frame pointers when it can, instead
 761   // preferring to use fixed offsets from SP, so a simple leave() does
 762   // not work.  Instead, it adds the frame size to SP then pops FP and
 763   // LR.  We have to do the same thing to get a good call chain.
 764   if (cb && cb->frame_size())
 765     nextfp = nextsp + wordSize * (cb->frame_size() - 2);
 766   internal_pf (nextsp, nextfp, nextpc, -1);
 767 }
 768 
 769 extern "C" void pf(unsigned long sp, unsigned long fp, unsigned long pc,
 770                    unsigned long bcx, unsigned long thread) {
 771   RegisterMap map((JavaThread*)thread, false);
 772   if (!reg_map) {
 773     reg_map = (RegisterMap*)os::malloc(sizeof map, mtNone);



 774   }
 775   memcpy(reg_map, &map, sizeof map);
 776   {
 777     CodeBlob *cb = CodeCache::find_blob((address)pc);
 778     if (cb && cb->frame_size())
 779       fp = sp + wordSize * (cb->frame_size() - 2);
 780   }
 781   internal_pf(sp, fp, pc, bcx);
 782 }
 783 
 784 // support for printing out where we are in a Java method
 785 // needs to be passed current fp and bcp register values
 786 // prints method name, bc index and bytecode name
 787 extern "C" void pm(unsigned long fp, unsigned long bcx) {
 788   DESCRIBE_FP_OFFSET(interpreter_frame_method);
 789   unsigned long *p = (unsigned long *)fp;
 790   Method* m = (Method*)p[frame::interpreter_frame_method_offset];
 791   printbc(m, bcx);
 792 }
 793 
 794 #ifndef PRODUCT
 795 // This is a generic constructor which is only used by pns() in debug.cpp.


< prev index next >