Merge pull request #5415 from kumpera/wasm-support
[mono.git] / mono / metadata / class-internals.h
index 99c8d5b593d397041a059287ea79b1d47b997bb7..67f360e975e3bd44ed0f3f8213170d341c133904 100644 (file)
@@ -1,4 +1,5 @@
-/* 
+/**
+ * \file
  * Copyright 2012 Xamarin Inc
  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
  */
@@ -36,8 +37,10 @@ typedef struct _MonoMethodPInvoke MonoMethodPInvoke;
 
 #ifdef ENABLE_ICALL_EXPORT
 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
+#define ICALL_DECL_EXPORT MONO_API
 #define ICALL_EXPORT MONO_API
 #else
+#define ICALL_DECL_EXPORT
 #define ICALL_EXPORT static
 #endif
 
@@ -389,6 +392,9 @@ typedef struct {
 typedef struct {
        MonoClassDef class;
        MonoGenericContainer *generic_container;
+       /* The canonical GENERICINST where we instantiate a generic type definition with its own generic parameters.*/
+       /* Suppose we have class T`2<A,B> {...}.  canonical_inst is the GTD T`2 applied to A and B. */
+       MonoType canonical_inst;
 } MonoClassGtd;
 
 typedef struct {
@@ -488,7 +494,7 @@ struct MonoVTable {
  */
 struct _MonoGenericInst {
 #ifndef MONO_SMALL_CONFIG
-       guint id;                       /* unique ID for debugging */
+       gint32 id;                      /* unique ID for debugging */
 #endif
        guint type_argc    : 22;        /* number of type arguments */
        guint is_open      :  1;        /* if this is an open type */
@@ -750,39 +756,31 @@ typedef struct {
 #define MONO_SIZEOF_REMOTE_CLASS (sizeof (MonoRemoteClass) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
 
 typedef struct {
-       guint64 new_object_count;
-       size_t initialized_class_count;
-       size_t generic_vtable_count;
-       size_t used_class_count;
-       size_t method_count;
-       size_t class_vtable_size;
-       size_t class_static_data_size;
-       size_t generic_instance_count;
-       size_t generic_class_count;
-       size_t inflated_method_count;
-       size_t inflated_method_count_2;
-       size_t inflated_type_count;
-       size_t generics_metadata_size;
-       size_t delegate_creations;
-       size_t imt_tables_size;
-       size_t imt_number_of_tables;
-       size_t imt_number_of_methods;
-       size_t imt_used_slots;
-       size_t imt_slots_with_collisions;
-       size_t imt_max_collisions_in_slot;
-       size_t imt_method_count_when_max_collisions;
-       size_t imt_trampolines_size;
-       size_t jit_info_table_insert_count;
-       size_t jit_info_table_remove_count;
-       size_t jit_info_table_lookup_count;
-       size_t generics_sharable_methods;
-       size_t generics_unsharable_methods;
-       size_t generics_shared_methods;
-       size_t gsharedvt_methods;
-       size_t minor_gc_count;
-       size_t major_gc_count;
-       size_t minor_gc_time_usecs;
-       size_t major_gc_time_usecs;
+       gint32 initialized_class_count;
+       gint32 generic_vtable_count;
+       gint32 used_class_count;
+       gint32 method_count;
+       gint32 class_vtable_size;
+       gint32 class_static_data_size;
+       gint32 generic_class_count;
+       gint32 inflated_method_count;
+       gint32 inflated_type_count;
+       gint32 delegate_creations;
+       gint32 imt_tables_size;
+       gint32 imt_number_of_tables;
+       gint32 imt_number_of_methods;
+       gint32 imt_used_slots;
+       gint32 imt_slots_with_collisions;
+       gint32 imt_max_collisions_in_slot;
+       gint32 imt_method_count_when_max_collisions;
+       gint32 imt_trampolines_size;
+       gint32 jit_info_table_insert_count;
+       gint32 jit_info_table_remove_count;
+       gint32 jit_info_table_lookup_count;
+       gint32 generics_sharable_methods;
+       gint32 generics_unsharable_methods;
+       gint32 generics_shared_methods;
+       gint32 gsharedvt_methods;
        gboolean enabled;
 } MonoStats;
 
@@ -1443,6 +1441,9 @@ mono_class_try_get_generic_container (MonoClass *klass);
 void
 mono_class_set_generic_container (MonoClass *klass, MonoGenericContainer *container);
 
+MonoType*
+mono_class_gtd_get_canonical_inst (MonoClass *klass);
+
 guint32
 mono_class_get_first_method_idx (MonoClass *klass);