Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / sgen-bridge-internals.h
1 /**
2  * \file
3  * The cross-GC bridge.
4  *
5  * Copyright (C) 2015 Xamarin Inc
6  *
7  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
8  */
9
10 #ifndef __MONO_SGENBRIDGEINTERNAL_H__
11 #define __MONO_SGENBRIDGEINTERNAL_H__
12
13 #include "config.h"
14
15 #ifdef HAVE_SGEN_GC
16
17 #include "mono/utils/mono-compiler.h"
18
19 #include "mono/sgen/sgen-gc.h"
20 #include "mono/metadata/sgen-bridge.h"
21
22 extern volatile gboolean bridge_processing_in_progress;
23 extern MonoGCBridgeCallbacks bridge_callbacks;
24
25 gboolean sgen_need_bridge_processing (void);
26 void sgen_bridge_reset_data (void);
27 void sgen_bridge_processing_stw_step (void);
28 void sgen_bridge_processing_finish (int generation);
29 gboolean sgen_is_bridge_object (GCObject *obj);
30 MonoGCBridgeObjectKind sgen_bridge_class_kind (MonoClass *klass);
31 void sgen_bridge_register_finalized_object (GCObject *object);
32 void sgen_bridge_describe_pointer (GCObject *object);
33
34 gboolean sgen_is_bridge_object (GCObject *obj);
35 void sgen_mark_bridge_object (GCObject *obj);
36
37 gboolean sgen_bridge_handle_gc_param (const char *opt);
38 gboolean sgen_bridge_handle_gc_debug (const char *opt);
39 void sgen_bridge_print_gc_debug_usage (void);
40
41 typedef struct {
42         char *dump_prefix;
43         gboolean accounting;
44         gboolean scc_precise_merge; // Used by Tarjan
45 } SgenBridgeProcessorConfig;
46
47 typedef struct {
48         void (*reset_data) (void);
49         void (*processing_stw_step) (void);
50         void (*processing_build_callback_data) (int generation);
51         void (*processing_after_callback) (int generation);
52         MonoGCBridgeObjectKind (*class_kind) (MonoClass *klass);
53         void (*register_finalized_object) (GCObject *object);
54         void (*describe_pointer) (GCObject *object);
55
56         /* Should be called once, immediately after init */
57         void (*set_config) (const SgenBridgeProcessorConfig *);
58
59         /*
60          * These are set by processing_build_callback_data().
61          */
62         int num_sccs;
63         MonoGCBridgeSCC **api_sccs;
64
65         int num_xrefs;
66         MonoGCBridgeXRef *api_xrefs;
67 } SgenBridgeProcessor;
68
69 void sgen_old_bridge_init (SgenBridgeProcessor *collector);
70 void sgen_new_bridge_init (SgenBridgeProcessor *collector);
71 void sgen_tarjan_bridge_init (SgenBridgeProcessor *collector);
72 void sgen_set_bridge_implementation (const char *name);
73 void sgen_bridge_set_dump_prefix (const char *prefix);
74 void sgen_init_bridge (void);
75
76 #endif
77
78 #endif