Mercurial > hg > truffle
comparison src/cpu/ppc/vm/frame_ppc.hpp @ 17803:31e80afe3fed
8035647: PPC64: Support for elf v2 abi.
Summary: ELFv2 ABI used by the little endian PowerPC64 on Linux.
Reviewed-by: kvn
Contributed-by: asmundak@google.com
author | goetz |
---|---|
date | Thu, 06 Mar 2014 10:55:28 -0800 |
parents | 67fa91961822 |
children | 58cf34613a72 |
comparison
equal
deleted
inserted
replaced
17802:7c462558a08a | 17803:31e80afe3fed |
---|---|
48 // [C_FRAME] <-- SP before prolog | 48 // [C_FRAME] <-- SP before prolog |
49 // ... | 49 // ... |
50 // [C_FRAME] | 50 // [C_FRAME] |
51 // | 51 // |
52 // C_FRAME: | 52 // C_FRAME: |
53 // 0 [ABI_112] | 53 // 0 [ABI_REG_ARGS] |
54 // 112 CARG_9: outgoing arg 9 (arg_1 ... arg_8 via gpr_3 ... gpr_{10}) | 54 // 112 CARG_9: outgoing arg 9 (arg_1 ... arg_8 via gpr_3 ... gpr_{10}) |
55 // ... | 55 // ... |
56 // 40+M*8 CARG_M: outgoing arg M (M is the maximum of outgoing args taken over all call sites in the procedure) | 56 // 40+M*8 CARG_M: outgoing arg M (M is the maximum of outgoing args taken over all call sites in the procedure) |
57 // local 1 | 57 // local 1 |
58 // ... | 58 // ... |
75 // 16 space for link register (LR) for next call | 75 // 16 space for link register (LR) for next call |
76 // 24 reserved | 76 // 24 reserved |
77 // 32 reserved | 77 // 32 reserved |
78 // 40 space for TOC (=R2) register for next call | 78 // 40 space for TOC (=R2) register for next call |
79 // | 79 // |
80 // ABI_112: | 80 // ABI_REG_ARGS: |
81 // 0 [ABI_48] | 81 // 0 [ABI_48] |
82 // 48 CARG_1: spill slot for outgoing arg 1. used by next callee. | 82 // 48 CARG_1: spill slot for outgoing arg 1. used by next callee. |
83 // ... ... | 83 // ... ... |
84 // 104 CARG_8: spill slot for outgoing arg 8. used by next callee. | 84 // 104 CARG_8: spill slot for outgoing arg 8. used by next callee. |
85 // | 85 // |
93 alignment_in_bytes = 16, | 93 alignment_in_bytes = 16, |
94 // log_2(16*8 bits) = 7. | 94 // log_2(16*8 bits) = 7. |
95 log_2_of_alignment_in_bits = 7 | 95 log_2_of_alignment_in_bits = 7 |
96 }; | 96 }; |
97 | 97 |
98 // ABI_48: | 98 // ABI_MINFRAME: |
99 struct abi_48 { | 99 struct abi_minframe { |
100 uint64_t callers_sp; | 100 uint64_t callers_sp; |
101 uint64_t cr; //_16 | 101 uint64_t cr; //_16 |
102 uint64_t lr; | 102 uint64_t lr; |
103 #if !defined(ABI_ELFv2) | |
103 uint64_t reserved1; //_16 | 104 uint64_t reserved1; //_16 |
104 uint64_t reserved2; | 105 uint64_t reserved2; |
106 #endif | |
105 uint64_t toc; //_16 | 107 uint64_t toc; //_16 |
106 // nothing to add here! | 108 // nothing to add here! |
107 // aligned to frame::alignment_in_bytes (16) | 109 // aligned to frame::alignment_in_bytes (16) |
108 }; | 110 }; |
109 | 111 |
110 enum { | 112 enum { |
111 abi_48_size = sizeof(abi_48) | 113 abi_minframe_size = sizeof(abi_minframe) |
112 }; | 114 }; |
113 | 115 |
114 struct abi_112 : abi_48 { | 116 struct abi_reg_args : abi_minframe { |
115 uint64_t carg_1; | 117 uint64_t carg_1; |
116 uint64_t carg_2; //_16 | 118 uint64_t carg_2; //_16 |
117 uint64_t carg_3; | 119 uint64_t carg_3; |
118 uint64_t carg_4; //_16 | 120 uint64_t carg_4; //_16 |
119 uint64_t carg_5; | 121 uint64_t carg_5; |
122 uint64_t carg_8; //_16 | 124 uint64_t carg_8; //_16 |
123 // aligned to frame::alignment_in_bytes (16) | 125 // aligned to frame::alignment_in_bytes (16) |
124 }; | 126 }; |
125 | 127 |
126 enum { | 128 enum { |
127 abi_112_size = sizeof(abi_112) | 129 abi_reg_args_size = sizeof(abi_reg_args) |
128 }; | 130 }; |
129 | 131 |
130 #define _abi(_component) \ | 132 #define _abi(_component) \ |
131 (offset_of(frame::abi_112, _component)) | 133 (offset_of(frame::abi_reg_args, _component)) |
132 | 134 |
133 struct abi_112_spill : abi_112 { | 135 struct abi_reg_args_spill : abi_reg_args { |
134 // additional spill slots | 136 // additional spill slots |
135 uint64_t spill_ret; | 137 uint64_t spill_ret; |
136 uint64_t spill_fret; //_16 | 138 uint64_t spill_fret; //_16 |
137 // aligned to frame::alignment_in_bytes (16) | 139 // aligned to frame::alignment_in_bytes (16) |
138 }; | 140 }; |
139 | 141 |
140 enum { | 142 enum { |
141 abi_112_spill_size = sizeof(abi_112_spill) | 143 abi_reg_args_spill_size = sizeof(abi_reg_args_spill) |
142 }; | 144 }; |
143 | 145 |
144 #define _abi_112_spill(_component) \ | 146 #define _abi_reg_args_spill(_component) \ |
145 (offset_of(frame::abi_112_spill, _component)) | 147 (offset_of(frame::abi_reg_args_spill, _component)) |
146 | 148 |
147 // non-volatile GPRs: | 149 // non-volatile GPRs: |
148 | 150 |
149 struct spill_nonvolatiles { | 151 struct spill_nonvolatiles { |
150 uint64_t r14; | 152 uint64_t r14; |
240 // [callee's locals w/o arguments] | 242 // [callee's locals w/o arguments] |
241 // [outgoing arguments] | 243 // [outgoing arguments] |
242 // [ENTRY_FRAME_LOCALS] | 244 // [ENTRY_FRAME_LOCALS] |
243 // | 245 // |
244 // PARENT_IJAVA_FRAME_ABI: | 246 // PARENT_IJAVA_FRAME_ABI: |
245 // 0 [ABI_48] | 247 // 0 [ABI_MINFRAME] |
246 // top_frame_sp | 248 // top_frame_sp |
247 // initial_caller_sp | 249 // initial_caller_sp |
248 // | 250 // |
249 // TOP_IJAVA_FRAME_ABI: | 251 // TOP_IJAVA_FRAME_ABI: |
250 // 0 [PARENT_IJAVA_FRAME_ABI] | 252 // 0 [PARENT_IJAVA_FRAME_ABI] |
256 // frame_manager_lr | 258 // frame_manager_lr |
257 // | 259 // |
258 | 260 |
259 // PARENT_IJAVA_FRAME_ABI | 261 // PARENT_IJAVA_FRAME_ABI |
260 | 262 |
261 struct parent_ijava_frame_abi : abi_48 { | 263 struct parent_ijava_frame_abi : abi_minframe { |
262 // SOE registers. | 264 // SOE registers. |
263 // C2i adapters spill their top-frame stack-pointer here. | 265 // C2i adapters spill their top-frame stack-pointer here. |
264 uint64_t top_frame_sp; // carg_1 | 266 uint64_t top_frame_sp; // carg_1 |
265 // Sp of calling compiled frame before it was resized by the c2i | 267 // Sp of calling compiled frame before it was resized by the c2i |
266 // adapter or sp of call stub. Does not contain a valid value for | 268 // adapter or sp of call stub. Does not contain a valid value for |
283 uint64_t card_4_unused; //_16 carg_4 | 285 uint64_t card_4_unused; //_16 carg_4 |
284 uint64_t carg_5_unused; // carg_5 | 286 uint64_t carg_5_unused; // carg_5 |
285 uint64_t carg_6_unused; //_16 carg_6 | 287 uint64_t carg_6_unused; //_16 carg_6 |
286 uint64_t carg_7_unused; // carg_7 | 288 uint64_t carg_7_unused; // carg_7 |
287 // Use arg8 for storing frame_manager_lr. The size of | 289 // Use arg8 for storing frame_manager_lr. The size of |
288 // top_ijava_frame_abi must match abi_112. | 290 // top_ijava_frame_abi must match abi_reg_args. |
289 uint64_t frame_manager_lr; //_16 carg_8 | 291 uint64_t frame_manager_lr; //_16 carg_8 |
290 // nothing to add here! | 292 // nothing to add here! |
291 // aligned to frame::alignment_in_bytes (16) | 293 // aligned to frame::alignment_in_bytes (16) |
292 }; | 294 }; |
293 | 295 |
393 | 395 |
394 // Accessors for fields | 396 // Accessors for fields |
395 intptr_t* fp() const { return _fp; } | 397 intptr_t* fp() const { return _fp; } |
396 | 398 |
397 // Accessors for ABIs | 399 // Accessors for ABIs |
398 inline abi_48* own_abi() const { return (abi_48*) _sp; } | 400 inline abi_minframe* own_abi() const { return (abi_minframe*) _sp; } |
399 inline abi_48* callers_abi() const { return (abi_48*) _fp; } | 401 inline abi_minframe* callers_abi() const { return (abi_minframe*) _fp; } |
400 | 402 |
401 private: | 403 private: |
402 | 404 |
403 // Find codeblob and set deopt_state. | 405 // Find codeblob and set deopt_state. |
404 inline void find_codeblob_and_set_pc_and_deopt_state(address pc); | 406 inline void find_codeblob_and_set_pc_and_deopt_state(address pc); |