#ifdef SGEN_DEFINE_OBJECT_VTABLE
+#include "metadata/sgen-archdep.h"
#include "utils/mono-threads.h"
#include "utils/mono-mmap.h"
+#include "metadata/object-internals.h"
typedef MonoObject GCObject;
typedef MonoVTable GCVTable;
return sgen_client_slow_object_get_size (vtable, o);
}
+static inline size_t
+sgen_client_vtable_get_instance_size (MonoVTable *vtable)
+{
+ return vtable->klass->instance_size;
+}
+
typedef struct _SgenClientThreadInfo SgenClientThreadInfo;
struct _SgenClientThreadInfo {
MonoThreadInfo info;
#include "utils/dtrace.h"
#include "utils/mono-counters.h"
#include "utils/mono-logger-internal.h"
+#include "utils/mono-time.h"
+#include "utils/mono-semaphore.h"
+#include "metadata/sgen-bridge-internal.h"
extern void mono_sgen_register_moved_object (void *obj, void *destination);
extern void mono_sgen_gc_event_moves (void);
const char* sgen_client_vtable_get_namespace (GCVTable *vtable);
const char* sgen_client_vtable_get_name (GCVTable *vtable);
+static gboolean G_GNUC_UNUSED
+sgen_client_bridge_need_processing (void)
+{
+ return sgen_need_bridge_processing ();
+}
+
+static void G_GNUC_UNUSED
+sgen_client_bridge_reset_data (void)
+{
+ sgen_bridge_reset_data ();
+}
+
+static void G_GNUC_UNUSED
+sgen_client_bridge_processing_stw_step (void)
+{
+ sgen_bridge_processing_stw_step ();
+}
+
+static void G_GNUC_UNUSED
+sgen_client_bridge_wait_for_processing (void)
+{
+ mono_gc_wait_for_bridge_processing ();
+}
+
+static void G_GNUC_UNUSED
+sgen_client_bridge_processing_finish (int generation)
+{
+ sgen_bridge_processing_finish (generation);
+}
+
+static gboolean G_GNUC_UNUSED
+sgen_client_bridge_is_bridge_object (GCObject *obj)
+{
+ return sgen_is_bridge_object (obj);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_bridge_register_finalized_object (GCObject *object)
+{
+ sgen_bridge_register_finalized_object (object);
+}
+
static void G_GNUC_UNUSED
sgen_client_binary_protocol_collection_requested (int generation, size_t requested_size, gboolean force)
{
MONO_GC_BEGIN (generation);
mono_profiler_gc_event (MONO_GC_EVENT_START, generation);
+
+#ifndef DISABLE_PERFCOUNTERS
+ if (generation == GENERATION_NURSERY)
+ mono_perfcounters->gc_collections0++;
+ else
+ mono_perfcounters->gc_collections1++;
+#endif
}
static void G_GNUC_UNUSED
void sgen_wait_for_suspend_ack (int count);
#ifdef HAVE_KW_THREAD
+extern __thread SgenThreadInfo *sgen_thread_info;
#define TLAB_ACCESS_INIT
#define IN_CRITICAL_REGION sgen_thread_info->client_info.in_critical_region
#else
+extern MonoNativeTlsKey thread_info_key;
#define TLAB_ACCESS_INIT SgenThreadInfo *__thread_info__ = mono_native_tls_get_value (thread_info_key)
#define IN_CRITICAL_REGION (__thread_info__->client_info.in_critical_region)
#endif
#endif
+#define SGEN_TV_DECLARE(name) gint64 name
+#define SGEN_TV_GETTIME(tv) tv = mono_100ns_ticks ()
+#define SGEN_TV_ELAPSED(start,end) (int)((end-start))
+
+typedef MonoSemType SgenSemaphore;
+
+#define SGEN_SEMAPHORE_INIT(sem,initial) MONO_SEM_INIT ((sem), (initial))
+#define SGEN_SEMAPHORE_POST(sem) MONO_SEM_POST ((sem))
+#define SGEN_SEMAPHORE_WAIT(sem) MONO_SEM_WAIT ((sem))
+
#endif