src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
changeset 48821 8250a10cf60f
parent 48506 478e77658965
child 49449 ef5d5d343e2a
equal deleted inserted replaced
48820:9a411a9a17f0 48821:8250a10cf60f
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
     3  * Copyright (c) 2012, 2018 SAP SE. All rights reserved.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5  *
     5  *
     6  * This code is free software; you can redistribute it and/or modify it
     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
     7  * under the terms of the GNU General Public License version 2 only, as
     8  * published by the Free Software Foundation.
     8  * published by the Free Software Foundation.
   109 
   109 
   110 void os::Aix::ucontext_set_pc(ucontext_t* uc, address new_pc) {
   110 void os::Aix::ucontext_set_pc(ucontext_t* uc, address new_pc) {
   111   uc->uc_mcontext.jmp_context.iar = (uint64_t) new_pc;
   111   uc->uc_mcontext.jmp_context.iar = (uint64_t) new_pc;
   112 }
   112 }
   113 
   113 
       
   114 static address ucontext_get_lr(const ucontext_t * uc) {
       
   115   return (address)uc->uc_mcontext.jmp_context.lr;
       
   116 }
       
   117 
   114 ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
   118 ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
   115                                         intptr_t** ret_sp, intptr_t** ret_fp) {
   119                                         intptr_t** ret_sp, intptr_t** ret_fp) {
   116 
   120 
   117   ExtendedPC  epc;
   121   ExtendedPC  epc;
   118   const ucontext_t* uc = (const ucontext_t*)ucVoid;
   122   const ucontext_t* uc = (const ucontext_t*)ucVoid;
   165       // stack overflow handling. In compiled code, we bang before
   169       // stack overflow handling. In compiled code, we bang before
   166       // the frame is complete.
   170       // the frame is complete.
   167       return false;
   171       return false;
   168     } else {
   172     } else {
   169       intptr_t* sp = os::Aix::ucontext_get_sp(uc);
   173       intptr_t* sp = os::Aix::ucontext_get_sp(uc);
   170       *fr = frame(sp, (address)*sp);
   174       address lr = ucontext_get_lr(uc);
       
   175       *fr = frame(sp, lr);
   171       if (!fr->is_java_frame()) {
   176       if (!fr->is_java_frame()) {
   172         assert(fr->safe_for_sender(thread), "Safety check");
   177         assert(fr->safe_for_sender(thread), "Safety check");
   173         assert(!fr->is_first_frame(), "Safety check");
   178         assert(!fr->is_first_frame(), "Safety check");
   174         *fr = fr->java_sender();
   179         *fr = fr->java_sender();
   175       }
   180       }