frame.hpp revision 107
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * This code is free software; you can redistribute it and/or modify it
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * under the terms of the GNU General Public License version 2 only, as
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * published by the Free Software Foundation.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * This code is distributed in the hope that it will be useful, but WITHOUT
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * version 2 for more details (a copy is included in the LICENSE file that
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * accompanied this code).
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * You should have received a copy of the GNU General Public License version
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * 2 along with this work; if not, write to the Free Software Foundation,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * CA 95054 USA or visit www.sun.com if you need additional information or
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza * have any questions.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Prazatypedef class BytecodeInterpreter* interpreterState;
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza// A frame represents a physical stack frame (an activation). Frames
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza// can be C or Java frames, and the Java frames can be interpreted or
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza// compiled. In contrast, vframes represent source-level activations,
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza// so that one physical frame can correspond to multiple source level
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza// frames because of inlining.
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza // Instance variables:
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza intptr_t* _sp; // stack pointer (from Thread::last_Java_sp)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza address _pc; // program counter (the next instruction after the call)
ead1f93ee620d7580f7e53350fe5a884fc4f158aLiane Praza // Constructors
bool is_interpreted_frame() const;
bool is_java_frame() const;
bool is_native_frame() const;
bool is_runtime_frame() const;
bool is_compiled_frame() const;
bool is_safepoint_blob_frame() const;
bool is_deoptimized_frame() const;
bool is_interpreted_frame_valid(JavaThread* thread) const; // performs sanity checks on interpreted frames.
bool should_be_deoptimized() const;
bool can_be_deoptimized() const;
int frame_size() const;
oop* adjusted_obj_at_addr(methodOop method, int index) { return obj_at_addr(adjust_offset(method, index)); }
enum Tag {
oop interpreter_callee_receiver(symbolHandle signature) { return *interpreter_callee_receiver_addr(signature); }
#ifndef CC_INTERP
// interpreter_frame_monitor_size reports the allocation size of a monitor in the interpreter stack.
static int interpreter_frame_monitor_size();
// corresponds to the old compiled/deoptimized fp
bool entry_frame_is_first() const;
static int local_offset_for_compiler(int local_index, int nof_args, int max_nof_locals, int max_nof_monitors);
static int monitor_offset_for_compiler(int local_index, int nof_args, int max_nof_locals, int max_nof_monitors);
const char* print_name() const;
void oops_compiled_arguments_do(symbolHandle signature, bool is_static, const RegisterMap* reg_map, OopClosure* f);
int max_locals,
void nmethods_code_blob_do();
void nmethods_do();
void gc_prologue();
void gc_epilogue();
void pd_gc_epilog();
# ifdef ENABLE_ZAP_DEAD_LOCALS
int pd_oop_map_offset_adjustment() const;
# include "incls/_frame_pd.hpp.incl"
bool _is_done;