/
sgen-protocol.h
317 lines (270 loc) · 9.49 KB
/
sgen-protocol.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
/*
* sgen-protocol.h: Binary protocol of internal activity, to aid
* debugging.
*
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
* Copyright (C) 2012 Xamarin Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License 2.0 as published by the Free Software Foundation;
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License 2.0 along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __MONO_SGENPROTOCOL_H__
#define __MONO_SGENPROTOCOL_H__
#include "sgen-gc.h"
enum {
SGEN_PROTOCOL_COLLECTION_FORCE,
SGEN_PROTOCOL_COLLECTION_BEGIN,
SGEN_PROTOCOL_COLLECTION_END,
SGEN_PROTOCOL_CONCURRENT_START,
SGEN_PROTOCOL_CONCURRENT_UPDATE_FINISH,
SGEN_PROTOCOL_WORLD_STOPPING,
SGEN_PROTOCOL_WORLD_STOPPED,
SGEN_PROTOCOL_WORLD_RESTARTING,
SGEN_PROTOCOL_WORLD_RESTARTED,
SGEN_PROTOCOL_ALLOC,
SGEN_PROTOCOL_COPY,
SGEN_PROTOCOL_PIN,
SGEN_PROTOCOL_MARK,
SGEN_PROTOCOL_SCAN_BEGIN,
SGEN_PROTOCOL_SCAN_VTYPE_BEGIN,
SGEN_PROTOCOL_WBARRIER,
SGEN_PROTOCOL_GLOBAL_REMSET,
SGEN_PROTOCOL_PTR_UPDATE,
SGEN_PROTOCOL_CLEANUP,
SGEN_PROTOCOL_EMPTY,
SGEN_PROTOCOL_THREAD_SUSPEND,
SGEN_PROTOCOL_THREAD_RESTART,
SGEN_PROTOCOL_THREAD_REGISTER,
SGEN_PROTOCOL_THREAD_UNREGISTER,
SGEN_PROTOCOL_MISSING_REMSET,
SGEN_PROTOCOL_ALLOC_PINNED,
SGEN_PROTOCOL_ALLOC_DEGRADED,
SGEN_PROTOCOL_CARD_SCAN,
SGEN_PROTOCOL_CEMENT,
SGEN_PROTOCOL_CEMENT_RESET,
SGEN_PROTOCOL_DISLINK_UPDATE,
SGEN_PROTOCOL_DISLINK_UPDATE_STAGED,
SGEN_PROTOCOL_DISLINK_PROCESS_STAGED,
SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN,
SGEN_PROTOCOL_DOMAIN_UNLOAD_END,
SGEN_PROTOCOL_GRAY_ENQUEUE,
SGEN_PROTOCOL_GRAY_DEQUEUE,
};
typedef struct {
int generation;
} SGenProtocolCollectionForce;
typedef struct {
int index, generation;
} SGenProtocolCollection;
typedef struct {
long long timestamp;
} SGenProtocolWorldStopping;
typedef struct {
long long timestamp;
long long total_major_cards;
long long marked_major_cards;
long long total_los_cards;
long long marked_los_cards;
} SGenProtocolWorldStopped;
typedef struct {
int generation;
long long timestamp;
long long total_major_cards;
long long marked_major_cards;
long long total_los_cards;
long long marked_los_cards;
} SGenProtocolWorldRestarting;
typedef struct {
int generation;
long long timestamp;
} SGenProtocolWorldRestarted;
typedef struct {
gpointer obj;
gpointer vtable;
int size;
} SGenProtocolAlloc;
typedef struct {
gpointer from;
gpointer to;
gpointer vtable;
int size;
} SGenProtocolCopy;
typedef struct {
gpointer obj;
gpointer vtable;
int size;
} SGenProtocolPin;
typedef struct {
gpointer obj;
gpointer vtable;
int size;
} SGenProtocolMark;
typedef struct {
gpointer obj;
gpointer vtable;
int size;
} SGenProtocolScanBegin;
typedef struct {
gpointer obj;
int size;
} SGenProtocolScanVTypeBegin;
typedef struct {
gpointer ptr;
gpointer value;
gpointer value_vtable;
} SGenProtocolWBarrier;
typedef struct {
gpointer ptr;
gpointer value;
gpointer value_vtable;
} SGenProtocolGlobalRemset;
typedef struct {
gpointer ptr;
gpointer old_value;
gpointer new_value;
gpointer vtable;
int size;
} SGenProtocolPtrUpdate;
typedef struct {
gpointer ptr;
gpointer vtable;
int size;
} SGenProtocolCleanup;
typedef struct {
gpointer start;
int size;
} SGenProtocolEmpty;
typedef struct {
gpointer thread, stopped_ip;
} SGenProtocolThreadSuspend;
typedef struct {
gpointer thread;
} SGenProtocolThreadRestart;
typedef struct {
gpointer thread;
} SGenProtocolThreadRegister;
typedef struct {
gpointer thread;
} SGenProtocolThreadUnregister;
typedef struct {
gpointer obj;
gpointer obj_vtable;
int offset;
gpointer value;
gpointer value_vtable;
int value_pinned;
} SGenProtocolMissingRemset;
typedef struct {
gpointer start;
int size;
} SGenProtocolCardScan;
typedef struct {
gpointer obj;
gpointer vtable;
int size;
} SGenProtocolCement;
typedef struct {
gpointer link;
gpointer obj;
int track;
int staged;
} SGenProtocolDislinkUpdate;
typedef struct {
gpointer link;
gpointer obj;
int track;
int index;
} SGenProtocolDislinkUpdateStaged;
typedef struct {
gpointer link;
gpointer obj;
int index;
} SGenProtocolDislinkProcessStaged;
typedef struct {
gpointer domain;
} SGenProtocolDomainUnload;
typedef struct {
gpointer queue;
gpointer cursor;
gpointer value;
} SGenProtocolGrayQueue;
/* missing: finalizers, roots, non-store wbarriers */
void binary_protocol_init (const char *filename, long long limit) MONO_INTERNAL;
gboolean binary_protocol_is_enabled (void) MONO_INTERNAL;
void binary_protocol_flush_buffers (gboolean force) MONO_INTERNAL;
void binary_protocol_collection_force (int generation) MONO_INTERNAL;
void binary_protocol_collection_begin (int index, int generation) MONO_INTERNAL;
void binary_protocol_collection_end (int index, int generation) MONO_INTERNAL;
void binary_protocol_concurrent_start (void) MONO_INTERNAL;
void binary_protocol_concurrent_update_finish (void) MONO_INTERNAL;
void binary_protocol_world_stopping (long long timestamp) MONO_INTERNAL;
void binary_protocol_world_stopped (long long timestamp, long long total_major_cards,
long long marked_major_cards, long long total_los_cards, long long marked_los_cards) MONO_INTERNAL;
void binary_protocol_world_restarting (int generation, long long timestamp,
long long total_major_cards, long long marked_major_cards, long long total_los_cards, long long marked_los_cards) MONO_INTERNAL;
void binary_protocol_world_restarted (int generation, long long timestamp) MONO_INTERNAL;
void binary_protocol_thread_suspend (gpointer thread, gpointer stopped_ip) MONO_INTERNAL;
void binary_protocol_thread_restart (gpointer thread) MONO_INTERNAL;
void binary_protocol_thread_register (gpointer thread) MONO_INTERNAL;
void binary_protocol_thread_unregister (gpointer thread) MONO_INTERNAL;
void binary_protocol_missing_remset (gpointer obj, gpointer obj_vtable, int offset,
gpointer value, gpointer value_vtable, int value_pinned) MONO_INTERNAL;
void binary_protocol_cement (gpointer ptr, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_cement_reset (void) MONO_INTERNAL;
void binary_protocol_domain_unload_begin (gpointer domain) MONO_INTERNAL;
void binary_protocol_domain_unload_end (gpointer domain) MONO_INTERNAL;
#ifdef SGEN_HEAVY_BINARY_PROTOCOL
#define binary_protocol_is_heavy_enabled() binary_protocol_is_enabled ()
void binary_protocol_alloc (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_alloc_pinned (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_alloc_degraded (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_copy (gpointer from, gpointer to, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_pin (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_mark (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_scan_begin (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_scan_vtype_begin (gpointer start, int size) MONO_INTERNAL;
void binary_protocol_wbarrier (gpointer ptr, gpointer value, gpointer value_vtable) MONO_INTERNAL;
void binary_protocol_global_remset (gpointer ptr, gpointer value, gpointer value_vtable) MONO_INTERNAL;
void binary_protocol_ptr_update (gpointer ptr, gpointer old_value, gpointer new_value, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_cleanup (gpointer ptr, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_empty (gpointer start, int size) MONO_INTERNAL;
void binary_protocol_card_scan (gpointer start, int size) MONO_INTERNAL;
void binary_protocol_dislink_update (gpointer link, gpointer obj, int track, int staged) MONO_INTERNAL;
void binary_protocol_dislink_update_staged (gpointer link, gpointer obj, int track, int index) MONO_INTERNAL;
void binary_protocol_dislink_process_staged (gpointer link, gpointer obj, int index) MONO_INTERNAL;
void binary_protocol_gray_enqueue (gpointer queue, gpointer cursor, gpointer value) MONO_INTERNAL;
void binary_protocol_gray_dequeue (gpointer queue, gpointer cursor, gpointer value) MONO_INTERNAL;
#else
#define binary_protocol_is_heavy_enabled() FALSE
#define binary_protocol_alloc(obj, vtable, size)
#define binary_protocol_alloc_pinned(obj, vtable, size)
#define binary_protocol_alloc_degraded(obj, vtable, size)
#define binary_protocol_copy(from, to, vtable, size)
#define binary_protocol_pin(obj, vtable, size)
#define binary_protocol_mark(obj, vtable, size)
#define binary_protocol_scan_begin(obj, vtable, size)
#define binary_protocol_scan_vtype_begin(obj, size)
#define binary_protocol_wbarrier(ptr, value, value_vtable)
#define binary_protocol_global_remset(ptr, value, value_vtable)
#define binary_protocol_ptr_update(ptr, old_value, new_value, vtable, size)
#define binary_protocol_cleanup(ptr, vtable, size)
#define binary_protocol_empty(start, size)
#define binary_protocol_card_scan(start, size)
#define binary_protocol_dislink_update(link,obj,track,staged)
#define binary_protocol_dislink_update_staged(link,obj,track,index)
#define binary_protocol_dislink_process_staged(link,obj,index)
#define binary_protocol_gray_enqueue(queue,cursor,value)
#define binary_protocol_gray_dequeue(queue,cursor,value)
#endif
#endif