/*
* 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "interpreter/bytecode.hpp"
#include "interpreter/linkResolver.hpp"
#include "memory/universe.hpp"
#include "oops/methodOop.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/signature.hpp"
#ifdef TARGET_OS_FAMILY_linux
# include "thread_linux.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_solaris
# include "thread_solaris.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_windows
# include "thread_windows.inline.hpp"
#endif
#ifdef TARGET_OS_FAMILY_bsd
# include "thread_bsd.inline.hpp"
#endif
// The InterpreterRuntime is called by the interpreter for everything
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
// 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, AMD64 and ARM)
#endif
// Platform dependent stuff
#ifdef TARGET_ARCH_x86
# include "interpreterRT_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "interpreterRT_sparc.hpp"
#endif
#ifdef TARGET_ARCH_zero
# include "interpreterRT_zero.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "interpreterRT_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "interpreterRT_ppc.hpp"
#endif
// Interpreter's frequency counter overflow
// Interpreter profiling support
#ifdef ASSERT
#endif // ASSERT
};
public:
private:
static address set_handler_blob();
static void initialize();
public:
};
#endif // SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP