/*
* 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/abstractInterpreter.hpp"
#include "interpreter/templateTable.hpp"
// This file contains the platform-independent parts
// of the template interpreter and the template interpreter generator.
#ifndef CC_INTERP
//------------------------------------------------------------------------------------------------------------------------
// A little wrapper class to group tosca-specific entry points into a unit.
// (tosca = Top-Of-Stack CAche)
private:
public:
// Construction
EntryPoint();
EntryPoint(address bentry, address centry, address sentry, address aentry, address ientry, address lentry, address fentry, address dentry, address ventry);
// Attributes
void print();
// Comparison
bool operator == (const EntryPoint& y); // for debugging only
};
//------------------------------------------------------------------------------------------------------------------------
// A little wrapper class to group tosca-specific dispatch tables into a unit.
public:
enum { length = 1 << BitsPerByte }; // an entry point for each byte value (also for undefined bytecodes)
private:
public:
// Attributes
// Comparison
bool operator == (DispatchTable& y); // for debugging only
};
friend class VMStructs;
friend class InterpreterMacroAssembler;
friend class TemplateInterpreterGenerator;
friend class InterpreterGenerator;
friend class TemplateTable;
// friend class Interpreter;
public:
enum MoreConstants {
};
protected:
static address _remove_activation_entry; // continuation address if an exception is not handled by current frame
#ifdef HOTSWAP
static address _remove_activation_preserving_args_entry; // continuation address when current frame is being popped
#endif // HOTSWAP
#ifndef PRODUCT
#endif // !PRODUCT
static EntryPoint _deopt_entry[number_of_deopt_entries]; // entry points to return to from a deoptimization
static address _return_3_addrs_by_index[number_of_return_addrs]; // for invokevirtual return entries
static address _return_5_addrs_by_index[number_of_return_addrs]; // for invokeinterface return entries
static DispatchTable _active_table; // the active dispatch table (used by the interpreter for dispatch)
static DispatchTable _normal_table; // the normal dispatch table (used to set the active table in normal mode)
static DispatchTable _safept_table; // the safepoint dispatch table (used to set the active table for safepoints)
public:
static void initialize();
// this only returns whether a pc is within generated code for the interpreter.
public:
static address remove_activation_early_entry(TosState state) { return _earlyret_entry.entry(state); }
#ifdef HOTSWAP
static address remove_activation_preserving_args_entry() { return _remove_activation_preserving_args_entry; }
#endif // HOTSWAP
// Code generation
#ifndef PRODUCT
#endif // !PRODUCT
static int distance_from_dispatch_table(TosState state){ return _active_table.distance_from(state); }
// Support for invokes
// Safepoint support
static void notice_safepoints(); // stops the thread when reaching a safepoint
static void ignore_safepoints(); // ignores safepoints
// Deoptimization support
// Compute the entry address for continuation after
int callee_parameters,
bool is_top_frame);
// Deoptimization should reexecute this bytecode
// Compute the address for reexecution
#ifdef TARGET_ARCH_x86
# include "templateInterpreter_x86.hpp"
#endif
#ifdef TARGET_ARCH_sparc
# include "templateInterpreter_sparc.hpp"
#endif
#ifdef TARGET_ARCH_zero
# include "templateInterpreter_zero.hpp"
#endif
#ifdef TARGET_ARCH_arm
# include "templateInterpreter_arm.hpp"
#endif
#ifdef TARGET_ARCH_ppc
# include "templateInterpreter_ppc.hpp"
#endif
};
#endif // !CC_INTERP
#endif // SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP