971203e26ec8f34887f2629942b744ada8b4e9d2
[cacao.git] / src / vm / jit / trace.h
1 /* src/vm/jit/trace.h - Functions for tracing from java code.
2
3    Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    $Id: trace.h 8304 2007-08-14 19:57:20Z pm $
26
27 */
28
29 #ifndef _VM_JIT_TRACE_H
30 #define _VM_JIT_TRACE_H
31
32 #include <stdint.h>
33
34 #include "vmcore/method.h"
35
36 #if !defined(NDEBUG)
37
38 /* trace_java_call_enter ******************************************************
39  
40    Traces an entry into a java method.
41
42    arg_regs: Array of size ARG_CNT containing all argument registers in
43    the same format as in asm_vm_call_method. The array is usually allocated
44    on the stack and used for restoring the argument registers later.
45
46    stack: Pointer to first on stack argument in the same format passed to 
47    asm_vm_call_method.
48
49 *******************************************************************************/
50
51 void trace_java_call_enter(methodinfo *m, uint64_t *arg_regs, uint64_t *stack);
52
53 /* trace_java_call_exit ********************************************************
54  
55    Traces an exit form a java method.
56
57    return_regs: Array of size 3 containing return registers:
58      [0] : REG_RESULT
59          [1] : REG_RESULT2 (if available on architecture)
60          [2] : REG_FRESULT
61    The array is usually allocated on the stack and used for restoring the
62    registers later. The format of the array is the same as the format of 
63    register arguments passed to asm_vm_call_method.
64
65 *******************************************************************************/
66
67 void trace_java_call_exit(methodinfo *m, uint64_t *return_regs);
68
69 #endif /* !defined(NDEBUG) */
70
71 #endif
72