Skip to content

Commit 0c71975

Browse files
author
Alex Rønne Petersen
committed
[sgen] Move the independent parts of SGen to a separate library.
1 parent a000d0f commit 0c71975

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+381
-267
lines changed

configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -3881,6 +3881,7 @@ mono/arch/arm/Makefile
38813881
mono/arch/arm64/Makefile
38823882
mono/arch/ia64/Makefile
38833883
mono/arch/mips/Makefile
3884+
mono/sgen/Makefile
38843885
mono/tests/Makefile
38853886
mono/tests/tests-config
38863887
mono/tests/assemblyresolve/Makefile

mono/Makefile.am

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
if SUPPORT_SGEN
2+
sgen_dirs = sgen
3+
endif
4+
15
if CROSS_COMPILING
2-
SUBDIRS = arch utils io-layer cil metadata mini dis profiler
6+
SUBDIRS = arch utils io-layer cil metadata $(sgen_dirs) mini dis profiler
37
else
48
if INSTALL_MONOTOUCH
5-
SUBDIRS = utils io-layer metadata arch mini profiler
9+
SUBDIRS = utils io-layer metadata arch $(sgen_dirs) mini profiler
610

711
monotouch-do-build:
812
@list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -26,7 +30,7 @@ monotouch-do-clean:
2630
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$target); \
2731
done;
2832
else
29-
SUBDIRS = arch utils io-layer cil metadata mini dis tests unit-tests benchmark profiler
33+
SUBDIRS = arch utils io-layer cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler
3034
endif
3135
endif
32-
DIST_SUBDIRS = arch utils io-layer cil metadata mini dis tests unit-tests benchmark profiler
36+
DIST_SUBDIRS = arch utils io-layer cil metadata $(sgen_dirs) mini dis tests unit-tests benchmark profiler

mono/dis/Makefile.am

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ endif
66

77
if SUPPORT_SGEN
88
metadata_lib=$(top_builddir)/mono/metadata/libmonoruntimesgen-static.la
9+
gc_lib=$(top_builddir)/mono/sgen/libmonosgen-static.la
910
else
1011
metadata_lib=$(top_builddir)/mono/metadata/libmonoruntime-static.a
1112
gc_lib=$(LIBGC_STATIC_LIBS)
1213
endif
1314

1415
runtime_lib= \
1516
$(metadata_lib) \
17+
$(gc_lib) \
1618
$(top_builddir)/mono/io-layer/libwapi.la \
1719
$(top_builddir)/mono/utils/libmonoutils.la \
18-
$(GLIB_LIBS) $(LIBICONV) \
19-
$(gc_lib)
20+
$(GLIB_LIBS) $(LIBICONV)
2021

2122
if DISABLE_EXECUTABLES
2223
bin_PROGRAMS =

mono/metadata/Makefile.am

-51
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ common_sources = \
129129
filewatcher.c \
130130
filewatcher.h \
131131
gc-internal.h \
132-
gc-internal-agnostic.h \
133-
gc-memfuncs.c \
134-
gc-parse.c \
135132
icall.c \
136133
icall-def.h \
137134
image.c \
@@ -242,11 +239,6 @@ sgen_sources = \
242239
sgen-os-posix.c \
243240
sgen-os-mach.c \
244241
sgen-os-win32.c \
245-
sgen-gc.c \
246-
sgen-internal.c \
247-
sgen-marksweep.c \
248-
sgen-los.c \
249-
sgen-protocol.c \
250242
sgen-bridge.c \
251243
sgen-bridge.h \
252244
sgen-bridge-internal.h \
@@ -255,51 +247,8 @@ sgen_sources = \
255247
sgen-tarjan-bridge.c \
256248
sgen-toggleref.c \
257249
sgen-toggleref.h \
258-
sgen-gc.h \
259-
sgen-conf.h \
260-
sgen-archdep.h \
261-
sgen-cardtable.c \
262-
sgen-cardtable.h \
263-
sgen-pointer-queue.c \
264-
sgen-pointer-queue.h \
265-
sgen-pinning.c \
266-
sgen-pinning.h \
267-
sgen-pinning-stats.c \
268-
sgen-workers.c \
269-
sgen-workers.h \
270-
sgen-gray.c \
271-
sgen-gray.h \
272-
sgen-major-copy-object.h \
273-
sgen-minor-copy-object.h \
274-
sgen-copy-object.h \
275-
sgen-marksweep-scan-object-concurrent.h \
276-
sgen-minor-scan-object.h \
277-
sgen-marksweep-drain-gray-stack.h \
278-
sgen-protocol.h \
279-
sgen-protocol-def.h \
280-
sgen-scan-object.h \
281-
sgen-nursery-allocator.c \
282-
sgen-hash-table.c \
283-
sgen-hash-table.h \
284-
sgen-descriptor.c \
285-
sgen-descriptor.h \
286-
sgen-alloc.c \
287-
sgen-debug.c \
288-
sgen-simple-nursery.c \
289-
sgen-split-nursery.c \
290-
sgen-memory-governor.c \
291-
sgen-memory-governor.h \
292250
sgen-stw.c \
293-
sgen-fin-weak-hash.c \
294-
sgen-layout-stats.c \
295-
sgen-layout-stats.h \
296-
sgen-qsort.c \
297-
sgen-qsort.h \
298-
sgen-thread-pool.c \
299-
sgen-thread-pool.h \
300-
sgen-tagged-pointer.h \
301251
sgen-mono.c \
302-
sgen-client.h \
303252
sgen-client-mono.h
304253

305254
libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)

mono/metadata/gc-internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <glib.h>
1414
#include <mono/metadata/object-internals.h>
1515
#include <mono/metadata/threads-types.h>
16-
#include <mono/metadata/gc-internal-agnostic.h>
16+
#include <mono/sgen/gc-internal-agnostic.h>
1717
#include <mono/utils/gc_wrapper.h>
1818

1919
#define mono_domain_finalizers_lock(domain) mono_mutex_lock (&(domain)->finalizable_objects_hash_lock);

mono/metadata/gc-stats.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1818
*/
1919

20-
#include "mono/metadata/gc-internal-agnostic.h"
20+
#include "mono/sgen/gc-internal-agnostic.h"
2121

2222
/*
2323
* Due to a bug in the linker on Darwin we need to initialize this struct, or there will be

mono/metadata/gc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <mono/metadata/threadpool.h>
2626
#include <mono/metadata/threadpool-internals.h>
2727
#include <mono/metadata/threads-types.h>
28-
#include <mono/metadata/sgen-conf.h>
28+
#include <mono/sgen/sgen-conf.h>
2929
#include <mono/utils/mono-logger-internal.h>
3030
#include <mono/metadata/gc-internal.h>
3131
#include <mono/metadata/marshal.h> /* for mono_delegate_free_ftnptr () */

mono/metadata/sgen-bridge-internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include "mono/utils/mono-compiler.h"
2828

29-
#include "mono/metadata/sgen-gc.h"
29+
#include "mono/sgen/sgen-gc.h"
3030
#include "mono/metadata/sgen-bridge.h"
3131

3232
extern gboolean bridge_processing_in_progress;

mono/metadata/sgen-bridge.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343

4444
#include <stdlib.h>
4545

46-
#include "sgen-gc.h"
46+
#include "sgen/sgen-gc.h"
4747
#include "sgen-bridge-internal.h"
48-
#include "sgen-hash-table.h"
49-
#include "sgen-qsort.h"
48+
#include "sgen/sgen-hash-table.h"
49+
#include "sgen/sgen-qsort.h"
5050
#include "utils/mono-logger-internal.h"
5151

5252
MonoGCBridgeCallbacks bridge_callbacks;

mono/metadata/sgen-client-mono.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#ifdef SGEN_DEFINE_OBJECT_VTABLE
2121

22-
#include "metadata/sgen-archdep.h"
22+
#include "sgen/sgen-archdep.h"
2323
#include "utils/mono-threads.h"
2424
#include "utils/mono-mmap.h"
2525
#include "metadata/object-internals.h"

mono/metadata/sgen-mono.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
#include "config.h"
2121
#ifdef HAVE_SGEN_GC
2222

23-
#include "metadata/sgen-gc.h"
24-
#include "metadata/sgen-protocol.h"
23+
#include "sgen/sgen-gc.h"
24+
#include "sgen/sgen-protocol.h"
2525
#include "metadata/monitor.h"
26-
#include "metadata/sgen-layout-stats.h"
27-
#include "metadata/sgen-client.h"
28-
#include "metadata/sgen-cardtable.h"
29-
#include "metadata/sgen-pinning.h"
26+
#include "sgen/sgen-layout-stats.h"
27+
#include "sgen/sgen-client.h"
28+
#include "sgen/sgen-cardtable.h"
29+
#include "sgen/sgen-pinning.h"
3030
#include "metadata/marshal.h"
3131
#include "metadata/method-builder.h"
3232
#include "metadata/abi-details.h"
@@ -92,7 +92,7 @@ static void
9292
scan_object_for_binary_protocol_copy_wbarrier (gpointer dest, char *start, mword desc)
9393
{
9494
#define SCAN_OBJECT_NOVTABLE
95-
#include "sgen-scan-object.h"
95+
#include "sgen/sgen-scan-object.h"
9696
}
9797
#endif
9898

@@ -2031,7 +2031,7 @@ collect_references (HeapWalkInfo *hwi, char *start, size_t size)
20312031
{
20322032
mword desc = sgen_obj_get_descriptor (start);
20332033

2034-
#include "sgen-scan-object.h"
2034+
#include "sgen/sgen-scan-object.h"
20352035
}
20362036

20372037
static void

mono/metadata/sgen-new-bridge.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
#include <stdlib.h>
4545
#include <errno.h>
4646

47-
#include "sgen-gc.h"
47+
#include "sgen/sgen-gc.h"
4848
#include "sgen-bridge-internal.h"
49-
#include "sgen-hash-table.h"
50-
#include "sgen-qsort.h"
51-
#include "sgen-client.h"
49+
#include "sgen/sgen-hash-table.h"
50+
#include "sgen/sgen-qsort.h"
51+
#include "sgen/sgen-client.h"
5252
#include "tabledefs.h"
5353
#include "utils/mono-logger-internal.h"
5454

@@ -672,7 +672,7 @@ dfs1 (HashEntry *obj_entry)
672672
dyn_array_ptr_push (&dfs_stack, obj_entry);
673673
dyn_array_ptr_push (&dfs_stack, NULL);
674674

675-
#include "sgen-scan-object.h"
675+
#include "sgen/sgen-scan-object.h"
676676

677677
/*
678678
* We can remove non-bridge objects with a single outgoing

mono/metadata/sgen-old-bridge.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343

4444
#include <stdlib.h>
4545

46-
#include "sgen-gc.h"
46+
#include "sgen/sgen-gc.h"
4747
#include "sgen-bridge-internal.h"
48-
#include "sgen-hash-table.h"
49-
#include "sgen-qsort.h"
50-
#include "sgen-client.h"
48+
#include "sgen/sgen-hash-table.h"
49+
#include "sgen/sgen-qsort.h"
50+
#include "sgen/sgen-client.h"
5151
#include "utils/mono-logger-internal.h"
5252

5353
typedef struct {
@@ -542,7 +542,7 @@ dfs1 (HashEntry *obj_entry)
542542
/* NULL marks that the next entry is to be finished */
543543
dyn_array_ptr_push (&dfs_stack, NULL);
544544

545-
#include "sgen-scan-object.h"
545+
#include "sgen/sgen-scan-object.h"
546546
} else {
547547
obj_entry = dyn_array_ptr_pop (&dfs_stack);
548548

mono/metadata/sgen-os-mach.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828

2929

3030
#include <glib.h>
31-
#include "metadata/sgen-gc.h"
32-
#include "metadata/sgen-archdep.h"
33-
#include "metadata/sgen-protocol.h"
34-
#include "metadata/sgen-thread-pool.h"
31+
#include "sgen/sgen-gc.h"
32+
#include "sgen/sgen-archdep.h"
33+
#include "sgen/sgen-protocol.h"
34+
#include "sgen/sgen-thread-pool.h"
3535
#include "metadata/object-internals.h"
3636
#include "metadata/gc-internal.h"
3737

mono/metadata/sgen-os-posix.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030

3131
#include <errno.h>
3232
#include <glib.h>
33-
#include "metadata/sgen-gc.h"
33+
#include "sgen/sgen-gc.h"
3434
#include "metadata/gc-internal.h"
35-
#include "metadata/sgen-archdep.h"
35+
#include "sgen/sgen-archdep.h"
3636
#include "metadata/object-internals.h"
3737
#include "utils/mono-signal-handler.h"
3838

mono/metadata/sgen-os-win32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "io-layer/io-layer.h"
66

7-
#include "metadata/sgen-gc.h"
7+
#include "sgen/sgen-gc.h"
88
#include "metadata/gc-internal.h"
99

1010
gboolean

mono/metadata/sgen-stw.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
#include "config.h"
2828
#ifdef HAVE_SGEN_GC
2929

30-
#include "metadata/sgen-gc.h"
31-
#include "metadata/sgen-protocol.h"
32-
#include "metadata/sgen-memory-governor.h"
33-
#include "metadata/sgen-thread-pool.h"
30+
#include "sgen/sgen-gc.h"
31+
#include "sgen/sgen-protocol.h"
32+
#include "sgen/sgen-memory-governor.h"
33+
#include "sgen/sgen-thread-pool.h"
3434
#include "metadata/profiler-private.h"
35-
#include "metadata/sgen-client.h"
35+
#include "sgen/sgen-client.h"
3636
#include "metadata/sgen-bridge-internal.h"
3737
#include "metadata/gc-internal.h"
3838

mono/metadata/sgen-tarjan-bridge.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343

4444
#include <stdlib.h>
4545

46-
#include "sgen-gc.h"
46+
#include "sgen/sgen-gc.h"
4747
#include "sgen-bridge-internal.h"
48-
#include "sgen-hash-table.h"
49-
#include "sgen-qsort.h"
48+
#include "sgen/sgen-hash-table.h"
49+
#include "sgen/sgen-qsort.h"
5050
#include "tabledefs.h"
5151
#include "utils/mono-logger-internal.h"
5252

@@ -664,7 +664,7 @@ push_all (ScanData *data)
664664
printf ("**scanning %p %s\n", obj, safe_name_bridge (obj));
665665
#endif
666666

667-
#include "sgen-scan-object.h"
667+
#include "sgen/sgen-scan-object.h"
668668
}
669669

670670

@@ -712,7 +712,7 @@ compute_low (ScanData *data)
712712
char *start = (char*)obj;
713713
mword desc = sgen_obj_get_descriptor_safe (start);
714714

715-
#include "sgen-scan-object.h"
715+
#include "sgen/sgen-scan-object.h"
716716
}
717717

718718
static ColorData*

mono/metadata/sgen-toggleref.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

2626
#ifdef HAVE_SGEN_GC
2727

28-
#include "sgen-gc.h"
28+
#include "sgen/sgen-gc.h"
2929
#include "sgen-toggleref.h"
30-
#include "sgen-client.h"
30+
#include "sgen/sgen-client.h"
3131

3232

3333
/*only one of the two can be non null at a given time*/

0 commit comments

Comments
 (0)