提交 7767167e 编写于 作者: R Rodrigo Kumpera

[sgen-bridge] New bridge implementation - currently is just a copy of the old one.

The bridge implementation can be picked by having bridge-implementation=old|new in
MONO_GC_PARAMS.

This commit just prepared the ground to land experimental improvements to the bridge
while retaining an working implementation by default.
上级 83341e84
......@@ -220,6 +220,7 @@ sgen_sources = \
sgen-bridge.c \
sgen-bridge.h \
sgen-old-bridge.c \
sgen-new-bridge.c \
sgen-toggleref.c \
sgen-toggleref.h \
sgen-gc.h \
......
......@@ -77,7 +77,19 @@ mono_gc_register_bridge_callbacks (MonoGCBridgeCallbacks *callbacks)
bridge_callbacks = *callbacks;
sgen_old_bridge_init (&bridge_processor);
if (!bridge_processor.reset_data)
sgen_old_bridge_init (&bridge_processor);
}
void
sgen_set_bridge_implementation (const char *name)
{
if (!strcmp ("old", name))
sgen_old_bridge_init (&bridge_processor);
else if (!strcmp ("new", name))
sgen_new_bridge_init (&bridge_processor);
else
g_warning ("Invalid value for bridge implementation, valid values are: 'new' and 'old'.");
}
gboolean
......
......@@ -4731,6 +4731,11 @@ mono_gc_base_init (void)
sgen_register_test_bridge_callbacks (g_strdup (opt));
continue;
}
if (g_str_has_prefix (opt, "bridge-implementation=")) {
opt = strchr (opt, '=') + 1;
sgen_set_bridge_implementation (opt);
continue;
}
if (g_str_has_prefix (opt, "toggleref-test")) {
sgen_register_test_toggleref_callback ();
continue;
......
......@@ -832,6 +832,8 @@ typedef struct {
} SgenBridgeProcessor;
void sgen_old_bridge_init (SgenBridgeProcessor *collector) MONO_INTERNAL;
void sgen_new_bridge_init (SgenBridgeProcessor *collector) MONO_INTERNAL;
void sgen_set_bridge_implementation (const char *name) MONO_INTERNAL;
typedef mono_bool (*WeakLinkAlivePredicateFunc) (MonoObject*, void*);
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册