interpreterRuntime.hpp revision 941
/*
* Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
// The InterpreterRuntime is called by the interpreter for everything
class InterpreterRuntime: AllStatic {
friend class BytecodeClosure; // for method and bcp
friend class PrintingClosure; // for method and bcp
private:
// Helper functions to access current interpreter state
static methodOop method(JavaThread *thread) { return last_frame(thread).interpreter_frame_method(); }
// pass method to avoid calling unsafe bcp_to_method (partial fix 4926272)
}
static bool already_resolved(JavaThread *thread) { return cache_entry(thread)->is_resolved(code(thread)); }
static ConstantPoolCacheEntry* cache_entry_at(JavaThread *thread, int i) { return method(thread)->constants()->cache()->entry_at(i); }
static ConstantPoolCacheEntry* cache_entry(JavaThread *thread) { return cache_entry_at(thread, Bytes::get_native_u2(bcp(thread) + 1)); }
// Inner work method for Interpreter's frequency counter overflow
public:
// Constants
// Allocation
// Quicken instance-of and check-cast bytecodes
// Exceptions thrown by the interpreter
static void throw_WrongMethodTypeException(JavaThread* thread, oopDesc* mtype = NULL, oopDesc* mhandle = NULL);
// Statics & fields
// Synchronization
// Calls
// Breakpoints
static Bytecodes::Code get_original_bytecode_at(JavaThread* thread, methodOopDesc* method, address bcp);
static void set_original_bytecode_at(JavaThread* thread, methodOopDesc* method, address bcp, Bytecodes::Code new_code);
static bool is_breakpoint(JavaThread *thread) { return Bytecodes::code_or_bp_at(bcp(thread)) == Bytecodes::_breakpoint; }
// Safepoints
// Debugger support
// Native signature handlers
// Popframe support (only needed on x86 and AMD64)
#endif
// Platform dependent stuff
#include "incls/_interpreterRT_pd.hpp.incl"
// Interpreter's frequency counter overflow
// Interpreter profiling support
#ifdef ASSERT
#endif // ASSERT
};
class SignatureHandlerLibrary: public AllStatic {
public:
private:
static address set_handler_blob();
static void initialize();
public:
};