* src/vm/jit/code.c, src/vm/jit/code.h: Files added.
[cacao.git] / src / vm / jit / replace.h
1 /* An `rplpoint` represents a replacement point in a compiled method  */
2
3 #ifndef _REPLACE_H
4 #define _REPLACE_H
5
6 #include "config.h"
7 #include "vm/types.h"
8 #include "vm/method.h"
9
10 struct rplpoint {
11         void     *pc;           /* machine code PC of this point  */
12         rplpoint *hashlink;     /* chain to next rplpoint in hash */
13         codeinfo *code;         /* codeinfo this point belongs to */
14         rplpoint *target;       /* target of the replacement      */
15
16         u1        regalloc[1];  /* VARIABLE LENGTH!               */
17 };
18
19 /* An `executionsstate` represents the state of a thread as it reached */
20 /* an replacement point or is about to enter one.                      */
21
22 #define MD_EXCSTATE_NREGS  32
23 #define MD_EXCSTATE_NCALLEESAVED  8
24
25 struct executionstate {
26         u1           *pc;
27         u8            regs[MD_EXCSTATE_NREGS];
28         u8            savedregs[MD_EXCSTATE_NCALLEESAVED]; /* or read from frame */
29
30         u1           *frame;
31         
32     java_objectheader *locked; /* XXX maybe just leave it in frame? */
33 };
34
35 /* `sourcestate` will probably only be used for debugging              */
36
37 struct sourcestate {
38         u8           *javastack;
39         s4            javastackdepth;
40
41         u8            javalocals;
42         s4            javalocalscount;
43 };
44
45 #endif
46
47 /* vim: noet ts=4 sw=4
48  */