/*
* 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/bytecodes.hpp"
#include "runtime/vmThread.hpp"
#ifdef TARGET_ARCH_MODEL_x86_32
# include "interp_masm_x86_32.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_x86_64
# include "interp_masm_x86_64.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_sparc
# include "interp_masm_sparc.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_zero
# include "interp_masm_zero.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_arm
# include "interp_masm_arm.hpp"
#endif
#ifdef TARGET_ARCH_MODEL_ppc
# include "interp_masm_ppc.hpp"
#endif
#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
// This file contains the platform-independent parts
// of the abstract interpreter and the abstract interpreter generator.
// Organization of the interpreter(s). There exists two different interpreters in hotpot
// an assembly language version (aka template interpreter) and a high level language version
// (aka c++ interpreter). Th division of labor is as follows:
// Template Interpreter C++ Interpreter Functionality
//
// templateTable* bytecodeInterpreter* actual interpretation of bytecodes
//
// templateInterpreter* cppInterpreter* generation of assembly code that creates
// and manages interpreter runtime frames.
// Also code for populating interpreter
// frames created during deoptimization.
//
// For both template and c++ interpreter. There are common files for aspects of the interpreter
// that are generic to both interpreters. This is the layout:
//
// abstractInterpreter.hpp: generic description of the interpreter.
// interpreter*: generic frame creation and handling.
//
//------------------------------------------------------------------------------------------------------------------------
// The C++ interface to the bytecode interpreter(s).
friend class VMStructs;
friend class Interpreter;
friend class CppInterpreterGenerator;
public:
enum MethodKind {
};
// Conversion from the part of the above enum to vmIntrinsics::_invokeExact, etc.
else
return vmIntrinsics::_none;
}
enum SomeConstants {
};
protected:
// method entry points
static address _native_abi_to_tosca[number_of_result_handlers]; // for native method result handlers
friend class AbstractInterpreterGenerator;
friend class InterpreterGenerator;
friend class InterpreterMacroAssembler;
public:
static void initialize();
// Method activation
static address entry_for_kind(MethodKind k) { assert(0 <= k && k < number_of_method_entries, "illegal kind"); return _entry_table[k]; }
// used for bootstrapping method handles:
static bool can_be_compiled(methodHandle m);
// Runtime support
// length = invoke bytecode length (to advance to next bytecode)
// Activation size in words for a method that is just being called.
// Parameters haven't been pushed so count them too.
// Deoptimization support
// Compute the entry address for continuation after
int callee_parameters,
bool is_top_frame);
// Compute the entry address for reexecution
// Deoptimization should reexecute this bytecode
// share implementation of size_activation and layout_activation:
int temps,
int popframe_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame,
bool is_bottom_frame) {
return layout_activation(method,
}
int temps,
int popframe_args,
int monitors,
int callee_params,
int callee_locals,
bool is_top_frame,
bool is_bottom_frame);
// Runtime support
// Safepoint support
static void notice_safepoints() { ShouldNotReachHere(); } // stops the thread when reaching a safepoint
// Support for native calls
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 void print(); // prints the interpreter code
public:
// Interpreter helpers
// Local values relative to locals[n]
static int local_offset_in_bytes(int n) {
}
// access to stacked values according to type:
}
// big-endian LP64
else
}
} else {
}
}
} else {
}
}
switch (type) {
default: ShouldNotReachHere();
}
}
switch (type) {
default: ShouldNotReachHere();
}
}
};
//------------------------------------------------------------------------------------------------------------------------
// The interpreter generator.
class Template;
protected:
// shared code sequences
// Converter for native abi result to tosca result
// entry point generator
void bang_stack_shadow_pages(bool native_call);
void generate_all();
void initialize_method_handle_entries();
public:
};
#endif // SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP