[metadata] s/HAVE_ONLINE_VES/ENABLE_ILGEN/g
authorBernhard Urban <bernhard.urban@xamarin.com>
Fri, 9 Jun 2017 11:10:36 +0000 (13:10 +0200)
committerBernhard Urban <bernhard.urban@xamarin.com>
Wed, 14 Jun 2017 13:03:21 +0000 (15:03 +0200)
mono/metadata/marshal.c
mono/metadata/metadata-internals.h
mono/metadata/method-builder.c
mono/metadata/method-builder.h
mono/metadata/sgen-mono.c

index 968c34ec79c99490429e0578873a53f7892411bb..29d03b8d7ac91338b11248723bbc155f3214c27d 100644 (file)
@@ -1252,7 +1252,7 @@ mono_string_new_len_wrapper (const char *text, guint length)
        return result;
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 /*
  * mono_mb_emit_exception_marshal_directive:
@@ -1272,7 +1272,7 @@ mono_mb_emit_exception_marshal_directive (MonoMethodBuilder *mb, char *msg)
        }
        mono_mb_emit_exception_full (mb, "System.Runtime.InteropServices", "MarshalDirectiveException", s);
 }
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
 guint
 mono_type_to_ldind (MonoType *type)
@@ -1386,7 +1386,7 @@ handle_enum:
        return -1;
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 static void
 emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv conv, MonoMarshalSpec *mspec)
@@ -2463,7 +2463,7 @@ mono_marshal_emit_thread_force_interrupt_checkpoint (MonoMethodBuilder *mb)
        emit_thread_force_interrupt_checkpoint (mb);
 }
 
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
 /* This is a JIT icall, it sets the pending exception and returns NULL on error. */
 static MonoAsyncResult *
@@ -2532,7 +2532,7 @@ mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params)
        return result;
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 int
 mono_mb_emit_save_args (MonoMethodBuilder *mb, MonoMethodSignature *sig, gboolean save_this)
@@ -2576,7 +2576,7 @@ mono_mb_emit_save_args (MonoMethodBuilder *mb, MonoMethodSignature *sig, gboolea
        return params_var;
 }
 
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
 static char*
 mono_signature_to_name (MonoMethodSignature *sig, const char *prefix)
@@ -3201,7 +3201,7 @@ mono_marshal_get_delegate_begin_invoke (MonoMethod *method)
                mb = mono_mb_new (get_wrapper_target_class (method->klass->image), name, MONO_WRAPPER_DELEGATE_BEGIN_INVOKE);
        g_free (name);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        params_var = mono_mb_emit_save_args (mb, sig, FALSE);
 
        mono_mb_emit_ldarg (mb, 0);
@@ -3324,7 +3324,7 @@ mono_delegate_end_invoke (MonoDelegate *delegate, gpointer *params)
        return res;
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 void
 mono_mb_emit_restore_result (MonoMethodBuilder *mb, MonoType *return_type)
@@ -3387,7 +3387,7 @@ mono_mb_emit_restore_result (MonoMethodBuilder *mb, MonoType *return_type)
        mono_mb_emit_byte (mb, CEE_RET);
 }
 
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
 /**
  * mono_marshal_get_delegate_end_invoke:
@@ -3443,7 +3443,7 @@ mono_marshal_get_delegate_end_invoke (MonoMethod *method)
                mb = mono_mb_new (get_wrapper_target_class (method->klass->image), name, MONO_WRAPPER_DELEGATE_END_INVOKE);
        g_free (name);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        params_var = mono_mb_emit_save_args (mb, sig, FALSE);
 
        mono_mb_emit_ldarg (mb, 0);
@@ -3645,7 +3645,7 @@ mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt
                mb = mono_mb_new (get_wrapper_target_class (method->klass->image), name, MONO_WRAPPER_DELEGATE_INVOKE);
        g_free (name);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        void_ret = sig->ret->type == MONO_TYPE_VOID && !method->string_ctor;
 
        /* allocate local 0 (object) */
@@ -3812,7 +3812,7 @@ mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt
        mono_mb_emit_byte (mb, CEE_RET);
 
        mb->skip_visibility = 1;
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
        info = mono_wrapper_info_create (mb, subtype);
        info->d.delegate_invoke.method = method;
@@ -4007,7 +4007,7 @@ runtime_invoke_signature_equal (MonoMethodSignature *sig1, MonoMethodSignature *
                return mono_metadata_signature_equal (sig1, sig2);
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 /*
  * emit_invoke_call:
@@ -4435,7 +4435,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_)
        mb = mono_mb_new (target_klass, name,  MONO_WRAPPER_RUNTIME_INVOKE);
        g_free (name);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        param_names [0] = "this";
        param_names [1] = "params";
        param_names [2] = "exc";
@@ -4446,7 +4446,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_)
 #endif
 
        if (need_direct_wrapper) {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
                mb->skip_visibility = 1;
 #endif
                info = mono_wrapper_info_create (mb, virtual_ ? WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL : WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT);
@@ -4530,7 +4530,7 @@ mono_marshal_get_runtime_invoke_dynamic (void)
        mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_RUNTIME_INVOKE);
        g_free (name);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /* allocate local 0 (object) tmp */
        mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
        /* allocate local 1 (object) exc */
@@ -4591,7 +4591,7 @@ mono_marshal_get_runtime_invoke_dynamic (void)
        mono_mb_patch_branch (mb, pos);
        //mono_mb_emit_ldloc (mb, 0);
        mono_mb_emit_byte (mb, CEE_RET);
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
        info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_DYNAMIC);
 
@@ -4665,7 +4665,7 @@ mono_marshal_get_runtime_invoke_for_sig (MonoMethodSignature *sig)
        mb = mono_mb_new (mono_defaults.object_class, name,  MONO_WRAPPER_RUNTIME_INVOKE);
        g_free (name);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        param_names [0] = "this";
        param_names [1] = "params";
        param_names [2] = "exc";
@@ -4706,7 +4706,7 @@ mono_marshal_get_runtime_invoke_for_sig (MonoMethodSignature *sig)
        return res;
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 static void
 mono_mb_emit_auto_layout_exception (MonoMethodBuilder *mb, MonoClass *klass)
 {
@@ -4747,7 +4747,7 @@ mono_marshal_get_icall_wrapper (MonoMethodSignature *sig, const char *name, gcon
        else
                csig2 = mono_metadata_signature_dup_full (mono_defaults.corlib, sig);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        if (sig->hasthis)
                mono_mb_emit_byte (mb, CEE_LDARG_0);
 
@@ -4781,7 +4781,7 @@ emit_marshal_custom (EmitMarshalContext *m, int argnum, MonoType *t,
                                         int conv_arg, MonoType **conv_arg_type, 
                                         MarshalAction action)
 {
-#ifndef HAVE_ONLINE_VES
+#ifndef ENABLE_ILGEN
        if (action == MARSHAL_ACTION_CONV_IN && t->type == MONO_TYPE_VALUETYPE)
                *conv_arg_type = &mono_defaults.int_class->byval_arg;
        return conv_arg;
@@ -5097,7 +5097,7 @@ emit_marshal_asany (EmitMarshalContext *m, int argnum, MonoType *t,
                                        int conv_arg, MonoType **conv_arg_type, 
                                        MarshalAction action)
 {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        MonoMethodBuilder *mb = m->mb;
 
        switch (action) {
@@ -5144,7 +5144,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
                                        int conv_arg, MonoType **conv_arg_type, 
                                        MarshalAction action)
 {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        MonoMethodBuilder *mb = m->mb;
        MonoClass *klass, *date_time_class;
        int pos = 0, pos2;
@@ -5421,7 +5421,7 @@ emit_marshal_string (EmitMarshalContext *m, int argnum, MonoType *t,
                                         int conv_arg, MonoType **conv_arg_type, 
                                         MarshalAction action)
 {
-#ifndef HAVE_ONLINE_VES
+#ifndef ENABLE_ILGEN
        switch (action) {
        case MARSHAL_ACTION_CONV_IN:
                *conv_arg_type = &mono_defaults.int_class->byval_arg;
@@ -5600,7 +5600,7 @@ emit_marshal_safehandle (EmitMarshalContext *m, int argnum, MonoType *t,
                         MonoMarshalSpec *spec, int conv_arg, 
                         MonoType **conv_arg_type, MarshalAction action)
 {
-#ifndef HAVE_ONLINE_VES
+#ifndef ENABLE_ILGEN
        if (action == MARSHAL_ACTION_CONV_IN)
                *conv_arg_type = &mono_defaults.int_class->byval_arg;
 #else
@@ -5764,7 +5764,7 @@ emit_marshal_handleref (EmitMarshalContext *m, int argnum, MonoType *t,
                        MonoMarshalSpec *spec, int conv_arg, 
                        MonoType **conv_arg_type, MarshalAction action)
 {
-#ifndef HAVE_ONLINE_VES
+#ifndef ENABLE_ILGEN
        if (action == MARSHAL_ACTION_CONV_IN)
                *conv_arg_type = &mono_defaults.int_class->byval_arg;
 #else
@@ -5831,7 +5831,7 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
                     int conv_arg, MonoType **conv_arg_type, 
                     MarshalAction action)
 {
-#ifndef HAVE_ONLINE_VES
+#ifndef ENABLE_ILGEN
        if (action == MARSHAL_ACTION_CONV_IN)
                *conv_arg_type = &mono_defaults.int_class->byval_arg;
 #else
@@ -6333,7 +6333,7 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
        return conv_arg;
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 #ifndef DISABLE_COM
 
 static int
@@ -6450,7 +6450,7 @@ emit_marshal_variant (EmitMarshalContext *m, int argnum, MonoType *t,
 }
 
 #endif /* DISABLE_COM */
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
 static gboolean
 mono_pinvoke_is_unicode (MonoMethodPInvoke *piinfo)
@@ -6477,7 +6477,7 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
                                        int conv_arg, MonoType **conv_arg_type, 
                                        MarshalAction action)
 {
-#ifndef HAVE_ONLINE_VES
+#ifndef ENABLE_ILGEN
        switch (action) {
        case MARSHAL_ACTION_CONV_IN:
                *conv_arg_type = &mono_defaults.object_class->byval_arg;
@@ -7246,7 +7246,7 @@ emit_marshal_boolean (EmitMarshalContext *m, int argnum, MonoType *t,
                      int conv_arg, MonoType **conv_arg_type, 
                      MarshalAction action)
 {
-#ifndef HAVE_ONLINE_VES
+#ifndef ENABLE_ILGEN
        switch (action) {
        case MARSHAL_ACTION_CONV_IN:
                if (t->byref)
@@ -7415,7 +7415,7 @@ emit_marshal_ptr (EmitMarshalContext *m, int argnum, MonoType *t,
                  MonoMarshalSpec *spec, int conv_arg, 
                  MonoType **conv_arg_type, MarshalAction action)
 {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        MonoMethodBuilder *mb = m->mb;
 
        switch (action) {
@@ -7450,7 +7450,7 @@ emit_marshal_char (EmitMarshalContext *m, int argnum, MonoType *t,
                   MonoMarshalSpec *spec, int conv_arg, 
                   MonoType **conv_arg_type, MarshalAction action)
 {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        MonoMethodBuilder *mb = m->mb;
 
        switch (action) {
@@ -7478,7 +7478,7 @@ emit_marshal_scalar (EmitMarshalContext *m, int argnum, MonoType *t,
                     MonoMarshalSpec *spec, int conv_arg, 
                     MonoType **conv_arg_type, MarshalAction action)
 {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        MonoMethodBuilder *mb = m->mb;
 
        switch (action) {
@@ -7522,7 +7522,7 @@ emit_marshal (EmitMarshalContext *m, int argnum, MonoType *t,
                return emit_marshal_string (m, argnum, t, spec, conv_arg, conv_arg_type, action);
        case MONO_TYPE_CLASS:
        case MONO_TYPE_OBJECT:
-#if !defined(DISABLE_COM) && defined(HAVE_ONLINE_VES)
+#if !defined(DISABLE_COM) && defined(ENABLE_ILGEN)
                if (spec && spec->native == MONO_NATIVE_STRUCT)
                        return emit_marshal_variant (m, argnum, t, spec, conv_arg, conv_arg_type, action);
 #endif
@@ -7622,7 +7622,7 @@ signature_param_uses_handles (MonoMethodSignature *sig, int param)
 }
 
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 /**
  * mono_marshal_emit_native_wrapper:
  * \param image the image to use for looking up custom marshallers
@@ -7906,7 +7906,7 @@ mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoM
 
        mono_mb_emit_byte (mb, CEE_RET);
 }
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
 /**
  * mono_marshal_get_native_wrapper:
@@ -8005,7 +8005,7 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
                                /* create a wrapper to preserve .ctor in stack trace */
                                mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_MANAGED_TO_MANAGED);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
                                mono_mb_emit_byte (mb, CEE_LDARG_0);
                                for (i = 1; i <= csig->param_count; i++)
                                        mono_mb_emit_ldarg (mb, i);
@@ -8039,7 +8039,7 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
         * registered in the runtime doing the AOT compilation.
         */
        if (!piinfo->addr && !aot) {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
                mono_mb_emit_exception (mb, exc_class, exc_arg);
 #endif
                info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
@@ -8067,7 +8067,7 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
                if (method->string_ctor)
                        csig->ret = &mono_defaults.string_class->byval_arg;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
                // FIXME:
                MonoClass *handle_stack_mark_class;
                MonoClass *error_class;
@@ -8300,7 +8300,7 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
        if (!aot)
                g_assert (piinfo->addr);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mspecs = g_new (MonoMarshalSpec*, sig->param_count + 1);
        mono_method_get_marshal_info (method, mspecs);
 
@@ -8315,7 +8315,7 @@ mono_marshal_get_native_wrapper (MonoMethod *method, gboolean check_exceptions,
                                                                                 info, NULL);
        mono_mb_free (mb);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        for (i = sig->param_count; i >= 0; i--)
                if (mspecs [i])
                        mono_metadata_free_marshal_spec (mspecs [i]);
@@ -8363,7 +8363,7 @@ mono_marshal_get_native_func_wrapper (MonoImage *image, MonoMethodSignature *sig
        mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_MANAGED_TO_NATIVE);
        mb->method->save_lmf = 1;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, func, FALSE, TRUE, FALSE);
 #endif
 
@@ -8428,7 +8428,7 @@ mono_marshal_get_native_func_wrapper_aot (MonoClass *klass)
        mb = mono_mb_new (invoke->klass, name, MONO_WRAPPER_MANAGED_TO_NATIVE);
        mb->method->save_lmf = 1;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mono_marshal_emit_native_wrapper (image, mb, sig, piinfo, mspecs, NULL, FALSE, TRUE, TRUE);
 #endif
 
@@ -8463,7 +8463,7 @@ mono_marshal_get_native_func_wrapper_aot (MonoClass *klass)
 void
 mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, uint32_t target_handle)
 {
-#ifndef HAVE_ONLINE_VES
+#ifndef ENABLE_ILGEN
        MonoMethodSignature *sig, *csig;
        int i;
 
@@ -8995,7 +8995,7 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
                                                                                         mb, csig, sig->param_count + 16,
                                                                                         info, NULL);
        } else {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
                mb->dynamic = TRUE;
 #endif
                res = mono_mb_create (mb, csig, sig->param_count + 16, NULL);
@@ -9058,7 +9058,7 @@ mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type)
 
                mono_marshal_emit_managed_wrapper (mb, sig, mspecs, &m, method, 0);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
                mb->dynamic = TRUE;
 #endif
                method = mono_mb_create (mb, csig, sig->param_count + 16, NULL);
@@ -9078,7 +9078,7 @@ mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type)
        mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_MANAGED_TO_MANAGED);
 
        param_count = sig->param_count + sig->hasthis;
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        for (i = 0; i < param_count; i++)
                mono_mb_emit_ldarg (mb, i);
 
@@ -9099,7 +9099,7 @@ mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type)
        return compiled_ptr;
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 /*
  * The code directly following this is the cache hit, value positive branch
@@ -9162,7 +9162,7 @@ generate_check_cache (int obj_arg_position, int class_arg_position, int cache_ar
        mono_mb_emit_icall (mb, mono_marshal_isinst_with_cache);
 }
 
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
 /**
  * mono_marshal_get_castclass_with_cache:
@@ -9193,7 +9193,7 @@ mono_marshal_get_castclass_with_cache (void)
        sig->ret = &mono_defaults.object_class->byval_arg;
        sig->pinvoke = 0;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        generate_check_cache (obj_arg_position, class_arg_position, cache_arg_position, 
                                                                                                &return_null_pos, &negative_cache_hit_pos, &positive_cache_hit_pos, mb);
        invalid_cast_pos = mono_mb_emit_branch (mb, CEE_BRFALSE);
@@ -9212,7 +9212,7 @@ mono_marshal_get_castclass_with_cache (void)
        mono_mb_patch_branch (mb, return_null_pos);
        mono_mb_emit_byte (mb, CEE_LDNULL);
        mono_mb_emit_byte (mb, CEE_RET);
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
        info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_CASTCLASS_WITH_CACHE);
        res = mono_mb_create (mb, sig, 8, info);
@@ -9280,7 +9280,7 @@ mono_marshal_get_isinst_with_cache (void)
        sig->ret = &mono_defaults.object_class->byval_arg;
        sig->pinvoke = 0;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        generate_check_cache (obj_arg_position, class_arg_position, cache_arg_position, 
                &return_null_pos, &negative_cache_hit_pos, &positive_cache_hit_pos, mb);
        // Return the object gotten via the slow path.
@@ -9339,7 +9339,7 @@ mono_marshal_get_struct_to_ptr (MonoClass *klass)
 
        mb = mono_mb_new (klass, stoptr->name, MONO_WRAPPER_UNKNOWN);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        if (klass->blittable) {
                mono_mb_emit_byte (mb, CEE_LDARG_1);
                mono_mb_emit_byte (mb, CEE_LDARG_0);
@@ -9421,7 +9421,7 @@ mono_marshal_get_ptr_to_struct (MonoClass *klass)
 
        mb = mono_mb_new (klass, "PtrToStructure", MONO_WRAPPER_UNKNOWN);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        if (klass->blittable) {
                mono_mb_emit_byte (mb, CEE_LDARG_1);
                mono_mb_emit_ldflda (mb, sizeof (MonoObject));
@@ -9489,7 +9489,7 @@ mono_marshal_get_synchronized_inner_wrapper (MonoMethod *method)
        }
 
        mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_UNKNOWN);
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mono_mb_emit_exception_full (mb, "System", "ExecutionEngineException", "Shouldn't be called.");
        mono_mb_emit_byte (mb, CEE_RET);
 #endif
@@ -9565,7 +9565,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
        info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
        info->d.synchronized.method = method;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mb->skip_visibility = 1;
        /* result */
        if (!MONO_TYPE_IS_VOID (sig->ret))
@@ -9575,7 +9575,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
        if (method->klass->valuetype && !(method->flags & MONO_METHOD_ATTR_STATIC)) {
                /* FIXME Is this really the best way to signal an error here?  Isn't this called much later after class setup? -AK */
                mono_class_set_type_load_failure (method->klass, "");
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
                /* This will throw the type load exception when the wrapper is compiled */
                mono_mb_emit_byte (mb, CEE_LDNULL);
                mono_mb_emit_op (mb, CEE_ISINST, method->klass);
@@ -9593,7 +9593,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
                return res;
        }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /* this */
        this_local = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
        taken_local = mono_mb_add_local (mb, &mono_defaults.boolean_class->byval_arg);
@@ -9625,7 +9625,7 @@ mono_marshal_get_synchronized_wrapper (MonoMethod *method)
 
        mono_marshal_unlock ();
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /* Push this or the type object */
        if (method->flags & METHOD_ATTRIBUTE_STATIC) {
                /* We have special handling for this in the JIT */
@@ -9724,7 +9724,7 @@ mono_marshal_get_unbox_wrapper (MonoMethod *method)
 
        g_assert (sig->hasthis);
        
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mono_mb_emit_ldarg (mb, 0); 
        mono_mb_emit_icon (mb, sizeof (MonoObject));
        mono_mb_emit_byte (mb, CEE_ADD);
@@ -9796,7 +9796,7 @@ get_virtual_stelemref_kind (MonoClass *element_class)
        return STELEMREF_CLASS;
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 static void
 load_array_element_address (MonoMethodBuilder *mb)
@@ -9880,7 +9880,7 @@ get_virtual_stelemref_wrapper (int kind)
                signature = sig;
        }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        param_names [0] = "index";
        param_names [1] = "value";
        mono_mb_set_param_names (mb, param_names);
@@ -10280,7 +10280,7 @@ get_virtual_stelemref_wrapper (int kind)
                mono_mb_emit_byte (mb, CEE_RET);
                g_assert (0);
        }
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
        info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_VIRTUAL_STELEMREF);
        info->d.virtual_stelemref.kind = kind;
        res = mono_mb_create (mb, signature, 4, info);
@@ -10353,7 +10353,7 @@ mono_marshal_get_stelemref (void)
        sig->params [1] = &mono_defaults.int_class->byval_arg; /* this is a natural sized int */
        sig->params [2] = &mono_defaults.object_class->byval_arg;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        aklass = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
        vklass = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
        array_slot_addr = mono_mb_add_local (mb, &mono_defaults.object_class->this_arg);
@@ -10493,7 +10493,7 @@ mono_marshal_get_gsharedvt_in_wrapper (void)
        sig = mono_metadata_signature_alloc (mono_defaults.corlib, 0);
        sig->ret = &mono_defaults.void_class->byval_arg;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /*
         * The body is generated by the JIT, we use a wrapper instead of a trampoline so EH works.
         */
@@ -10527,7 +10527,7 @@ mono_marshal_get_gsharedvt_out_wrapper (void)
        sig = mono_metadata_signature_alloc (mono_defaults.corlib, 0);
        sig->ret = &mono_defaults.void_class->byval_arg;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /*
         * The body is generated by the JIT, we use a wrapper instead of a trampoline so EH works.
         */
@@ -10601,7 +10601,7 @@ mono_marshal_get_array_address (int rank, int elem_size)
        mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_MANAGED_TO_MANAGED);
        g_free (name);
        
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        bounds = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
        ind = mono_mb_add_local (mb, &mono_defaults.int32_class->byval_arg);
        realidx = mono_mb_add_local (mb, &mono_defaults.int32_class->byval_arg);
@@ -10697,7 +10697,7 @@ mono_marshal_get_array_address (int rank, int elem_size)
        mono_mb_emit_exception (mb, "IndexOutOfRangeException", NULL);
 
        g_free (branch_positions);
-#endif /* HAVE_ONLINE_VES */
+#endif /* ENABLE_ILGEN */
 
        info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_ELEMENT_ADDR);
        info->d.element_addr.rank = rank;
@@ -10774,7 +10774,7 @@ mono_marshal_get_array_accessor_wrapper (MonoMethod *method)
 
        mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_UNKNOWN);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /* Call the method */
        if (sig->hasthis)
                mono_mb_emit_ldarg (mb, 0);
@@ -12069,7 +12069,7 @@ mono_marshal_get_generic_array_helper (MonoClass *klass, gchar *name, MonoMethod
        csig = mono_metadata_signature_dup_full (method->klass->image, sig);
        csig->generic_param_count = 0;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mono_mb_emit_ldarg (mb, 0);
        for (i = 0; i < csig->param_count; i++)
                mono_mb_emit_ldarg (mb, i + 1);
@@ -12206,7 +12206,7 @@ mono_marshal_get_thunk_invoke_wrapper (MonoMethod *method)
        if (MONO_TYPE_ISSTRUCT (sig->ret))
                csig->ret = &mono_defaults.object_class->byval_arg;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /* local 0 (temp for exception object) */
        mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg);
 
index 7fc936d8bd73a0cd9b725fc97bf7bc2dbbfa6cf9..895b29c926caa298a95fd22a300fadfde630c5f9 100644 (file)
@@ -53,7 +53,7 @@ struct _MonoType {
 
 #if !defined(DISABLE_JIT) || defined(ENABLE_INTERPRETER)
 /* Some VES is available at runtime */
-#define HAVE_ONLINE_VES
+#define ENABLE_ILGEN
 #endif
 
 struct _MonoAssemblyName {
index 81d16ce4b2d48aee49ea5ef811744e95cce8016b..a02312ab4723514308d97c0e0c40e7065a9dc733 100644 (file)
@@ -67,7 +67,7 @@ mono_mb_new_base (MonoClass *klass, MonoWrapperType type)
        m->inline_info = 1;
        m->wrapper_type = type;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mb->code_size = 40;
        mb->code = (unsigned char *)g_malloc (mb->code_size);
        mb->init_locals = TRUE;
@@ -104,7 +104,7 @@ mono_mb_new (MonoClass *klass, const char *name, MonoWrapperType type)
 void
 mono_mb_free (MonoMethodBuilder *mb)
 {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        GList *l;
 
        for (l = mb->locals_list; l; l = l->next) {
@@ -134,7 +134,7 @@ mono_mb_free (MonoMethodBuilder *mb)
 MonoMethod *
 mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, int max_stack)
 {
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        MonoMethodHeader *header;
 #endif
        MonoMethodWrapper *mw;
@@ -147,7 +147,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
 
        image = mb->method->klass->image;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        if (mb->dynamic) {
                method = mb->method;
                mw = (MonoMethodWrapper*)method;
@@ -177,7 +177,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
                else
                        method->name = mono_image_strdup (image, mb->name);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
                mw->header = header = (MonoMethodHeader *) 
                        mono_image_alloc0 (image, MONO_SIZEOF_METHOD_HEADER + mb->locals * sizeof (MonoType *));
 
@@ -190,7 +190,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
 #endif
        }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /* Free the locals list so mono_mb_free () doesn't free the types twice */
        g_list_free (mb->locals_list);
        mb->locals_list = NULL;
@@ -200,7 +200,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
        if (!signature->hasthis)
                method->flags |= METHOD_ATTRIBUTE_STATIC;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        if (max_stack < 8)
                max_stack = 8;
 
@@ -236,7 +236,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
                mw->method_data = data;
        }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        /*{
                static int total_code = 0;
                static int total_alloc = 0;
@@ -284,7 +284,7 @@ mono_mb_add_data (MonoMethodBuilder *mb, gpointer data)
        return g_list_length ((GList *)mw->method_data);
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 /**
  * mono_mb_add_local:
index b13416ffa2c7ad7d953b50ec0dac2b1018382f8b..26a53e1c34d46baad794158329fdc9a1b897083f 100644 (file)
@@ -25,7 +25,7 @@ typedef struct _MonoMethodBuilder {
        MonoMethod *method;
        char *name;
        gboolean no_dup_name;
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        GList *locals_list;
        int locals;
        gboolean dynamic;
@@ -53,7 +53,7 @@ mono_mb_create_method (MonoMethodBuilder *mb, MonoMethodSignature *signature, in
 guint32
 mono_mb_add_data (MonoMethodBuilder *mb, gpointer data);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 void
 mono_mb_patch_addr (MonoMethodBuilder *mb, int pos, int value);
 
index b1897453b467043ae166a9085071157320bd438c..0314150604f207eb9bd6c48a6232521398abd376 100644 (file)
@@ -245,7 +245,7 @@ mono_gc_is_critical_method (MonoMethod *method)
        return sgen_is_critical_method (method);
 }
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 
 static void
 emit_nursery_check (MonoMethodBuilder *mb, int *nursery_check_return_labels, gboolean is_concurrent)
@@ -317,7 +317,7 @@ mono_gc_get_specific_write_barrier (gboolean is_concurrent)
        else
                mb = mono_mb_new (mono_defaults.object_class, "wbarrier_noconc", MONO_WRAPPER_WRITE_BARRIER);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
 #ifdef MANAGED_WBARRIER
        emit_nursery_check (mb, nursery_check_labels, is_concurrent);
        /*
@@ -1126,7 +1126,7 @@ create_allocator (int atype, ManagedAllocatorVariant variant)
 
        mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_ALLOC);
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        if (slowpath) {
                switch (atype) {
                case ATYPE_NORMAL:
@@ -1461,7 +1461,7 @@ create_allocator (int atype, ManagedAllocatorVariant variant)
        info->d.alloc.gc_name = "sgen";
        info->d.alloc.alloc_type = atype;
 
-#ifdef HAVE_ONLINE_VES
+#ifdef ENABLE_ILGEN
        mb->init_locals = FALSE;
 #endif