+ klass = SGEN_LOAD_VTABLE (obj)->klass;
+
+ return mono_class_has_parent_fast (klass, mono_defaults.critical_finalizer_object);
+}
+
+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_REQUESTED (generation, requested_size, force);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_collection_begin (int minor_gc_count, int generation)
+{
+ 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
+sgen_client_binary_protocol_collection_end (int minor_gc_count, int generation, long long num_objects_scanned, long long num_unique_objects_scanned)
+{
+ MONO_GC_END (generation);
+
+ mono_profiler_gc_event (MONO_GC_EVENT_END, generation);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_concurrent_start (void)
+{
+ MONO_GC_CONCURRENT_START_BEGIN (GENERATION_OLD);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_concurrent_update (void)
+{
+ MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD, sgen_get_major_collector ()->get_and_reset_num_major_objects_marked ());
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_concurrent_finish (void)
+{
+ MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD, sgen_get_major_collector ()->get_and_reset_num_major_objects_marked ());
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_sweep_begin (int generation, int full_sweep)
+{
+ MONO_GC_SWEEP_BEGIN (generation, full_sweep);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_sweep_end (int generation, int full_sweep)
+{
+ MONO_GC_SWEEP_END (generation, full_sweep);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_world_stopping (int generation, long long timestamp, gpointer thread)
+{
+ MONO_GC_WORLD_STOP_BEGIN ();
+
+ mono_profiler_gc_event (MONO_GC_EVENT_PRE_STOP_WORLD, generation);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_world_stopped (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_GC_WORLD_STOP_END ();
+
+ mono_profiler_gc_event (MONO_GC_EVENT_POST_STOP_WORLD, generation);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_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_GC_WORLD_RESTART_BEGIN (generation);
+
+ mono_profiler_gc_event (MONO_GC_EVENT_PRE_START_WORLD, generation);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_world_restarted (int generation, long long timestamp)
+{
+ MONO_GC_WORLD_RESTART_END (generation);
+
+ mono_profiler_gc_event (MONO_GC_EVENT_POST_START_WORLD, generation);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_block_alloc (gpointer addr, size_t size)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_block_free (gpointer addr, size_t size)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_block_set_state (gpointer addr, size_t size, int old, int new)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_mark_start (int generation)
+{
+ mono_profiler_gc_event (MONO_GC_EVENT_MARK_START, generation);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_mark_end (int generation)
+{
+ mono_profiler_gc_event (MONO_GC_EVENT_MARK_END, generation);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_reclaim_start (int generation)
+{
+ mono_profiler_gc_event (MONO_GC_EVENT_RECLAIM_START, generation);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_reclaim_end (int generation)
+{
+ mono_profiler_gc_event (MONO_GC_EVENT_RECLAIM_END, generation);
+}
+
+static void
+mono_binary_protocol_alloc_generic (gpointer obj, gpointer vtable, size_t size, gboolean pinned)
+{
+#ifdef ENABLE_DTRACE
+ const char *namespace = sgen_client_vtable_get_namespace (vtable);
+ const char *name = sgen_client_vtable_get_name (vtable);
+
+ if (sgen_ptr_in_nursery (obj)) {
+ if (G_UNLIKELY (MONO_GC_NURSERY_OBJ_ALLOC_ENABLED ()))
+ MONO_GC_NURSERY_OBJ_ALLOC ((mword)obj, size, namespace, name);
+ } else {
+ if (size > SGEN_MAX_SMALL_OBJ_SIZE) {
+ if (G_UNLIKELY (MONO_GC_MAJOR_OBJ_ALLOC_LARGE_ENABLED ()))
+ MONO_GC_MAJOR_OBJ_ALLOC_LARGE ((mword)obj, size, namespace, name);
+ } else if (pinned) {
+ MONO_GC_MAJOR_OBJ_ALLOC_PINNED ((mword)obj, size, namespace, name);
+ }
+ }
+#endif
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_alloc (gpointer obj, gpointer vtable, size_t size, gpointer provenance)
+{
+ mono_binary_protocol_alloc_generic (obj, vtable, size, FALSE);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_alloc_pinned (gpointer obj, gpointer vtable, size_t size, gpointer provenance)
+{
+ mono_binary_protocol_alloc_generic (obj, vtable, size, TRUE);
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_alloc_degraded (gpointer obj, gpointer vtable, size_t size, gpointer provenance)
+{
+ MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED ((mword)obj, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
+}