Removed return value from descriptor_params_from_paramtypes.
[cacao.git] / src / vm / jit / executionstate.h
1 /* src/vm/jit/executionstate.h - execution-state handling
2
3    Copyright (C) 2007, 2008, 2009
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
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.
12
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.
17
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
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _EXECUTIONSTATE_H
27 #define _EXECUTIONSTATE_H
28
29 /* forward typedefs ***********************************************************/
30
31 typedef struct executionstate_t executionstate_t;
32
33
34 #include "config.h"
35
36 #include <stdint.h>
37
38 #include "arch.h"
39 #include "md-abi.h"
40
41 #include "vm/jit/code.hpp"
42
43
44 /* configuration of native stack slot size ************************************/
45
46 #define SIZE_OF_STACKSLOT      8
47 #define STACK_SLOTS_PER_FLOAT  1
48 typedef uint64_t stackslot_t;
49
50
51 /* executionstate_t ************************************************************
52
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.
56
57 *******************************************************************************/
58
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 */
65
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 */
70 #endif
71
72         codeinfo  *code;                      /* codeinfo corresponding to the pv */
73 };
74
75
76 /* prototypes *****************************************************************/
77
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81
82 void executionstate_pop_stackframe(executionstate_t *es);
83
84 void executionstate_unwind_exception(executionstate_t* es, java_handle_t* e);
85
86 #if !defined(NDEBUG)
87 void executionstate_sanity_check(void *context);
88 void executionstate_println(executionstate_t *es);
89 #endif
90
91 /* Machine and OS dependent functions (code in ARCH_DIR/OS_DIR/md-os.c) */
92
93 void md_executionstate_read(executionstate_t *es, void *ucontext);
94 void md_executionstate_write(executionstate_t *es, void *ucontext);
95
96 #ifdef __cplusplus
97 }
98 #endif
99
100 #endif /* _EXECUTIONSTATE_H */
101
102
103 /*
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  * ---------------------------------------------------------------------
108  * Local variables:
109  * mode: c
110  * indent-tabs-mode: t
111  * c-basic-offset: 4
112  * tab-width: 4
113  * End:
114  * vim:noexpandtab:sw=4:ts=4:
115  */