/* * 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. *
*/
// Initialize frame members (_sp must be given) inlinevoid frame::setup() { if (_pc == nullptr) {
_pc = (address)own_abi()->return_pc;
assert(_pc != nullptr, "must have PC");
}
if (_cb == nullptr) {
_cb = CodeCache::find_blob(_pc);
}
if (_fp == nullptr) {
_fp = (intptr_t*)own_abi()->callers_sp;
}
if (_unextended_sp == nullptr) {
_unextended_sp = _sp;
}
// When thawing continuation frames the _unextended_sp passed to the constructor is not aligend
assert(_on_heap || (is_aligned(_sp, alignment_in_bytes) && is_aligned(_fp, alignment_in_bytes)), "invalid alignment sp:" PTR_FORMAT " unextended_sp:" PTR_FORMAT " fp:" PTR_FORMAT, p2i(_sp), p2i(_unextended_sp), p2i(_fp));
address original_pc = CompiledMethod::get_deopt_original_pc(this); if (original_pc != nullptr) {
_pc = original_pc;
_deopt_state = is_deoptimized;
assert(_cb == nullptr || _cb->as_compiled_method()->insts_contains_inclusive(_pc), "original PC must be in the main code section of the compiled method (or must be immediately following it)");
} else { if (_cb == SharedRuntime::deopt_blob()) {
_deopt_state = is_deoptimized;
} else {
_deopt_state = not_deoptimized;
}
}
// assert(_on_heap || is_aligned(_sp, frame::frame_alignment), "SP must be 8-byte aligned");
}
// The next two functions read and write z_ijava_state.monitors. inline BasicObjectLock* frame::interpreter_frame_monitors() const { return *interpreter_frame_monitors_addr();
} inlinevoid frame::interpreter_frame_set_monitors(BasicObjectLock* monitors) {
*interpreter_frame_monitors_addr() = monitors;
}
// Accessors
// Return unique id for this frame. The id must have a value where we // can distinguish identity and younger/older relationship. NULL // represents an invalid (incomparable) frame. inline intptr_t* frame::id(void) const { // Use _fp. _sp or _unextended_sp wouldn't be correct due to resizing. return _fp;
}
// Return true if this frame is older (less recent activation) than // the frame represented by id. inlinebool frame::is_older(intptr_t* id) const {
assert(this->id() != NULL && id != NULL, "NULL frame id"); // Stack grows towards smaller addresses on z/Architecture. return this->id() > id;
}
inlineint frame::frame_size() const { // Stack grows towards smaller addresses on z/Linux: sender is at a higher address. return sender_sp() - sp();
}
// Get caller pc, if caller is native from stack slot of gpr14. inline address frame::native_sender_pc() const { return (address) callers_abi()->gpr14;
}
// Get caller pc from stack slot of gpr10. inline address frame::callstub_sender_pc() const { return (address) callers_abi()->gpr10;
}
// In keeping with Intel side: end is lower in memory than begin. // Beginning element is oldest element. Also begin is one past last monitor. inline BasicObjectLock * frame::interpreter_frame_monitor_begin() const { return (BasicObjectLock*)ijava_state();
}
inlineint frame::interpreter_frame_monitor_size() { // Number of stack slots for a monitor return align_up(BasicObjectLock::size() /* number of stack slots */,
WordsPerLong /* Number of stack slots for a Java long. */);
}
inlineint frame::interpreter_frame_monitor_size_in_bytes() { // Number of bytes for a monitor. return frame::interpreter_frame_monitor_size() * wordSize;
}
inline intptr_t* frame::entry_frame_argument_at(int offset) const { // Since an entry frame always calls the interpreter first, // the parameters are on the stack and relative to known register in the // entry frame.
intptr_t* tos = (intptr_t*) entry_frame_locals()->arguments_tos_address; return &tos[offset + 1]; // prepushed tos
}
inline frame frame::sender(RegisterMap* map) const { // Default is we don't have to follow them. The sender_for_xxx will // update it accordingly.
map->set_include_argument_oops(false);
if (is_entry_frame()) { return sender_for_entry_frame(map);
} if (is_interpreted_frame()) { return sender_for_interpreter_frame(map);
}
assert(_cb == CodeCache::find_blob(pc()),"Must be the same"); if (_cb != nullptr) return sender_for_compiled_frame(map);
// Must be native-compiled frame, i.e. the marshaling code for native // methods that exists in the core system. return frame(sender_sp(), sender_pc());
}
inline frame frame::sender_for_compiled_frame(RegisterMap *map) const {
assert(map != nullptr, "map must be set");
// Now adjust the map. if (map->update_map()) { // Tell GC to use argument oopmaps for some runtime stubs that need it.
map->set_include_argument_oops(_cb->caller_must_gc_arguments(map->thread())); if (_cb->oop_maps() != nullptr) {
OopMapSet::update_register_map(this, map);
}
}
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.