/* * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// C frame layout on ZARCH_64. // // In this figure the stack grows upwards, while memory grows // downwards. See "Linux for zSeries: ELF Application Binary Interface Supplement", // IBM Corp. (LINUX-1107-01) // // Square brackets denote stack regions possibly larger // than a single 64 bit slot. // // STACK: // 0 [C_FRAME] <-- SP after prolog (mod 8 = 0) // [C_FRAME] <-- SP before prolog // ... // [C_FRAME] // // C_FRAME: // 0 [ABI_160] // // ABI_160: // 0 [ABI_16] // 16 CARG_1: spill slot for outgoing arg 1. used by next callee. // 24 CARG_2: spill slot for outgoing arg 2. used by next callee. // 32 CARG_3: spill slot for outgoing arg 3. used by next callee. // 40 CARG_4: spill slot for outgoing arg 4. used by next callee. // 48 GPR_6: spill slot for GPR_6. used by next callee. // ... ... // 120 GPR_15: spill slot for GPR_15. used by next callee. // 128 CFARG_1: spill slot for outgoing fp arg 1. used by next callee. // 136 CFARG_2: spill slot for outgoing fp arg 2. used by next callee. // 144 CFARG_3: spill slot for outgoing fp arg 3. used by next callee. // 152 CFARG_4: spill slot for outgoing fp arg 4. used by next callee. // 160 [REMAINING CARGS] // // ABI_16: // 0 callers_sp // 8 return_pc
// REMARK: This structure should reflect the "minimal" ABI frame // layout, but it doesn't. There is an extra field at the end of the // structure that marks the area where arguments are passed, when // the argument registers "overflow". Thus, sizeof(z_abi_160) // doesn't yield the expected (and desired) result. Therefore, as // long as we do not provide extra infrastructure, one should use // either z_abi_160_size, or _z_abi(remaining_cargs) instead of // sizeof(...). struct z_abi_160 {
uint64_t callers_sp;
uint64_t return_pc;
uint64_t carg_1;
uint64_t carg_2;
uint64_t carg_3;
uint64_t carg_4;
uint64_t gpr6;
uint64_t gpr7;
uint64_t gpr8;
uint64_t gpr9;
uint64_t gpr10;
uint64_t gpr11;
uint64_t gpr12;
uint64_t gpr13;
uint64_t gpr14;
uint64_t gpr15;
uint64_t cfarg_1;
uint64_t cfarg_2;
uint64_t cfarg_3;
uint64_t cfarg_4;
uint64_t remaining_cargs;
};
struct z_ijava_state{
DEBUG_ONLY(uint64_t magic;) // wrong magic -> wrong state!
uint64_t method;
uint64_t mirror;
uint64_t locals; // Z_locals
uint64_t monitors;
uint64_t cpoolCache;
uint64_t bcp; // Z_bcp
uint64_t mdx;
uint64_t esp; // Z_esp // Caller's original SP before modification by c2i adapter (if caller is compiled) // and before top -> parent frame conversion by the interpreter entry. // Note: for i2i calls a correct sender_sp is required, too, because there // we cannot use the caller's top_frame_sp as sp when removing the callee // frame (caller could be compiled or entry frame). Therefore the sender_sp // has to be the interpreted caller's sp as TOP_IJAVA_FRAME. See also // AbstractInterpreter::layout_activation() used by deoptimization.
uint64_t sender_sp; // Own SP before modification by i2c adapter and top-2-parent-resize // by interpreted callee.
uint64_t top_frame_sp; // Slots only needed for native calls. Maybe better to move elsewhere.
uint64_t oop_tmp;
uint64_t lresult;
uint64_t fresult;
};
// C2I adapter frames: // // STACK (interpreted called from compiled, on entry to frame manager): // // [TOP_C2I_FRAME] // [JIT_FRAME] // ... // // // STACK (interpreted called from compiled, after interpreter has been pushed): // // [TOP_IJAVA_FRAME] // [PARENT_C2I_FRAME] // [JIT_FRAME] // ... // // // TOP_C2I_FRAME: // // [TOP_IJAVA_FRAME_ABI] // [outgoing Java arguments] // alignment (optional) // // // PARENT_C2I_FRAME: // // [PARENT_IJAVA_FRAME_ABI] // alignment (optional) // [callee's locals w/o arguments] // [outgoing Java arguments] // alignment (optional)
private:
// STACK: // ... // [THIS_FRAME] <-- this._sp (stack pointer for this frame) // [CALLER_FRAME] <-- this.fp() (_sp of caller's frame) // ... //
// NOTE: Stack pointer is now held in the base class, so remove it from here.
// Needed by deoptimization.
intptr_t* _unextended_sp;
// Frame pointer for this frame.
intptr_t* _fp;
public:
// Interface for all frames:
// Accessors
inline intptr_t* fp() const { return _fp; }
private:
// Initialize frame members (_pc and _sp must be given) inlinevoid setup(); const ImmutableOopMap* get_oop_map() const;
// Constructors
public: // To be used, if sp was not extended to match callee's calling convention. inline frame(intptr_t* sp, address pc, intptr_t* unextended_sp = nullptr, intptr_t* fp = nullptr, CodeBlob* cb = nullptr);
// Additional interface for interpreter frames: staticint interpreter_frame_interpreterstate_size_in_bytes(); staticint interpreter_frame_monitor_size_in_bytes();
// template interpreter state inline z_ijava_state* ijava_state_unchecked() const;
private:
inline z_ijava_state* ijava_state() const;
// Where z_ijava_state.monitors is saved. inline BasicObjectLock** interpreter_frame_monitors_addr() const; // Where z_ijava_state.esp is saved. inline intptr_t** interpreter_frame_esp_addr() const;
// Get caller pc from stack slot of gpr14.
address native_sender_pc() const; // Get caller pc from stack slot of gpr10.
address callstub_sender_pc() const;
// Dump all frames starting at a given C stack pointer. // max_frames: Limit number of traced frames. // <= 0 --> full trace // > 0 --> trace the #max_frames topmost frames staticvoid back_trace(outputStream* st, intptr_t* start_sp, intptr_t* top_pc, unsignedlong flags, int max_frames = 0);
enum { // This enum value specifies the offset from the pc remembered by // call instructions to the location where control returns to // after a normal return. Most architectures remember the return // location directly, i.e. the offset is zero. This is the case // for z/Architecture, too. // // Normal return address is the instruction following the branch.
pc_return_offset = 0,
metadata_words = 0,
metadata_words_at_bottom = 0,
metadata_words_at_top = 0,
frame_alignment = 16, // size, in words, of maximum shift in frame position due to alignment
align_wiggle = 1
};
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.31Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.