1 /* src/vm/jit/executionstate.h - execution-state handling
3 Copyright (C) 2007, 2008, 2009
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #ifndef _EXECUTIONSTATE_H
27 #define _EXECUTIONSTATE_H
29 /* forward typedefs ***********************************************************/
31 typedef struct executionstate_t executionstate_t;
41 #include "vm/jit/code.hpp"
44 /* configuration of native stack slot size ************************************/
46 #define SIZE_OF_STACKSLOT 8
47 #define STACK_SLOTS_PER_FLOAT 1
48 typedef uint64_t stackslot_t;
51 /* executionstate_t ************************************************************
53 An execution-state represents the state of a thread containing all
54 registers that are important. This structure is an internal
55 structure similar to mcontext_t.
57 *******************************************************************************/
59 struct executionstate_t {
60 uint8_t *pc; /* program counter */
61 uint8_t *sp; /* stack pointer within method */
62 uint8_t *pv; /* procedure value. NULL means */
63 /* search the AVL tree */
64 uint8_t *ra; /* return address / link register */
66 uintptr_t intregs[INT_REG_CNT]; /* register values */
67 double fltregs[FLT_REG_CNT]; /* register values */
68 #if defined(HAS_ADDRESS_REGISTER_FILE)
69 uintptr_t adrregs[ADR_REG_CNT]; /* register values */
72 codeinfo *code; /* codeinfo corresponding to the pv */
76 /* prototypes *****************************************************************/
82 void executionstate_pop_stackframe(executionstate_t *es);
84 void executionstate_unwind_exception(executionstate_t* es, java_handle_t* e);
87 void executionstate_sanity_check(void *context);
88 void executionstate_println(executionstate_t *es);
91 /* Machine and OS dependent functions (code in ARCH_DIR/OS_DIR/md-os.c) */
93 void md_executionstate_read(executionstate_t *es, void *ucontext);
94 void md_executionstate_write(executionstate_t *es, void *ucontext);
100 #endif /* _EXECUTIONSTATE_H */
104 * These are local overrides for various environment variables in Emacs.
105 * Please do not remove this and leave it at the end of the file, where
106 * Emacs will automagically detect them.
107 * ---------------------------------------------------------------------
110 * indent-tabs-mode: t
114 * vim:noexpandtab:sw=4:ts=4: