author | valeriep |
Fri, 29 Mar 2019 00:39:49 +0000 | |
changeset 54333 | 2a29e62446bd |
parent 53605 | 853c68ff2ed7 |
child 55490 | 3f3dc00a69a5 |
child 58678 | 9cf78a70fa4f |
permissions | -rw-r--r-- |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
1 |
/* |
48821
8250a10cf60f
8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
mdoerr
parents:
48506
diff
changeset
|
2 |
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
8250a10cf60f
8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
mdoerr
parents:
48506
diff
changeset
|
3 |
* Copyright (c) 2012, 2018 SAP SE. All rights reserved. |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
5 |
* |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
6 |
* This code is free software; you can redistribute it and/or modify it |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
8 |
* published by the Free Software Foundation. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
9 |
* |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
14 |
* accompanied this code). |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
15 |
* |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License version |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
19 |
* |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
22 |
* questions. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
23 |
* |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
24 |
*/ |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
25 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
26 |
// no precompiled headers |
47765
b7c7428eaab9
8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot
coleenp
parents:
47216
diff
changeset
|
27 |
#include "jvm.h" |
38931
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
28 |
#include "asm/assembler.inline.hpp" |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
29 |
#include "classfile/classLoader.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
30 |
#include "classfile/systemDictionary.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
31 |
#include "classfile/vmSymbols.hpp" |
34667 | 32 |
#include "code/codeCache.hpp" |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
33 |
#include "code/icBuffer.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
34 |
#include "code/vtableStubs.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
35 |
#include "interpreter/interpreter.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
36 |
#include "memory/allocation.inline.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
37 |
#include "nativeInst_ppc.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
38 |
#include "os_share_aix.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
39 |
#include "prims/jniFastGetField.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
40 |
#include "prims/jvm_misc.hpp" |
35515
179755aaa4e0
8145184: [aix] Implement os::platform_print_native_stack on AIX
stuefe
parents:
35201
diff
changeset
|
41 |
#include "porting_aix.hpp" |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
42 |
#include "runtime/arguments.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
43 |
#include "runtime/extendedPC.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
44 |
#include "runtime/frame.inline.hpp" |
49449
ef5d5d343e2a
8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents:
48821
diff
changeset
|
45 |
#include "runtime/interfaceSupport.inline.hpp" |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
46 |
#include "runtime/java.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
47 |
#include "runtime/javaCalls.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
48 |
#include "runtime/mutexLocker.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
49 |
#include "runtime/osThread.hpp" |
48506
478e77658965
8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP
mdoerr
parents:
47765
diff
changeset
|
50 |
#include "runtime/safepointMechanism.hpp" |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
51 |
#include "runtime/sharedRuntime.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
52 |
#include "runtime/stubRoutines.hpp" |
23492 | 53 |
#include "runtime/thread.inline.hpp" |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
54 |
#include "runtime/timer.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
55 |
#include "utilities/events.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
56 |
#include "utilities/vmError.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
57 |
#ifdef COMPILER1 |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
58 |
#include "c1/c1_Runtime1.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
59 |
#endif |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
60 |
#ifdef COMPILER2 |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
61 |
#include "opto/runtime.hpp" |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
62 |
#endif |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
63 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
64 |
// put OS-includes here |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
65 |
# include <ucontext.h> |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
66 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
67 |
address os::current_stack_pointer() { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
68 |
address csp; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
69 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
70 |
#if !defined(USE_XLC_BUILTINS) |
22861 | 71 |
// inline assembly for `mr regno(csp), R1_SP': |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
72 |
__asm__ __volatile__ ("mr %0, 1":"=r"(csp):); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
73 |
#else |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
74 |
csp = (address) __builtin_frame_address(0); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
75 |
#endif |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
76 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
77 |
return csp; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
78 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
79 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
80 |
char* os::non_memory_address_word() { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
81 |
// Must never look like an address returned by reserve_memory, |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
82 |
// even in its subfields (as defined by the CPU immediate fields, |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
83 |
// if the CPU splits constants across multiple instructions). |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
84 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
85 |
return (char*) -1; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
86 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
87 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
88 |
// Frame information (pc, sp, fp) retrieved via ucontext |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
89 |
// always looks like a C-frame according to the frame |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
26582
diff
changeset
|
90 |
// conventions in frame_ppc.hpp. |
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
26582
diff
changeset
|
91 |
|
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
26582
diff
changeset
|
92 |
address os::Aix::ucontext_get_pc(const ucontext_t * uc) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
93 |
return (address)uc->uc_mcontext.jmp_context.iar; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
94 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
95 |
|
35077
8b86440d3bf1
8145114: const-correctness for ucontext_t* reading functions
stuefe
parents:
35076
diff
changeset
|
96 |
intptr_t* os::Aix::ucontext_get_sp(const ucontext_t * uc) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
97 |
// gpr1 holds the stack pointer on aix |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
98 |
return (intptr_t*)uc->uc_mcontext.jmp_context.gpr[1/*REG_SP*/]; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
99 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
100 |
|
35077
8b86440d3bf1
8145114: const-correctness for ucontext_t* reading functions
stuefe
parents:
35076
diff
changeset
|
101 |
intptr_t* os::Aix::ucontext_get_fp(const ucontext_t * uc) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
102 |
return NULL; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
103 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
104 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
105 |
void os::Aix::ucontext_set_pc(ucontext_t* uc, address new_pc) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
106 |
uc->uc_mcontext.jmp_context.iar = (uint64_t) new_pc; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
107 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
108 |
|
48821
8250a10cf60f
8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
mdoerr
parents:
48506
diff
changeset
|
109 |
static address ucontext_get_lr(const ucontext_t * uc) { |
8250a10cf60f
8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
mdoerr
parents:
48506
diff
changeset
|
110 |
return (address)uc->uc_mcontext.jmp_context.lr; |
8250a10cf60f
8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
mdoerr
parents:
48506
diff
changeset
|
111 |
} |
8250a10cf60f
8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
mdoerr
parents:
48506
diff
changeset
|
112 |
|
35077
8b86440d3bf1
8145114: const-correctness for ucontext_t* reading functions
stuefe
parents:
35076
diff
changeset
|
113 |
ExtendedPC os::fetch_frame_from_context(const void* ucVoid, |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
114 |
intptr_t** ret_sp, intptr_t** ret_fp) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
115 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
116 |
ExtendedPC epc; |
35077
8b86440d3bf1
8145114: const-correctness for ucontext_t* reading functions
stuefe
parents:
35076
diff
changeset
|
117 |
const ucontext_t* uc = (const ucontext_t*)ucVoid; |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
118 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
119 |
if (uc != NULL) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
120 |
epc = ExtendedPC(os::Aix::ucontext_get_pc(uc)); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
121 |
if (ret_sp) *ret_sp = os::Aix::ucontext_get_sp(uc); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
122 |
if (ret_fp) *ret_fp = os::Aix::ucontext_get_fp(uc); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
123 |
} else { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
124 |
// construct empty ExtendedPC for return value checking |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
125 |
epc = ExtendedPC(NULL); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
126 |
if (ret_sp) *ret_sp = (intptr_t *)NULL; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
127 |
if (ret_fp) *ret_fp = (intptr_t *)NULL; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
128 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
129 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
130 |
return epc; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
131 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
132 |
|
35077
8b86440d3bf1
8145114: const-correctness for ucontext_t* reading functions
stuefe
parents:
35076
diff
changeset
|
133 |
frame os::fetch_frame_from_context(const void* ucVoid) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
134 |
intptr_t* sp; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
135 |
intptr_t* fp; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
136 |
ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
137 |
// Avoid crash during crash if pc broken. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
138 |
if (epc.pc()) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
139 |
frame fr(sp, epc.pc()); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
140 |
return fr; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
141 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
142 |
frame fr(sp); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
143 |
return fr; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
144 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
145 |
|
38931
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
146 |
bool os::Aix::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
147 |
address pc = (address) os::Aix::ucontext_get_pc(uc); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
148 |
if (Interpreter::contains(pc)) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
149 |
// Interpreter performs stack banging after the fixed frame header has |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
150 |
// been generated while the compilers perform it before. To maintain |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
151 |
// semantic consistency between interpreted and compiled frames, the |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
152 |
// method returns the Java sender of the current frame. |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
153 |
*fr = os::fetch_frame_from_context(uc); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
154 |
if (!fr->is_first_java_frame()) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
155 |
assert(fr->safe_for_sender(thread), "Safety check"); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
156 |
*fr = fr->java_sender(); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
157 |
} |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
158 |
} else { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
159 |
// More complex code with compiled code. |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
160 |
assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
161 |
CodeBlob* cb = CodeCache::find_blob(pc); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
162 |
if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
163 |
// Not sure where the pc points to, fallback to default |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
164 |
// stack overflow handling. In compiled code, we bang before |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
165 |
// the frame is complete. |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
166 |
return false; |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
167 |
} else { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
168 |
intptr_t* sp = os::Aix::ucontext_get_sp(uc); |
48821
8250a10cf60f
8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
mdoerr
parents:
48506
diff
changeset
|
169 |
address lr = ucontext_get_lr(uc); |
8250a10cf60f
8196401: PPC64+s390: get_frame_at_stack_banging_point uses wrong PC
mdoerr
parents:
48506
diff
changeset
|
170 |
*fr = frame(sp, lr); |
38931
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
171 |
if (!fr->is_java_frame()) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
172 |
assert(fr->safe_for_sender(thread), "Safety check"); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
173 |
assert(!fr->is_first_frame(), "Safety check"); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
174 |
*fr = fr->java_sender(); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
175 |
} |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
176 |
} |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
177 |
} |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
178 |
assert(fr->is_java_frame(), "Safety check"); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
179 |
return true; |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
180 |
} |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
181 |
|
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
182 |
frame os::get_sender_for_C_frame(frame* fr) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
183 |
if (*fr->sp() == NULL) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
184 |
// fr is the last C frame |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
185 |
return frame(NULL, NULL); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
186 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
187 |
return frame(fr->sender_sp(), fr->sender_pc()); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
188 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
189 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
190 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
191 |
frame os::current_frame() { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
192 |
intptr_t* csp = (intptr_t*) *((intptr_t*) os::current_stack_pointer()); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
193 |
// hack. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
194 |
frame topframe(csp, (address)0x8); |
41086
06b10263e509
8165315: [ppc] Port "8133749: NMT detail stack trace cleanup"
goetz
parents:
41070
diff
changeset
|
195 |
// Return sender of sender of current topframe which hopefully |
06b10263e509
8165315: [ppc] Port "8133749: NMT detail stack trace cleanup"
goetz
parents:
41070
diff
changeset
|
196 |
// both have pc != NULL. |
06b10263e509
8165315: [ppc] Port "8133749: NMT detail stack trace cleanup"
goetz
parents:
41070
diff
changeset
|
197 |
frame tmp = os::get_sender_for_C_frame(&topframe); |
06b10263e509
8165315: [ppc] Port "8133749: NMT detail stack trace cleanup"
goetz
parents:
41070
diff
changeset
|
198 |
return os::get_sender_for_C_frame(&tmp); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
199 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
200 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
201 |
// Utility functions |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
202 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
203 |
extern "C" JNIEXPORT int |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
204 |
JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
205 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
206 |
ucontext_t* uc = (ucontext_t*) ucVoid; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
207 |
|
34633
2a6c7c7b30a7
8132510: Replace ThreadLocalStorage with compiler/language-based thread-local variables
dholmes
parents:
33105
diff
changeset
|
208 |
Thread* t = Thread::current_or_null_safe(); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
209 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
210 |
SignalHandlerMark shm(t); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
211 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
212 |
// Note: it's not uncommon that JNI code uses signal/sigset to install |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
213 |
// then restore certain signal handler (e.g. to temporarily block SIGPIPE, |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
214 |
// or have a SIGILL handler when detecting CPU type). When that happens, |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
215 |
// JVM_handle_aix_signal() might be invoked with junk info/ucVoid. To |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
216 |
// avoid unnecessary crash when libjsig is not preloaded, try handle signals |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
217 |
// that do not require siginfo/ucontext first. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
218 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
219 |
if (sig == SIGPIPE) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
220 |
if (os::Aix::chained_handler(sig, info, ucVoid)) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
221 |
return 1; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
222 |
} else { |
37430
fd743dadef12
8151939: VM_Version_init() print buffer is too small
coleenp
parents:
35606
diff
changeset
|
223 |
// Ignoring SIGPIPE - see bugs 4229104 |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
224 |
return 1; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
225 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
226 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
227 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
228 |
JavaThread* thread = NULL; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
229 |
VMThread* vmthread = NULL; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
230 |
if (os::Aix::signal_handlers_are_installed) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
231 |
if (t != NULL) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
232 |
if(t->is_Java_thread()) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
233 |
thread = (JavaThread*)t; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
234 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
235 |
else if(t->is_VM_thread()) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
236 |
vmthread = (VMThread *)t; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
237 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
238 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
239 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
240 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
241 |
// Decide if this trap can be handled by a stub. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
242 |
address stub = NULL; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
243 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
244 |
// retrieve program counter |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
245 |
address const pc = uc ? os::Aix::ucontext_get_pc(uc) : NULL; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
246 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
247 |
// retrieve crash address |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
248 |
address const addr = info ? (const address) info->si_addr : NULL; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
249 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
250 |
// SafeFetch 32 handling: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
251 |
// - make it work if _thread is null |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
252 |
// - make it use the standard os::...::ucontext_get/set_pc APIs |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
253 |
if (uc) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
254 |
address const pc = os::Aix::ucontext_get_pc(uc); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
255 |
if (pc && StubRoutines::is_safefetch_fault(pc)) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
256 |
os::Aix::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc)); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
257 |
return true; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
258 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
259 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
260 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
261 |
if (info == NULL || uc == NULL || thread == NULL && vmthread == NULL) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
262 |
goto run_chained_handler; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
263 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
264 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
265 |
// If we are a java thread... |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
266 |
if (thread != NULL) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
267 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
268 |
// Handle ALL stack overflow variations here |
35201
996db89f378e
8139864: Improve handling of stack protection zones.
goetz
parents:
35077
diff
changeset
|
269 |
if (sig == SIGSEGV && thread->on_local_stack(addr)) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
270 |
// stack overflow |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
271 |
// |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
272 |
// If we are in a yellow zone and we are inside java, we disable the yellow zone and |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
273 |
// throw a stack overflow exception. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
274 |
// If we are in native code or VM C code, we report-and-die. The original coding tried |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
275 |
// to continue with yellow zone disabled, but that doesn't buy us much and prevents |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
276 |
// hs_err_pid files. |
35201
996db89f378e
8139864: Improve handling of stack protection zones.
goetz
parents:
35077
diff
changeset
|
277 |
if (thread->in_stack_yellow_reserved_zone(addr)) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
278 |
if (thread->thread_state() == _thread_in_Java) { |
38931
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
279 |
if (thread->in_stack_reserved_zone(addr)) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
280 |
frame fr; |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
281 |
if (os::Aix::get_frame_at_stack_banging_point(thread, uc, &fr)) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
282 |
assert(fr.is_java_frame(), "Must be a Javac frame"); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
283 |
frame activation = |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
284 |
SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
285 |
if (activation.sp() != NULL) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
286 |
thread->disable_stack_reserved_zone(); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
287 |
if (activation.is_interpreted_frame()) { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
288 |
thread->set_reserved_stack_activation((address)activation.fp()); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
289 |
} else { |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
290 |
thread->set_reserved_stack_activation((address)activation.unextended_sp()); |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
291 |
} |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
292 |
return 1; |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
293 |
} |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
294 |
} |
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
295 |
} |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
296 |
// Throw a stack overflow exception. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
297 |
// Guard pages will be reenabled while unwinding the stack. |
38931
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
298 |
thread->disable_stack_yellow_reserved_zone(); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
299 |
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
300 |
goto run_stub; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
301 |
} else { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
302 |
// Thread was in the vm or native code. Return and try to finish. |
38931
3cf28d630349
8156923: [ppc] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
goetz
parents:
38209
diff
changeset
|
303 |
thread->disable_stack_yellow_reserved_zone(); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
304 |
return 1; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
305 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
306 |
} else if (thread->in_stack_red_zone(addr)) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
307 |
// Fatal red zone violation. Disable the guard pages and fall through |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
308 |
// to handle_unexpected_exception way down below. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
309 |
thread->disable_stack_red_zone(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
310 |
tty->print_raw_cr("An irrecoverable stack overflow has occurred."); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
311 |
goto report_and_die; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
312 |
} else { |
22861 | 313 |
// This means a segv happened inside our stack, but not in |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
314 |
// the guarded zone. I'd like to know when this happens, |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
315 |
tty->print_raw_cr("SIGSEGV happened inside stack but outside yellow and red zone."); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
316 |
goto report_and_die; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
317 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
318 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
319 |
} // end handle SIGSEGV inside stack boundaries |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
320 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
321 |
if (thread->thread_state() == _thread_in_Java) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
322 |
// Java thread running in Java code |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
323 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
324 |
// The following signals are used for communicating VM events: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
325 |
// |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
326 |
// SIGILL: the compiler generates illegal opcodes |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
327 |
// at places where it wishes to interrupt the VM: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
328 |
// Safepoints, Unreachable Code, Entry points of Zombie methods, |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
329 |
// This results in a SIGILL with (*pc) == inserted illegal instruction. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
330 |
// |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
331 |
// (so, SIGILLs with a pc inside the zero page are real errors) |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
332 |
// |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
333 |
// SIGTRAP: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
334 |
// The ppc trap instruction raises a SIGTRAP and is very efficient if it |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
335 |
// does not trap. It is used for conditional branches that are expected |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
336 |
// to be never taken. These are: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
337 |
// - zombie methods |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
338 |
// - IC (inline cache) misses. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
339 |
// - null checks leading to UncommonTraps. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
340 |
// - range checks leading to Uncommon Traps. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
341 |
// On Aix, these are especially null checks, as the ImplicitNullCheck |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
342 |
// optimization works only in rare cases, as the page at address 0 is only |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
343 |
// write protected. // |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
344 |
// Note: !UseSIGTRAP is used to prevent SIGTRAPS altogether, to facilitate debugging. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
345 |
// |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
346 |
// SIGSEGV: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
347 |
// used for safe point polling: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
348 |
// To notify all threads that they have to reach a safe point, safe point polling is used: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
349 |
// All threads poll a certain mapped memory page. Normally, this page has read access. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
350 |
// If the VM wants to inform the threads about impending safe points, it puts this |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
351 |
// page to read only ("poisens" the page), and the threads then reach a safe point. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
352 |
// used for null checks: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
353 |
// If the compiler finds a store it uses it for a null check. Unfortunately this |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
354 |
// happens rarely. In heap based and disjoint base compressd oop modes also loads |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
355 |
// are used for null checks. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
356 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
357 |
// A VM-related SIGILL may only occur if we are not in the zero page. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
358 |
// On AIX, we get a SIGILL if we jump to 0x0 or to somewhere else |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
359 |
// in the zero page, because it is filled with 0x0. We ignore |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
360 |
// explicit SIGILLs in the zero page. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
361 |
if (sig == SIGILL && (pc < (address) 0x200)) { |
22861 | 362 |
if (TraceTraps) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
363 |
tty->print_raw_cr("SIGILL happened inside zero page."); |
22861 | 364 |
} |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
365 |
goto report_and_die; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
366 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
367 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
368 |
// Handle signal from NativeJump::patch_verified_entry(). |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
369 |
if (( TrapBasedNotEntrantChecks && sig == SIGTRAP && nativeInstruction_at(pc)->is_sigtrap_zombie_not_entrant()) || |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
370 |
(!TrapBasedNotEntrantChecks && sig == SIGILL && nativeInstruction_at(pc)->is_sigill_zombie_not_entrant())) { |
22861 | 371 |
if (TraceTraps) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
372 |
tty->print_cr("trap: zombie_not_entrant (%s)", (sig == SIGTRAP) ? "SIGTRAP" : "SIGILL"); |
22861 | 373 |
} |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
374 |
stub = SharedRuntime::get_handle_wrong_method_stub(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
375 |
goto run_stub; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
376 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
377 |
|
48506
478e77658965
8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP
mdoerr
parents:
47765
diff
changeset
|
378 |
else if ((SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) |
478e77658965
8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP
mdoerr
parents:
47765
diff
changeset
|
379 |
? (sig == SIGTRAP && ((NativeInstruction*)pc)->is_safepoint_poll()) |
478e77658965
8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP
mdoerr
parents:
47765
diff
changeset
|
380 |
: (sig == SIGSEGV && os::is_poll_address(addr))) { |
22861 | 381 |
if (TraceTraps) { |
48506
478e77658965
8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP
mdoerr
parents:
47765
diff
changeset
|
382 |
tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (%s)", p2i(pc), |
478e77658965
8194258: PPC64 safepoint mechanism: Fix initialization on AIX and support SIGTRAP
mdoerr
parents:
47765
diff
changeset
|
383 |
(SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? "SIGTRAP" : "SIGSEGV"); |
22861 | 384 |
} |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
385 |
stub = SharedRuntime::get_poll_stub(pc); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
386 |
goto run_stub; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
387 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
388 |
|
22861 | 389 |
// SIGTRAP-based ic miss check in compiled code. |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
390 |
else if (sig == SIGTRAP && TrapBasedICMissChecks && |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
391 |
nativeInstruction_at(pc)->is_sigtrap_ic_miss_check()) { |
22861 | 392 |
if (TraceTraps) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
393 |
tty->print_cr("trap: ic_miss_check at " INTPTR_FORMAT " (SIGTRAP)", pc); |
22861 | 394 |
} |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
395 |
stub = SharedRuntime::get_ic_miss_stub(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
396 |
goto run_stub; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
397 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
398 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
399 |
// SIGTRAP-based implicit null check in compiled code. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
400 |
else if (sig == SIGTRAP && TrapBasedNullChecks && |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
401 |
nativeInstruction_at(pc)->is_sigtrap_null_check()) { |
22861 | 402 |
if (TraceTraps) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
403 |
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGTRAP)", pc); |
22861 | 404 |
} |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
405 |
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
406 |
goto run_stub; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
407 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
408 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
409 |
// SIGSEGV-based implicit null check in compiled code. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
410 |
else if (sig == SIGSEGV && ImplicitNullChecks && |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
411 |
CodeCache::contains((void*) pc) && |
52462
4ad404da0088
8213199: GC abstraction for Assembler::needs_explicit_null_check()
rkennke
parents:
52460
diff
changeset
|
412 |
MacroAssembler::uses_implicit_null_check(info->si_addr)) { |
22861 | 413 |
if (TraceTraps) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
414 |
tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc); |
22861 | 415 |
} |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
416 |
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
417 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
418 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
419 |
#ifdef COMPILER2 |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
420 |
// SIGTRAP-based implicit range check in compiled code. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
421 |
else if (sig == SIGTRAP && TrapBasedRangeChecks && |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
422 |
nativeInstruction_at(pc)->is_sigtrap_range_check()) { |
22861 | 423 |
if (TraceTraps) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
424 |
tty->print_cr("trap: range_check at " INTPTR_FORMAT " (SIGTRAP)", pc); |
22861 | 425 |
} |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
426 |
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
427 |
goto run_stub; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
428 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
429 |
#endif |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
430 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
431 |
else if (sig == SIGFPE /* && info->si_code == FPE_INTDIV */) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
432 |
if (TraceTraps) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
433 |
tty->print_raw_cr("Fix SIGFPE handler, trying divide by zero handler."); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
434 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
435 |
stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
436 |
goto run_stub; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
437 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
438 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
439 |
else if (sig == SIGBUS) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
440 |
// BugId 4454115: A read from a MappedByteBuffer can fault here if the |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
441 |
// underlying file has been truncated. Do not crash the VM in such a case. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
442 |
CodeBlob* cb = CodeCache::find_blob_unsafe(pc); |
38133
78b95467b9f1
8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents:
37430
diff
changeset
|
443 |
CompiledMethod* nm = cb->as_compiled_method_or_null(); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
444 |
if (nm != NULL && nm->has_unsafe_access()) { |
38209
b2a58604e046
8156088: Reintegrate 8153892: Handle unsafe access error directly in signal handler instead of going through a stub
mikael
parents:
38190
diff
changeset
|
445 |
address next_pc = pc + 4; |
b2a58604e046
8156088: Reintegrate 8153892: Handle unsafe access error directly in signal handler instead of going through a stub
mikael
parents:
38190
diff
changeset
|
446 |
next_pc = SharedRuntime::handle_unsafe_access(thread, next_pc); |
b2a58604e046
8156088: Reintegrate 8153892: Handle unsafe access error directly in signal handler instead of going through a stub
mikael
parents:
38190
diff
changeset
|
447 |
os::Aix::ucontext_set_pc(uc, next_pc); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
448 |
return 1; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
449 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
450 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
451 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
452 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
453 |
else { // thread->thread_state() != _thread_in_Java |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
454 |
// Detect CPU features. This is only done at the very start of the VM. Later, the |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
455 |
// VM_Version::is_determine_features_test_running() flag should be false. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
456 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
457 |
if (sig == SIGILL && VM_Version::is_determine_features_test_running()) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
458 |
// SIGILL must be caused by VM_Version::determine_features(). |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
459 |
*(int *)pc = 0; // patch instruction to 0 to indicate that it causes a SIGILL, |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
460 |
// flushing of icache is not necessary. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
461 |
stub = pc + 4; // continue with next instruction. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
462 |
goto run_stub; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
463 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
464 |
else if (thread->thread_state() == _thread_in_vm && |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
465 |
sig == SIGBUS && thread->doing_unsafe_access()) { |
38209
b2a58604e046
8156088: Reintegrate 8153892: Handle unsafe access error directly in signal handler instead of going through a stub
mikael
parents:
38190
diff
changeset
|
466 |
address next_pc = pc + 4; |
b2a58604e046
8156088: Reintegrate 8153892: Handle unsafe access error directly in signal handler instead of going through a stub
mikael
parents:
38190
diff
changeset
|
467 |
next_pc = SharedRuntime::handle_unsafe_access(thread, next_pc); |
b2a58604e046
8156088: Reintegrate 8153892: Handle unsafe access error directly in signal handler instead of going through a stub
mikael
parents:
38190
diff
changeset
|
468 |
os::Aix::ucontext_set_pc(uc, next_pc); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
469 |
return 1; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
470 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
471 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
472 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
473 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
474 |
run_stub: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
475 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
476 |
// One of the above code blocks ininitalized the stub, so we want to |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
477 |
// delegate control to that stub. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
478 |
if (stub != NULL) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
479 |
// Save all thread context in case we need to restore it. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
480 |
if (thread != NULL) thread->set_saved_exception_pc(pc); |
29573
2d800e5d575f
8074552: SafeFetch32 and SafeFetchN do not work in error handling
dholmes
parents:
28187
diff
changeset
|
481 |
os::Aix::ucontext_set_pc(uc, stub); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
482 |
return 1; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
483 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
484 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
485 |
run_chained_handler: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
486 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
487 |
// signal-chaining |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
488 |
if (os::Aix::chained_handler(sig, info, ucVoid)) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
489 |
return 1; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
490 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
491 |
if (!abort_if_unrecognized) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
492 |
// caller wants another chance, so give it to him |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
493 |
return 0; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
494 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
495 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
496 |
report_and_die: |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
497 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
498 |
// Use sigthreadmask instead of sigprocmask on AIX and unmask current signal. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
499 |
sigset_t newset; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
500 |
sigemptyset(&newset); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
501 |
sigaddset(&newset, sig); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
502 |
sigthreadmask(SIG_UNBLOCK, &newset, NULL); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
503 |
|
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
32080
diff
changeset
|
504 |
VMError::report_and_die(t, sig, pc, info, ucVoid); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
505 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
506 |
ShouldNotReachHere(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
507 |
return 0; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
508 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
509 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
510 |
void os::Aix::init_thread_fpu_state(void) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
511 |
#if !defined(USE_XLC_BUILTINS) |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
512 |
// Disable FP exceptions. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
513 |
__asm__ __volatile__ ("mtfsfi 6,0"); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
514 |
#else |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
515 |
__mtfsfi(6, 0); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
516 |
#endif |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
517 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
518 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
519 |
//////////////////////////////////////////////////////////////////////////////// |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
520 |
// thread stack |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
521 |
|
42906
1a8db9cf1407
8170655: [posix] Fix minimum stack size computations
goetz
parents:
42905
diff
changeset
|
522 |
// Minimum usable stack sizes required to get to user code. Space for |
1a8db9cf1407
8170655: [posix] Fix minimum stack size computations
goetz
parents:
42905
diff
changeset
|
523 |
// HotSpot guard pages is added later. |
1a8db9cf1407
8170655: [posix] Fix minimum stack size computations
goetz
parents:
42905
diff
changeset
|
524 |
size_t os::Posix::_compiler_thread_min_stack_allowed = 192 * K; |
1a8db9cf1407
8170655: [posix] Fix minimum stack size computations
goetz
parents:
42905
diff
changeset
|
525 |
size_t os::Posix::_java_thread_min_stack_allowed = 64 * K; |
1a8db9cf1407
8170655: [posix] Fix minimum stack size computations
goetz
parents:
42905
diff
changeset
|
526 |
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K; |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
527 |
|
42905 | 528 |
// Return default stack size for thr_type. |
41070
496463b4e206
8140520: segfault on solaris-amd64 with "-XX:VMThreadStackSize=1" option
rdurbin
parents:
40010
diff
changeset
|
529 |
size_t os::Posix::default_stack_size(os::ThreadType thr_type) { |
42905 | 530 |
// Default stack size (compiler thread needs larger stack). |
28187
fc19df82d6ee
8066964: ppc64: argument and return type profiling, fix problem with popframe
goetz
parents:
26582
diff
changeset
|
531 |
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
532 |
return s; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
533 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
534 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
535 |
///////////////////////////////////////////////////////////////////////////// |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
536 |
// helper functions for fatal error handler |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
537 |
|
35077
8b86440d3bf1
8145114: const-correctness for ucontext_t* reading functions
stuefe
parents:
35076
diff
changeset
|
538 |
void os::print_context(outputStream *st, const void *context) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
539 |
if (context == NULL) return; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
540 |
|
35077
8b86440d3bf1
8145114: const-correctness for ucontext_t* reading functions
stuefe
parents:
35076
diff
changeset
|
541 |
const ucontext_t* uc = (const ucontext_t*)context; |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
542 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
543 |
st->print_cr("Registers:"); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
544 |
st->print("pc =" INTPTR_FORMAT " ", uc->uc_mcontext.jmp_context.iar); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
545 |
st->print("lr =" INTPTR_FORMAT " ", uc->uc_mcontext.jmp_context.lr); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
546 |
st->print("ctr=" INTPTR_FORMAT " ", uc->uc_mcontext.jmp_context.ctr); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
547 |
st->cr(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
548 |
for (int i = 0; i < 32; i++) { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
549 |
st->print("r%-2d=" INTPTR_FORMAT " ", i, uc->uc_mcontext.jmp_context.gpr[i]); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
550 |
if (i % 3 == 2) st->cr(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
551 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
552 |
st->cr(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
553 |
st->cr(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
554 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
555 |
intptr_t *sp = (intptr_t *)os::Aix::ucontext_get_sp(uc); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
556 |
st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
557 |
print_hex_dump(st, (address)sp, (address)(sp + 128), sizeof(intptr_t)); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
558 |
st->cr(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
559 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
560 |
// Note: it may be unsafe to inspect memory near pc. For example, pc may |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
561 |
// point to garbage if entry point in an nmethod is corrupted. Leave |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
562 |
// this at the end, and hope for the best. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
563 |
address pc = os::Aix::ucontext_get_pc(uc); |
53605
853c68ff2ed7
8217879: hs_err should print more instructions in hex dump
shade
parents:
52462
diff
changeset
|
564 |
print_instructions(st, pc, /*instrsize=*/4); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
565 |
st->cr(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
566 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
567 |
// Try to decode the instructions. |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
568 |
st->print_cr("Decoded instructions: (pc=" PTR_FORMAT ")", pc); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
569 |
st->print("<TODO: PPC port - print_context>"); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
570 |
// TODO: PPC port Disassembler::decode(pc, 16, 16, st); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
571 |
st->cr(); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
572 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
573 |
|
35077
8b86440d3bf1
8145114: const-correctness for ucontext_t* reading functions
stuefe
parents:
35076
diff
changeset
|
574 |
void os::print_register_info(outputStream *st, const void *context) { |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
575 |
if (context == NULL) return; |
35076
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
576 |
|
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
577 |
ucontext_t *uc = (ucontext_t*)context; |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
578 |
|
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
579 |
st->print_cr("Register to memory mapping:"); |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
580 |
st->cr(); |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
581 |
|
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
582 |
st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.iar); |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
583 |
st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.lr); |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
584 |
st->print("sp ="); print_location(st, (intptr_t)os::Aix::ucontext_get_sp(uc)); |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
585 |
for (int i = 0; i < 32; i++) { |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
586 |
st->print("r%-2d=", i); |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
587 |
print_location(st, (intptr_t)uc->uc_mcontext.jmp_context.gpr[i]); |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
588 |
} |
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
589 |
|
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
590 |
st->cr(); |
22831
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
591 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
592 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
593 |
extern "C" { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
594 |
int SpinPause() { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
595 |
return 0; |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
596 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
597 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
598 |
|
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
599 |
#ifndef PRODUCT |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
600 |
void os::verify_stack_alignment() { |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
601 |
assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment"); |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
602 |
} |
1e2ba1d62103
8023038: PPC64 (part 15): Platform files for AIX/PPC64 support
simonis
parents:
diff
changeset
|
603 |
#endif |
26576
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
23492
diff
changeset
|
604 |
|
26582
b17d77706e6f
8057780: Fix ppc build after "8050147: StoreLoad barrier interferes with stack usages
simonis
parents:
26576
diff
changeset
|
605 |
int os::extra_bang_size_in_bytes() { |
26576
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
23492
diff
changeset
|
606 |
// PPC does not require the additional stack bang. |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
23492
diff
changeset
|
607 |
return 0; |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
23492
diff
changeset
|
608 |
} |
35076
14858721b3b3
8145103: [aix] implement os::print_register_info()
stuefe
parents:
34667
diff
changeset
|
609 |
|
35515
179755aaa4e0
8145184: [aix] Implement os::platform_print_native_stack on AIX
stuefe
parents:
35201
diff
changeset
|
610 |
bool os::platform_print_native_stack(outputStream* st, void* context, char *buf, int buf_size) { |
179755aaa4e0
8145184: [aix] Implement os::platform_print_native_stack on AIX
stuefe
parents:
35201
diff
changeset
|
611 |
AixNativeCallstack::print_callstack_for_context(st, (const ucontext_t*)context, true, buf, (size_t) buf_size); |
179755aaa4e0
8145184: [aix] Implement os::platform_print_native_stack on AIX
stuefe
parents:
35201
diff
changeset
|
612 |
return true; |
179755aaa4e0
8145184: [aix] Implement os::platform_print_native_stack on AIX
stuefe
parents:
35201
diff
changeset
|
613 |
} |