-*/
-
-
-#include "global.h"
-#include <stdio.h>
-#include <signal.h>
-#include "types.h"
-#include "main.h"
-#include "jit/alpha/codegen.h"
-#include "jit/jit.h"
-#include "jit/parse.h"
-#include "jit/reg.h"
-#include "builtin.h"
-#include "asmpart.h"
-#include "jni.h"
-#include "loader.h"
-#include "tables.h"
-#include "native.h"
-#include "main.h"
-
-/* include independent code generation stuff */
-#include "jit/codegen.inc"
-#include "jit/reg.inc"
-
-
-/* *****************************************************************************
-
-Datatypes and Register Allocations:
------------------------------------
-
-On 64-bit-machines (like the Alpha) all operands are stored in the
-registers in a 64-bit form, even when the correspondig JavaVM operands
-only need 32 bits. This is done by a canonical representation:
-
-32-bit integers are allways stored as sign-extended 64-bit values (this
-approach is directly supported by the Alpha architecture and is very easy
-to implement).
-
-32-bit-floats are stored in a 64-bit doubleprecision register by simply
-expanding the exponent and mantissa with zeroes. (also supported by the
-architecture)
-
-
-Stackframes:
-
-The calling conventions and the layout of the stack is explained in detail
-in the documention file: calling.doc
-
-*******************************************************************************/
-
-
-/* register descripton - array ************************************************/
-
-/* #define REG_RES 0 reserved register for OS or code generator */
-/* #define REG_RET 1 return value register */
-/* #define REG_EXC 2 exception value register (only old jit) */
-/* #define REG_SAV 3 (callee) saved register */
-/* #define REG_TMP 4 scratch temporary register (caller saved) */
-/* #define REG_ARG 5 argument register (caller saved) */
-
-/* #define REG_END -1 last entry in tables */
-
-int nregdescint[] = {
- REG_RET, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP,
- REG_TMP, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV,
- REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_TMP, REG_TMP,
- REG_TMP, REG_RES, REG_RES, REG_RES, REG_RES, REG_RES, REG_RES, REG_RES,
- REG_END };
-
-/* for use of reserved registers, see comment above */
-
-int nregdescfloat[] = {
- REG_RET, REG_TMP, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV, REG_SAV,
- REG_SAV, REG_SAV, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_TMP,
- REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_ARG, REG_TMP, REG_TMP,
- REG_TMP, REG_TMP, REG_TMP, REG_TMP, REG_RES, REG_RES, REG_RES, REG_RES,
- REG_END };
-
-/* for use of reserved registers, see comment above */
-
-
-/* NullPointerException handlers and exception handling initialisation */
-
-typedef struct sigctx_struct {
-
- long sc_onstack; /* sigstack state to restore */
- long sc_mask; /* signal mask to restore */
- long sc_pc; /* pc at time of signal */
- long sc_ps; /* psl to retore */
- long sc_regs[32]; /* processor regs 0 to 31 */
- long sc_ownedfp; /* fp has been used */
- long sc_fpregs[32]; /* fp regs 0 to 31 */
- unsigned long sc_fpcr; /* floating point control register */
- unsigned long sc_fp_control; /* software fpcr */
- /* rest is unused */
- unsigned long sc_reserved1, sc_reserved2;
- unsigned long sc_ssize;
- char *sc_sbase;
- unsigned long sc_traparg_a0;
- unsigned long sc_traparg_a1;
- unsigned long sc_traparg_a2;
- unsigned long sc_fp_trap_pc;
- unsigned long sc_fp_trigger_sum;
- unsigned long sc_fp_trigger_inst;
- unsigned long sc_retcode[2];
-} sigctx_struct;
-
-
-#if defined(USE_THREADS) && defined(NATIVE_THREADS)
-void thread_restartcriticalsection(ucontext_t *uc)
-{
- void *critical;
- if ((critical = thread_checkcritical((void*) uc->uc_mcontext.sc_pc)) != NULL)
- uc->uc_mcontext.sc_pc = (u8) critical;
-}
-#endif
-
-/* NullPointerException signal handler for hardware null pointer check */
-
-void catch_NullPointerException(int sig, int code, sigctx_struct *sigctx)
-{
- sigset_t nsig;
- int instr;
- long faultaddr;
- java_objectheader *xptr;
-
- /* Reset signal handler - necessary for SysV, does no harm for BSD */