[llvmonly] Add gsharedvt out wrappers for icalls, the icall wrappers have a different...
authorZoltan Varga <vargaz@gmail.com>
Wed, 26 Oct 2016 20:36:25 +0000 (16:36 -0400)
committerZoltan Varga <vargaz@gmail.com>
Wed, 26 Oct 2016 20:38:36 +0000 (16:38 -0400)
mono/mini/aot-compiler.c

index 10d8563de72eab2de768386203ea7dddeb261e56..57835f473e99bd8bc58fd389046140d2bad1e775 100644 (file)
@@ -326,6 +326,9 @@ get_unwind_info_offset (MonoAotCompile *acfg, guint8 *encoded, guint32 encoded_l
 static char*
 get_plt_entry_debug_sym (MonoAotCompile *acfg, MonoJumpInfo *ji, GHashTable *cache);
 
+static void
+add_gsharedvt_wrappers (MonoAotCompile *acfg, MonoMethodSignature *sig, gboolean gsharedvt_in, gboolean gsharedvt_out);
+
 static void
 aot_printf (MonoAotCompile *acfg, const gchar *format, ...)
 {
@@ -4133,6 +4136,13 @@ add_wrappers (MonoAotCompile *acfg)
                        (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
                        add_method (acfg, mono_marshal_get_native_wrapper (method, TRUE, TRUE));
                }
+
+               if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
+                       if (acfg->aot_opts.llvm_only) {
+                               /* The wrappers have a different signature (hasthis is not set) so need to add this too */
+                               add_gsharedvt_wrappers (acfg, mono_method_signature (method), FALSE, TRUE);
+                       }
+               }
        }
  
        /* native-to-managed wrappers */