/* * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2021, Red Hat, Inc. 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. *
*/
frame frame::sender_for_entry_frame(RegisterMap *map) const {
assert(zeroframe()->is_entry_frame(), "wrong type of frame");
assert(map != NULL, "map must be set");
assert(!entry_frame_is_first(), "next Java fp must be non zero");
assert(entry_frame_call_wrapper()->anchor()->last_Java_sp() == sender_sp(), "sender should be next Java frame");
map->clear();
assert(map->include_argument_oops(), "should be set by clear"); return frame(zeroframe()->next(), sender_sp());
}
// Pointer beyond the "oldest/deepest" BasicObjectLock on stack.
BasicObjectLock* frame::interpreter_frame_monitor_end() const { return (BasicObjectLock*) get_interpreterState()->stack_base();
}
void frame::patch_pc(Thread* thread, address pc) { if (pc != NULL) {
assert(_cb == CodeCache::find_blob(pc), "unexpected pc");
_pc = pc;
_deopt_state = is_deoptimized;
} else { // We borrow this call to set the thread pointer in the interpreter // state; the hook to set up deoptimized frames isn't supplied it.
assert(pc == NULL, "should be");
get_interpreterState()->set_thread(JavaThread::cast(thread));
}
}
// consider stack guards when trying to determine "safe" stack pointers // sp must be within the usable part of the stack (not in guards) if (!thread->is_in_usable_stack(sp)) { returnfalse;
}
// an fp must be within the stack and above (but not equal) sp if (!thread->is_in_stack_range_excl((address)fp(), sp)) { returnfalse;
}
// All good. returntrue;
}
bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
assert(is_interpreted_frame(), "Not an interpreted frame"); // These are reasonable sanity checks if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) { returnfalse;
} if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) { returnfalse;
} // These are hacks to keep us out of trouble. // The problem with these is that they mask other problems if (fp() <= sp()) { // this attempts to deal with unsigned comparison above returnfalse;
}
// do some validation of frame elements // first the method
Method* m = *interpreter_frame_method_addr();
// validate the method we'd find in this potential sender if (!Method::is_valid_method(m)) { returnfalse;
}
intptr_t* frame::interpreter_frame_tos_at(jint offset) const { int index = (Interpreter::expr_offset_in_bytes(offset) / wordSize); return &interpreter_frame_tos_address()[index];
}
void frame::zero_print_on_error(int frame_index,
outputStream* st, char* buf, int buflen) const { // Divide the buffer between the field and the value
buflen >>= 1; char *fieldbuf = buf; char *valuebuf = buf + buflen;
// Print each word of the frame for (intptr_t *addr = sp(); addr <= fp(); addr++) { int offset = fp() - addr;
// Fill in default values, then try and improve them
snprintf(fieldbuf, buflen, "word[%d]", offset);
snprintf(valuebuf, buflen, PTR_FORMAT, *addr);
zeroframe()->identify_word(frame_index, offset, fieldbuf, valuebuf, buflen);
fieldbuf[buflen - 1] = '\0';
valuebuf[buflen - 1] = '\0';
// Print the result
st->print_cr(" " PTR_FORMAT ": %-21s = %s", p2i(addr), fieldbuf, valuebuf);
}
}
void ZeroFrame::identify_word(int frame_index, int offset, char* fieldbuf, char* valuebuf, int buflen) const { switch (offset) { case next_frame_off:
strncpy(fieldbuf, "next_frame", buflen); break;
void frame::describe_pd(FrameValues& values, int frame_no) {
}
#endif
intptr_t *frame::initial_deoptimization_info() { // unused... but returns fp() to minimize changes introduced by 7087445 return fp();
}
#ifndef PRODUCT // This is a generic constructor which is only used by pns() in debug.cpp.
frame::frame(void* sp, void* fp, void* pc) {
Unimplemented();
}
#endif
¤ Dauer der Verarbeitung: 0.26 Sekunden
(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.