abstractInterpreter.hpp revision 3932
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * This code is free software; you can redistribute it and/or modify it
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * under the terms of the GNU General Public License version 2 only, as
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * published by the Free Software Foundation.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * This code is distributed in the hope that it will be useful, but WITHOUT
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * version 2 for more details (a copy is included in the LICENSE file that
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * accompanied this code).
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * You should have received a copy of the GNU General Public License version
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * 2 along with this work; if not, write to the Free Software Foundation,
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * or visit www.oracle.com if you need additional information or have any
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * questions.
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock#ifndef SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim#define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
#ifdef TARGET_ARCH_MODEL_x86_32
# include "interp_masm_x86_32.hpp"
#ifdef TARGET_ARCH_MODEL_x86_64
# include "interp_masm_x86_64.hpp"
#ifdef TARGET_ARCH_MODEL_sparc
# include "interp_masm_sparc.hpp"
#ifdef TARGET_ARCH_MODEL_zero
# include "interp_masm_zero.hpp"
#ifdef TARGET_ARCH_MODEL_arm
# include "interp_masm_arm.hpp"
#ifdef TARGET_ARCH_MODEL_ppc
# include "interp_masm_ppc.hpp"
#ifdef TARGET_OS_FAMILY_linux
# include "thread_linux.inline.hpp"
#ifdef TARGET_OS_FAMILY_solaris
# include "thread_solaris.inline.hpp"
#ifdef TARGET_OS_FAMILY_windows
# include "thread_windows.inline.hpp"
#ifdef TARGET_OS_FAMILY_bsd
# include "thread_bsd.inline.hpp"
// abstractInterpreter.hpp: generic description of the interpreter.
//------------------------------------------------------------------------------------------------------------------------
friend class VMStructs;
friend class Interpreter;
friend class CppInterpreterGenerator;
enum MethodKind {
enum SomeConstants {
static address _native_abi_to_tosca[number_of_result_handlers]; // for native method result handlers
friend class AbstractInterpreterGenerator;
friend class InterpreterGenerator;
friend class InterpreterMacroAssembler;
static void initialize();
static address entry_for_kind(MethodKind k) { assert(0 <= k && k < number_of_method_entries, "illegal kind"); return _entry_table[k]; }
int callee_parameters,
bool is_top_frame);
int temps,
int popframe_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame) {
int temps,
int popframe_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame);
static void notice_safepoints() { ShouldNotReachHere(); } // stops the thread when reaching a safepoint
static address result_handler(BasicType type) { return _native_abi_to_tosca[BasicType_as_index(type)]; }
static bool in_native_entry(address pc) { return _native_entry_begin <= pc && pc < _native_entry_end; }
static int local_offset_in_bytes(int n) {
switch (type) {
default: ShouldNotReachHere();
switch (type) {
default: ShouldNotReachHere();
//------------------------------------------------------------------------------------------------------------------------
class Template;
void generate_all();