forked from dotnet/macios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrampolines-internal.h
58 lines (46 loc) · 1.76 KB
/
trampolines-internal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef __TRAMPOLINES_INTERNAL_H__
#define __TRAMPOLINES_INTERNAL_H__
#include <stdbool.h>
#include "xamarin/mono-runtime.h"
#include "xamarin/runtime.h"
//#define TRACE
#ifdef TRACE
#define LOGZ(...) fprintf (stderr, __VA_ARGS__);
#else
#define LOGZ(...) ;
#endif
#ifdef __cplusplus
extern "C" {
#endif
// state: instance methods have the first bit cleared.
enum TrampolineType {
Tramp_Default = 0x0,
Tramp_Static = 0x1,
Tramp_Ctor = 0x2,
Tramp_FpretSingle = 0x4,
Tramp_StaticFpretSingle = Tramp_FpretSingle | Tramp_Static, // 0x5
Tramp_FpretDouble = 0x8,
Tramp_StaticFpretDouble = Tramp_FpretDouble | Tramp_Static, // 0x9
Tramp_Stret = 0x10,
Tramp_StaticStret = Tramp_Stret | Tramp_Static, // 0x11
Tramp_LongRet = 0x20,
Tramp_StaticLongRet = Tramp_Static | Tramp_LongRet, // 0x21
Tramp_DoubleStret = 0x40 | Tramp_Stret, // 0x50
Tramp_StaticDoubleStret = Tramp_DoubleStret | Tramp_Static, // 0x51
};
enum IteratorAction {
IteratorStart,
IteratorIterate,
IteratorEnd,
};
// type: pass NULL to start iterating.
// target: can be null if not interested in the value.
typedef void (*iterator_func) (enum IteratorAction action, void *context, const char *type, size_t size, void *target, GCHandle *exception_gchandle);
typedef void (*marshal_return_value_func) (void *context, const char *type, size_t size, void *value, MonoType *mtype, bool retain, MonoMethod *method, MethodDescription *desc, GCHandle *exception_gchandle);
void xamarin_invoke_trampoline (enum TrampolineType type, id self, SEL sel, iterator_func iterator, marshal_return_value_func marshal_return_value, void *context);
int xamarin_get_frame_length (id self, SEL sel);
const char * xamarin_skip_type_name (const char *ptr);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* __TRAMPOLINES_INTERNAL_H__ */