Merged.
[cacao.git] / src / vm / jit / stubs.hpp
1 /* src/vm/jit/stubs.hpp - JIT stubs
2
3    Copyright (C) 2008 Theobroma Systems Ltd.
4
5    This file is part of CACAO.
6
7    This program is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License as
9    published by the Free Software Foundation; either version 2, or (at
10    your option) any later version.
11
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20    02110-1301, USA.
21
22 */
23
24
25 #ifndef _STUBS_HPP
26 #define _STUBS_HPP
27
28 #include "config.h"
29
30 #include <stdint.h>
31
32 #include "vm/method.hpp"
33
34 #include "vm/jit/code.hpp"
35
36
37 #ifdef __cplusplus
38
39 /**
40  * Class for compiler stub generation.
41  */
42 class CompilerStub {
43 public:
44         static inline int get_code_size();
45
46         static void* generate(methodinfo* m);
47         static void  remove(void* stub);
48 };
49
50
51 /**
52  * Class for builtin stub generation.
53  */
54 class BuiltinStub {
55 public:
56         static void generate(methodinfo* m, builtintable_entry* bte);
57 };
58
59
60 /**
61  * Class for native stub generation.
62  */
63 class NativeStub {
64 public:
65         static codeinfo* generate(methodinfo* m, functionptr f);
66         static void      remove(void* stub);
67 };
68
69
70 // Include machine dependent implementation.
71 #include "md-stubs.hpp"
72
73 #else
74
75 // Legacy C interface.
76
77 void*     CompilerStub_generate(methodinfo* m);
78 void*     CompilerStub_remove(void* stub);
79 void      BuiltinStub_generate(methodinfo* m, builtintable_entry* bte);
80 void      NativeStub_remove(void* stub);
81
82 #endif
83
84 #endif // _STUBS_HPP
85
86
87 /*
88  * These are local overrides for various environment variables in Emacs.
89  * Please do not remove this and leave it at the end of the file, where
90  * Emacs will automagically detect them.
91  * ---------------------------------------------------------------------
92  * Local variables:
93  * mode: c++
94  * indent-tabs-mode: t
95  * c-basic-offset: 4
96  * tab-width: 4
97  * End:
98  * vim:noexpandtab:sw=4:ts=4:
99  */