Path: blob/master/src/hotspot/cpu/x86/frame_x86.cpp
41144 views
/*1* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "compiler/oopMap.hpp"26#include "interpreter/interpreter.hpp"27#include "memory/resourceArea.hpp"28#include "memory/universe.hpp"29#include "oops/markWord.hpp"30#include "oops/method.hpp"31#include "oops/oop.inline.hpp"32#include "prims/methodHandles.hpp"33#include "runtime/frame.inline.hpp"34#include "runtime/handles.inline.hpp"35#include "runtime/javaCalls.hpp"36#include "runtime/monitorChunk.hpp"37#include "runtime/signature.hpp"38#include "runtime/stackWatermarkSet.hpp"39#include "runtime/stubCodeGenerator.hpp"40#include "runtime/stubRoutines.hpp"41#include "vmreg_x86.inline.hpp"42#include "utilities/formatBuffer.hpp"43#ifdef COMPILER144#include "c1/c1_Runtime1.hpp"45#include "runtime/vframeArray.hpp"46#endif4748#ifdef ASSERT49void RegisterMap::check_location_valid() {50}51#endif5253// Profiling/safepoint support5455bool frame::safe_for_sender(JavaThread *thread) {56address sp = (address)_sp;57address fp = (address)_fp;58address unextended_sp = (address)_unextended_sp;5960// consider stack guards when trying to determine "safe" stack pointers61// sp must be within the usable part of the stack (not in guards)62if (!thread->is_in_usable_stack(sp)) {63return false;64}6566// unextended sp must be within the stack and above or equal sp67if (!thread->is_in_stack_range_incl(unextended_sp, sp)) {68return false;69}7071// an fp must be within the stack and above (but not equal) sp72// second evaluation on fp+ is added to handle situation where fp is -173bool fp_safe = thread->is_in_stack_range_excl(fp, sp) &&74thread->is_in_full_stack_checked(fp + (return_addr_offset * sizeof(void*)));7576// We know sp/unextended_sp are safe only fp is questionable here7778// If the current frame is known to the code cache then we can attempt to79// construct the sender and do some validation of it. This goes a long way80// toward eliminating issues when we get in frame construction code8182if (_cb != NULL ) {8384// First check if frame is complete and tester is reliable85// Unfortunately we can only check frame complete for runtime stubs and nmethod86// other generic buffer blobs are more problematic so we just assume they are87// ok. adapter blobs never have a frame complete and are never ok.8889if (!_cb->is_frame_complete_at(_pc)) {90if (_cb->is_compiled() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) {91return false;92}93}9495// Could just be some random pointer within the codeBlob96if (!_cb->code_contains(_pc)) {97return false;98}99100// Entry frame checks101if (is_entry_frame()) {102// an entry frame must have a valid fp.103return fp_safe && is_entry_frame_valid(thread);104} else if (is_optimized_entry_frame()) {105return fp_safe;106}107108intptr_t* sender_sp = NULL;109intptr_t* sender_unextended_sp = NULL;110address sender_pc = NULL;111intptr_t* saved_fp = NULL;112113if (is_interpreted_frame()) {114// fp must be safe115if (!fp_safe) {116return false;117}118119sender_pc = (address) this->fp()[return_addr_offset];120// for interpreted frames, the value below is the sender "raw" sp,121// which can be different from the sender unextended sp (the sp seen122// by the sender) because of current frame local variables123sender_sp = (intptr_t*) addr_at(sender_sp_offset);124sender_unextended_sp = (intptr_t*) this->fp()[interpreter_frame_sender_sp_offset];125saved_fp = (intptr_t*) this->fp()[link_offset];126127} else {128// must be some sort of compiled/runtime frame129// fp does not have to be safe (although it could be check for c1?)130131// check for a valid frame_size, otherwise we are unlikely to get a valid sender_pc132if (_cb->frame_size() <= 0) {133return false;134}135136sender_sp = _unextended_sp + _cb->frame_size();137// Is sender_sp safe?138if (!thread->is_in_full_stack_checked((address)sender_sp)) {139return false;140}141sender_unextended_sp = sender_sp;142// On Intel the return_address is always the word on the stack143sender_pc = (address) *(sender_sp-1);144// Note: frame::sender_sp_offset is only valid for compiled frame145saved_fp = (intptr_t*) *(sender_sp - frame::sender_sp_offset);146}147148149// If the potential sender is the interpreter then we can do some more checking150if (Interpreter::contains(sender_pc)) {151152// ebp is always saved in a recognizable place in any code we generate. However153// only if the sender is interpreted/call_stub (c1 too?) are we certain that the saved ebp154// is really a frame pointer.155156if (!thread->is_in_stack_range_excl((address)saved_fp, (address)sender_sp)) {157return false;158}159160// construct the potential sender161162frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);163164return sender.is_interpreted_frame_valid(thread);165166}167168// We must always be able to find a recognizable pc169CodeBlob* sender_blob = CodeCache::find_blob_unsafe(sender_pc);170if (sender_pc == NULL || sender_blob == NULL) {171return false;172}173174// Could be a zombie method175if (sender_blob->is_zombie() || sender_blob->is_unloaded()) {176return false;177}178179// Could just be some random pointer within the codeBlob180if (!sender_blob->code_contains(sender_pc)) {181return false;182}183184// We should never be able to see an adapter if the current frame is something from code cache185if (sender_blob->is_adapter_blob()) {186return false;187}188189// Could be the call_stub190if (StubRoutines::returns_to_call_stub(sender_pc)) {191if (!thread->is_in_stack_range_excl((address)saved_fp, (address)sender_sp)) {192return false;193}194195// construct the potential sender196197frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);198199// Validate the JavaCallWrapper an entry frame must have200address jcw = (address)sender.entry_frame_call_wrapper();201202return thread->is_in_stack_range_excl(jcw, (address)sender.fp());203} else if (sender_blob->is_optimized_entry_blob()) {204return false;205}206207CompiledMethod* nm = sender_blob->as_compiled_method_or_null();208if (nm != NULL) {209if (nm->is_deopt_mh_entry(sender_pc) || nm->is_deopt_entry(sender_pc) ||210nm->method()->is_method_handle_intrinsic()) {211return false;212}213}214215// If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size216// because the return address counts against the callee's frame.217218if (sender_blob->frame_size() <= 0) {219assert(!sender_blob->is_compiled(), "should count return address at least");220return false;221}222223// We should never be able to see anything here except an nmethod. If something in the224// code cache (current frame) is called by an entity within the code cache that entity225// should not be anything but the call stub (already covered), the interpreter (already covered)226// or an nmethod.227228if (!sender_blob->is_compiled()) {229return false;230}231232// Could put some more validation for the potential non-interpreted sender233// frame we'd create by calling sender if I could think of any. Wait for next crash in forte...234235// One idea is seeing if the sender_pc we have is one that we'd expect to call to current cb236237// We've validated the potential sender that would be created238return true;239}240241// Must be native-compiled frame. Since sender will try and use fp to find242// linkages it must be safe243244if (!fp_safe) {245return false;246}247248// Will the pc we fetch be non-zero (which we'll find at the oldest frame)249250if ( (address) this->fp()[return_addr_offset] == NULL) return false;251252253// could try and do some more potential verification of native frame if we could think of some...254255return true;256257}258259260void frame::patch_pc(Thread* thread, address pc) {261assert(_cb == CodeCache::find_blob(pc), "unexpected pc");262address* pc_addr = &(((address*) sp())[-1]);263if (TracePcPatching) {264tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "]",265p2i(pc_addr), p2i(*pc_addr), p2i(pc));266}267// Either the return address is the original one or we are going to268// patch in the same address that's already there.269assert(_pc == *pc_addr || pc == *pc_addr, "must be");270*pc_addr = pc;271address original_pc = CompiledMethod::get_deopt_original_pc(this);272if (original_pc != NULL) {273assert(original_pc == _pc, "expected original PC to be stored before patching");274_deopt_state = is_deoptimized;275// leave _pc as is276} else {277_deopt_state = not_deoptimized;278_pc = pc;279}280}281282bool frame::is_interpreted_frame() const {283return Interpreter::contains(pc());284}285286int frame::frame_size(RegisterMap* map) const {287frame sender = this->sender(map);288return sender.sp() - sp();289}290291intptr_t* frame::entry_frame_argument_at(int offset) const {292// convert offset to index to deal with tsi293int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize);294// Entry frame's arguments are always in relation to unextended_sp()295return &unextended_sp()[index];296}297298// sender_sp299300intptr_t* frame::interpreter_frame_sender_sp() const {301assert(is_interpreted_frame(), "interpreted frame expected");302return (intptr_t*) at(interpreter_frame_sender_sp_offset);303}304305void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) {306assert(is_interpreted_frame(), "interpreted frame expected");307ptr_at_put(interpreter_frame_sender_sp_offset, (intptr_t) sender_sp);308}309310311// monitor elements312313BasicObjectLock* frame::interpreter_frame_monitor_begin() const {314return (BasicObjectLock*) addr_at(interpreter_frame_monitor_block_bottom_offset);315}316317BasicObjectLock* frame::interpreter_frame_monitor_end() const {318BasicObjectLock* result = (BasicObjectLock*) *addr_at(interpreter_frame_monitor_block_top_offset);319// make sure the pointer points inside the frame320assert(sp() <= (intptr_t*) result, "monitor end should be above the stack pointer");321assert((intptr_t*) result < fp(), "monitor end should be strictly below the frame pointer");322return result;323}324325void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) {326*((BasicObjectLock**)addr_at(interpreter_frame_monitor_block_top_offset)) = value;327}328329// Used by template based interpreter deoptimization330void frame::interpreter_frame_set_last_sp(intptr_t* sp) {331*((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = sp;332}333334frame frame::sender_for_entry_frame(RegisterMap* map) const {335assert(map != NULL, "map must be set");336// Java frame called from C; skip all C frames and return top C337// frame of that chunk as the sender338JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor();339assert(!entry_frame_is_first(), "next Java fp must be non zero");340assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");341// Since we are walking the stack now this nested anchor is obviously walkable342// even if it wasn't when it was stacked.343if (!jfa->walkable()) {344// Capture _last_Java_pc (if needed) and mark anchor walkable.345jfa->capture_last_Java_pc();346}347map->clear();348assert(map->include_argument_oops(), "should be set by clear");349vmassert(jfa->last_Java_pc() != NULL, "not walkable");350frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());351352return fr;353}354355JavaFrameAnchor* OptimizedEntryBlob::jfa_for_frame(const frame& frame) const {356// need unextended_sp here, since normal sp is wrong for interpreter callees357return reinterpret_cast<JavaFrameAnchor*>(reinterpret_cast<char*>(frame.unextended_sp()) + in_bytes(jfa_sp_offset()));358}359360frame frame::sender_for_optimized_entry_frame(RegisterMap* map) const {361assert(map != NULL, "map must be set");362OptimizedEntryBlob* blob = _cb->as_optimized_entry_blob();363// Java frame called from C; skip all C frames and return top C364// frame of that chunk as the sender365JavaFrameAnchor* jfa = blob->jfa_for_frame(*this);366assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");367// Since we are walking the stack now this nested anchor is obviously walkable368// even if it wasn't when it was stacked.369if (!jfa->walkable()) {370// Capture _last_Java_pc (if needed) and mark anchor walkable.371jfa->capture_last_Java_pc();372}373map->clear();374assert(map->include_argument_oops(), "should be set by clear");375vmassert(jfa->last_Java_pc() != NULL, "not walkable");376frame fr(jfa->last_Java_sp(), jfa->last_Java_fp(), jfa->last_Java_pc());377378return fr;379}380381//------------------------------------------------------------------------------382// frame::verify_deopt_original_pc383//384// Verifies the calculated original PC of a deoptimization PC for the385// given unextended SP.386#ifdef ASSERT387void frame::verify_deopt_original_pc(CompiledMethod* nm, intptr_t* unextended_sp) {388frame fr;389390// This is ugly but it's better than to change {get,set}_original_pc391// to take an SP value as argument. And it's only a debugging392// method anyway.393fr._unextended_sp = unextended_sp;394395address original_pc = nm->get_original_pc(&fr);396assert(nm->insts_contains_inclusive(original_pc),397"original PC must be in the main code section of the the compiled method (or must be immediately following it)");398}399#endif400401//------------------------------------------------------------------------------402// frame::adjust_unextended_sp403#ifdef ASSERT404void frame::adjust_unextended_sp() {405// On x86, sites calling method handle intrinsics and lambda forms are treated406// as any other call site. Therefore, no special action is needed when we are407// returning to any of these call sites.408409if (_cb != NULL) {410CompiledMethod* sender_cm = _cb->as_compiled_method_or_null();411if (sender_cm != NULL) {412// If the sender PC is a deoptimization point, get the original PC.413if (sender_cm->is_deopt_entry(_pc) ||414sender_cm->is_deopt_mh_entry(_pc)) {415verify_deopt_original_pc(sender_cm, _unextended_sp);416}417}418}419}420#endif421422//------------------------------------------------------------------------------423// frame::update_map_with_saved_link424void frame::update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr) {425// The interpreter and compiler(s) always save EBP/RBP in a known426// location on entry. We must record where that location is427// so this if EBP/RBP was live on callout from c2 we can find428// the saved copy no matter what it called.429430// Since the interpreter always saves EBP/RBP if we record where it is then431// we don't have to always save EBP/RBP on entry and exit to c2 compiled432// code, on entry will be enough.433map->set_location(rbp->as_VMReg(), (address) link_addr);434#ifdef AMD64435// this is weird "H" ought to be at a higher address however the436// oopMaps seems to have the "H" regs at the same address and the437// vanilla register.438// XXXX make this go away439if (true) {440map->set_location(rbp->as_VMReg()->next(), (address) link_addr);441}442#endif // AMD64443}444445446//------------------------------------------------------------------------------447// frame::sender_for_interpreter_frame448frame frame::sender_for_interpreter_frame(RegisterMap* map) const {449// SP is the raw SP from the sender after adapter or interpreter450// extension.451intptr_t* sender_sp = this->sender_sp();452453// This is the sp before any possible extension (adapter/locals).454intptr_t* unextended_sp = interpreter_frame_sender_sp();455456#if COMPILER2_OR_JVMCI457if (map->update_map()) {458update_map_with_saved_link(map, (intptr_t**) addr_at(link_offset));459}460#endif // COMPILER2_OR_JVMCI461462return frame(sender_sp, unextended_sp, link(), sender_pc());463}464465466//------------------------------------------------------------------------------467// frame::sender_for_compiled_frame468frame frame::sender_for_compiled_frame(RegisterMap* map) const {469assert(map != NULL, "map must be set");470471// frame owned by optimizing compiler472assert(_cb->frame_size() >= 0, "must have non-zero frame size");473intptr_t* sender_sp = unextended_sp() + _cb->frame_size();474intptr_t* unextended_sp = sender_sp;475476// On Intel the return_address is always the word on the stack477address sender_pc = (address) *(sender_sp-1);478479// This is the saved value of EBP which may or may not really be an FP.480// It is only an FP if the sender is an interpreter frame (or C1?).481intptr_t** saved_fp_addr = (intptr_t**) (sender_sp - frame::sender_sp_offset);482483if (map->update_map()) {484// Tell GC to use argument oopmaps for some runtime stubs that need it.485// For C1, the runtime stub might not have oop maps, so set this flag486// outside of update_register_map.487map->set_include_argument_oops(_cb->caller_must_gc_arguments(map->thread()));488if (_cb->oop_maps() != NULL) {489OopMapSet::update_register_map(this, map);490}491492// Since the prolog does the save and restore of EBP there is no oopmap493// for it so we must fill in its location as if there was an oopmap entry494// since if our caller was compiled code there could be live jvm state in it.495update_map_with_saved_link(map, saved_fp_addr);496}497498assert(sender_sp != sp(), "must have changed");499return frame(sender_sp, unextended_sp, *saved_fp_addr, sender_pc);500}501502503//------------------------------------------------------------------------------504// frame::sender_raw505frame frame::sender_raw(RegisterMap* map) const {506// Default is we done have to follow them. The sender_for_xxx will507// update it accordingly508map->set_include_argument_oops(false);509510if (is_entry_frame()) return sender_for_entry_frame(map);511if (is_optimized_entry_frame()) return sender_for_optimized_entry_frame(map);512if (is_interpreted_frame()) return sender_for_interpreter_frame(map);513assert(_cb == CodeCache::find_blob(pc()),"Must be the same");514515if (_cb != NULL) {516return sender_for_compiled_frame(map);517}518// Must be native-compiled frame, i.e. the marshaling code for native519// methods that exists in the core system.520return frame(sender_sp(), link(), sender_pc());521}522523frame frame::sender(RegisterMap* map) const {524frame result = sender_raw(map);525526if (map->process_frames()) {527StackWatermarkSet::on_iteration(map->thread(), result);528}529530return result;531}532533bool frame::is_interpreted_frame_valid(JavaThread* thread) const {534assert(is_interpreted_frame(), "Not an interpreted frame");535// These are reasonable sanity checks536if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) {537return false;538}539if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) {540return false;541}542if (fp() + interpreter_frame_initial_sp_offset < sp()) {543return false;544}545// These are hacks to keep us out of trouble.546// The problem with these is that they mask other problems547if (fp() <= sp()) { // this attempts to deal with unsigned comparison above548return false;549}550551// do some validation of frame elements552// first the method553554Method* m = *interpreter_frame_method_addr();555556// validate the method we'd find in this potential sender557if (!Method::is_valid_method(m)) return false;558559// stack frames shouldn't be much larger than max_stack elements560// this test requires the use the unextended_sp which is the sp as seen by561// the current frame, and not sp which is the "raw" pc which could point562// further because of local variables of the callee method inserted after563// method arguments564if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {565return false;566}567568// validate bci/bcp569570address bcp = interpreter_frame_bcp();571if (m->validate_bci_from_bcp(bcp) < 0) {572return false;573}574575// validate ConstantPoolCache*576ConstantPoolCache* cp = *interpreter_frame_cache_addr();577if (MetaspaceObj::is_valid(cp) == false) return false;578579// validate locals580581address locals = (address) *interpreter_frame_locals_addr();582return thread->is_in_stack_range_incl(locals, (address)fp());583}584585BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) {586assert(is_interpreted_frame(), "interpreted frame expected");587Method* method = interpreter_frame_method();588BasicType type = method->result_type();589590intptr_t* tos_addr;591if (method->is_native()) {592// Prior to calling into the runtime to report the method_exit the possible593// return value is pushed to the native stack. If the result is a jfloat/jdouble594// then ST0 is saved before EAX/EDX. See the note in generate_native_result595tos_addr = (intptr_t*)sp();596if (type == T_FLOAT || type == T_DOUBLE) {597// QQQ seems like this code is equivalent on the two platforms598#ifdef AMD64599// This is times two because we do a push(ltos) after pushing XMM0600// and that takes two interpreter stack slots.601tos_addr += 2 * Interpreter::stackElementWords;602#else603tos_addr += 2;604#endif // AMD64605}606} else {607tos_addr = (intptr_t*)interpreter_frame_tos_address();608}609610switch (type) {611case T_OBJECT :612case T_ARRAY : {613oop obj;614if (method->is_native()) {615obj = cast_to_oop(at(interpreter_frame_oop_temp_offset));616} else {617oop* obj_p = (oop*)tos_addr;618obj = (obj_p == NULL) ? (oop)NULL : *obj_p;619}620assert(Universe::is_in_heap_or_null(obj), "sanity check");621*oop_result = obj;622break;623}624case T_BOOLEAN : value_result->z = *(jboolean*)tos_addr; break;625case T_BYTE : value_result->b = *(jbyte*)tos_addr; break;626case T_CHAR : value_result->c = *(jchar*)tos_addr; break;627case T_SHORT : value_result->s = *(jshort*)tos_addr; break;628case T_INT : value_result->i = *(jint*)tos_addr; break;629case T_LONG : value_result->j = *(jlong*)tos_addr; break;630case T_FLOAT : {631#ifdef AMD64632value_result->f = *(jfloat*)tos_addr;633#else634if (method->is_native()) {635jdouble d = *(jdouble*)tos_addr; // Result was in ST0 so need to convert to jfloat636value_result->f = (jfloat)d;637} else {638value_result->f = *(jfloat*)tos_addr;639}640#endif // AMD64641break;642}643case T_DOUBLE : value_result->d = *(jdouble*)tos_addr; break;644case T_VOID : /* Nothing to do */ break;645default : ShouldNotReachHere();646}647648return type;649}650651652intptr_t* frame::interpreter_frame_tos_at(jint offset) const {653int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize);654return &interpreter_frame_tos_address()[index];655}656657#ifndef PRODUCT658659#define DESCRIBE_FP_OFFSET(name) \660values.describe(frame_no, fp() + frame::name##_offset, #name)661662void frame::describe_pd(FrameValues& values, int frame_no) {663if (is_interpreted_frame()) {664DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp);665DESCRIBE_FP_OFFSET(interpreter_frame_last_sp);666DESCRIBE_FP_OFFSET(interpreter_frame_method);667DESCRIBE_FP_OFFSET(interpreter_frame_mirror);668DESCRIBE_FP_OFFSET(interpreter_frame_mdp);669DESCRIBE_FP_OFFSET(interpreter_frame_cache);670DESCRIBE_FP_OFFSET(interpreter_frame_locals);671DESCRIBE_FP_OFFSET(interpreter_frame_bcp);672DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp);673#ifdef AMD64674} else if (is_entry_frame()) {675// This could be more descriptive if we use the enum in676// stubGenerator to map to real names but it's most important to677// claim these frame slots so the error checking works.678for (int i = 0; i < entry_frame_after_call_words; i++) {679values.describe(frame_no, fp() - i, err_msg("call_stub word fp - %d", i));680}681#endif // AMD64682}683}684#endif // !PRODUCT685686intptr_t *frame::initial_deoptimization_info() {687// used to reset the saved FP688return fp();689}690691intptr_t* frame::real_fp() const {692if (_cb != NULL) {693// use the frame size if valid694int size = _cb->frame_size();695if (size > 0) {696return unextended_sp() + size;697}698}699// else rely on fp()700assert(! is_compiled_frame(), "unknown compiled frame size");701return fp();702}703704#ifndef PRODUCT705// This is a generic constructor which is only used by pns() in debug.cpp.706frame::frame(void* sp, void* fp, void* pc) {707init((intptr_t*)sp, (intptr_t*)fp, (address)pc);708}709710void frame::pd_ps() {}711#endif712713void JavaFrameAnchor::make_walkable(JavaThread* thread) {714// last frame set?715if (last_Java_sp() == NULL) return;716// already walkable?717if (walkable()) return;718vmassert(Thread::current() == (Thread*)thread, "not current thread");719vmassert(last_Java_sp() != NULL, "not called from Java code?");720vmassert(last_Java_pc() == NULL, "already walkable");721capture_last_Java_pc();722vmassert(walkable(), "something went wrong");723}724725void JavaFrameAnchor::capture_last_Java_pc() {726vmassert(_last_Java_sp != NULL, "no last frame set");727vmassert(_last_Java_pc == NULL, "already walkable");728_last_Java_pc = (address)_last_Java_sp[-1];729}730731732