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); |