2010-03-24 U-anarquia\miguel <miguel@anarquia>
authorMiguel de Icaza <miguel@gnome.org>
Wed, 24 Mar 2010 17:54:34 +0000 (17:54 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 24 Mar 2010 17:54:34 +0000 (17:54 -0000)
Make sure that trunk builds with DISABLE_JIT, an update to the
PlayStation 3 port.

* mini.c (mini_get_shared_method): this code seems to be necessary
regardless of whether DISABLE_JIT has been defined.

(mono_jit_compile_method_inner): it seems that this method is
required even in full AOT mode, so ifdef out only the pieces that
try to genrate code (the body of code that applies patches to the
code).

(mini_method_compile): do not compile when using DISABLE_JIT.

* mini-ppc.c (mono_arch_get_allocatable_int_vars)
(mono_arch_output_basic_block, mono-arch_emit_exceptions): Do not
compile when DISABLE_JIT is set. 2010-03-24  U-anarquia\miguel  <miguel@anarquia>

* reflection.c (mono_reflection_get_custom_attrs_info): Protect
code that uses System.Reflection.Emit in DISABLE_REFLECTION_EMIT.

Expose a few macros that are needed for SR but not SRE to the
world (previous inside the SRE ifdef)

svn path=/trunk/mono/; revision=154158

mono/metadata/ChangeLog
mono/metadata/reflection.c
mono/mini/ChangeLog
mono/mini/mini-ppc.c
mono/mini/mini.c

index 61ee862666ebaa5364c3bdd0461d7806b0feb23f..682cea0e92d9656a31a5e6f273d1081587538b99 100644 (file)
@@ -1,3 +1,12 @@
+2010-03-24  U-anarquia\miguel  <miguel@anarquia>
+
+       * reflection.c (mono_reflection_get_custom_attrs_info): Protect
+       code that uses System.Reflection.Emit in DISABLE_REFLECTION_EMIT.
+
+       Expose a few macros that are needed for SR but not SRE to the
+       world (previous inside the SRE ifdef)
+
+       
 2010-03-24  Mark Probst  <mark.probst@gmail.com>
 
        * sgen-gc.c (gc_register_current_thread): We need
index 3e4294db62d8b72c0d05860abfc106539101fe44..b58a4295fb80b9a542e1cb38ffa9ba850ab1a52f 100644 (file)
@@ -8717,11 +8717,13 @@ mono_reflection_get_custom_attrs_info (MonoObject *obj)
                        g_assert (method);
 
                        cinfo = mono_custom_attrs_from_param (method, param->PositionImpl + 1);
-               } else if (is_sre_method_on_tb_inst (member_class)) {/*XXX This is a workaround for Compiler Context*/
+               } 
+#ifndef DISABLE_REFLECTION_EMIT
+               else if (is_sre_method_on_tb_inst (member_class)) {/*XXX This is a workaround for Compiler Context*/
                        MonoMethod *method = mono_reflection_method_on_tb_inst_get_handle ((MonoReflectionMethodOnTypeBuilderInst*)param->MemberImpl);
                        cinfo = mono_custom_attrs_from_param (method, param->PositionImpl + 1);
                } else if (is_sre_ctor_on_tb_inst (member_class)) { /*XX This is a workaround for Compiler Context*/
-               MonoReflectionCtorOnTypeBuilderInst *c = (MonoReflectionCtorOnTypeBuilderInst*)param->MemberImpl;
+                       MonoReflectionCtorOnTypeBuilderInst *c = (MonoReflectionCtorOnTypeBuilderInst*)param->MemberImpl;
                        MonoMethod *method = NULL;
                        if (is_sre_ctor_builder (mono_object_class (c->cb)))
                                method = ((MonoReflectionCtorBuilder *)c->cb)->mhandle;
@@ -8731,7 +8733,9 @@ mono_reflection_get_custom_attrs_info (MonoObject *obj)
                                g_error ("mono_reflection_get_custom_attrs_info:: can't handle a CTBI with base_method of type %s", mono_type_get_full_name (member_class));
 
                        cinfo = mono_custom_attrs_from_param (method, param->PositionImpl + 1);
-               } else {
+               } 
+#endif
+               else {
                        char *type_name = mono_type_get_full_name (member_class);
                        char *msg = g_strdup_printf ("Custom attributes on a ParamInfo with member %s are not supported", type_name);
                        MonoException *ex = mono_get_exception_not_supported  (msg);
@@ -8850,7 +8854,6 @@ mono_reflection_type_get_underlying_system_type (MonoReflectionType* t)
         return (MonoReflectionType *) mono_runtime_invoke (usertype_method, t, NULL, NULL);
 }
 
-#ifndef DISABLE_REFLECTION_EMIT
 
 static gboolean
 is_corlib_type (MonoClass *class)
@@ -8869,6 +8872,8 @@ is_corlib_type (MonoClass *class)
        return FALSE; \
 } while (0) \
 
+
+#ifndef DISABLE_REFLECTION_EMIT
 static gboolean
 is_sre_array (MonoClass *class)
 {
@@ -8917,42 +8922,6 @@ is_sre_field_builder (MonoClass *class)
        check_corlib_type_cached (class, "System.Reflection.Emit", "FieldBuilder");
 }
 
-static gboolean
-is_sr_mono_method (MonoClass *class)
-{
-       check_corlib_type_cached (class, "System.Reflection", "MonoMethod");
-}
-
-static gboolean
-is_sr_mono_cmethod (MonoClass *class)
-{
-       check_corlib_type_cached (class, "System.Reflection", "MonoCMethod");
-}
-
-static gboolean
-is_sr_mono_generic_method (MonoClass *class)
-{
-       check_corlib_type_cached (class, "System.Reflection", "MonoGenericMethod");
-}
-
-static gboolean
-is_sr_mono_generic_cmethod (MonoClass *class)
-{
-       check_corlib_type_cached (class, "System.Reflection", "MonoGenericCMethod");
-}
-
-static gboolean
-is_sr_mono_field (MonoClass *class)
-{
-       check_corlib_type_cached (class, "System.Reflection", "MonoField");
-}
-
-static gboolean
-is_sr_mono_property (MonoClass *class)
-{
-       check_corlib_type_cached (class, "System.Reflection", "MonoProperty");
-}
-
 static gboolean
 is_sre_method_on_tb_inst (MonoClass *class)
 {
@@ -8965,12 +8934,6 @@ is_sre_ctor_on_tb_inst (MonoClass *class)
        check_corlib_type_cached (class, "System.Reflection.Emit", "ConstructorOnTypeBuilderInst");
 }
 
-gboolean
-mono_class_is_reflection_method_or_constructor (MonoClass *class)
-{
-       return is_sr_mono_method (class) || is_sr_mono_cmethod (class) || is_sr_mono_generic_method (class) || is_sr_mono_generic_cmethod (class);
-}
-
 MonoType*
 mono_reflection_type_get_handle (MonoReflectionType* ref)
 {
@@ -9190,6 +9153,49 @@ is_sre_generic_instance (MonoClass *class)
 
 #endif /* !DISABLE_REFLECTION_EMIT */
 
+
+static gboolean
+is_sr_mono_field (MonoClass *class)
+{
+       check_corlib_type_cached (class, "System.Reflection", "MonoField");
+}
+
+static gboolean
+is_sr_mono_property (MonoClass *class)
+{
+       check_corlib_type_cached (class, "System.Reflection", "MonoProperty");
+}
+
+static gboolean
+is_sr_mono_method (MonoClass *class)
+{
+       check_corlib_type_cached (class, "System.Reflection", "MonoMethod");
+}
+
+static gboolean
+is_sr_mono_cmethod (MonoClass *class)
+{
+       check_corlib_type_cached (class, "System.Reflection", "MonoCMethod");
+}
+
+static gboolean
+is_sr_mono_generic_method (MonoClass *class)
+{
+       check_corlib_type_cached (class, "System.Reflection", "MonoGenericMethod");
+}
+
+static gboolean
+is_sr_mono_generic_cmethod (MonoClass *class)
+{
+       check_corlib_type_cached (class, "System.Reflection", "MonoGenericCMethod");
+}
+
+gboolean
+mono_class_is_reflection_method_or_constructor (MonoClass *class)
+{
+       return is_sr_mono_method (class) || is_sr_mono_cmethod (class) || is_sr_mono_generic_method (class) || is_sr_mono_generic_cmethod (class);
+}
+
 static gboolean
 is_usertype (MonoReflectionType *ref)
 {
index 85fa4dca9cba3156920ad1a9c989fe561a6d732c..e1cd56623ffc2503f1c2c3311a3800dcd356e45c 100755 (executable)
@@ -1,3 +1,22 @@
+2010-03-24  U-anarquia\miguel  <miguel@anarquia>
+
+       Make sure that trunk builds with DISABLE_JIT, an update to the
+       PlayStation 3 port.
+       
+       * mini.c (mini_get_shared_method): this code seems to be necessary
+       regardless of whether DISABLE_JIT has been defined.
+
+       (mono_jit_compile_method_inner): it seems that this method is
+       required even in full AOT mode, so ifdef out only the pieces that
+       try to genrate code (the body of code that applies patches to the
+       code).  
+
+       (mini_method_compile): do not compile when using DISABLE_JIT.
+
+       * mini-ppc.c (mono_arch_get_allocatable_int_vars)
+       (mono_arch_output_basic_block, mono-arch_emit_exceptions): Do not
+       compile when DISABLE_JIT is set.
+
 2010-03-24  Mark Probst  <mark.probst@gmail.com>
 
        * mini.c (mono_create_tls_get): Only create a TLS operation if the
 
 2010-03-23  Neale Ferguson <neale@sinenomine.net>
 
-       * exceptions-s390x.c: Add support for mono_arch_get_throw_corlib_exception and fix throw by
-       name.
+       * exceptions-s390x.c: Add support for
+       mono_arch_get_throw_corlib_exception and fix throw by name.
 
-       * mini-s390x.c: Add IMT support; Fix stack parameter passing logic (especially for varargs);
-       Correct localloc sizing; Add mono_arch_get_this_arg_from_call and
+       * mini-s390x.c: Add IMT support; Fix stack parameter passing
+       logic (especially for varargs); Correct localloc sizing; Add
+       mono_arch_get_this_arg_from_call and
        mono_arch_get_this_arg_from_call.
 
-       * mini-s390x.h: Add support for facility list extraction; Correct/update MONO_ARCH_xxx settings.
+       * mini-s390x.h: Add support for facility list extraction;
+       Correct/update MONO_ARCH_xxx settings.
+
+       * mini-s390.c: Minor corrections to instruction output for
+       varargs. No IMT implementation - I think it's time to deprecate
+       s390 and just leave s390x.
 
-       * mini-s390.c: Minor corrections to instruction output for varargs. No IMT implementation - I 
-       think it's time to deprecate s390 and just leave s390x.
+       * tramp-s390x.c: Correct creation of trampoline instruction
 
-       * tramp-s390x.c: Correct creation of trampoline instruction emission.
 
        * cpu-s390x.md: Update some instruction lengths
 
index a0c070db85e58454922b720b51e6ba79c7aa5570..6c962bab95f38d31e8e65deb1a67816919d2108a 100755 (executable)
@@ -752,6 +752,7 @@ is_regsize_var (MonoType *t) {
        return FALSE;
 }
 
+#ifndef DISABLE_JIT
 GList *
 mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
 {
@@ -779,6 +780,7 @@ mono_arch_get_allocatable_int_vars (MonoCompile *cfg)
 
        return vars;
 }
+#endif /* ifndef DISABLE_JIT */
 
 GList *
 mono_arch_get_global_int_regs (MonoCompile *cfg)
@@ -3238,6 +3240,7 @@ emit_unreserve_param_area (MonoCompile *cfg, guint8 *code)
 
 #define MASK_SHIFT_IMM(i)      ((i) & MONO_PPC_32_64_CASE (0x1f, 0x3f))
 
+#ifndef DISABLE_JIT
 void
 mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 {
@@ -4654,6 +4657,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 
        cfg->code_len = code - cfg->native_code;
 }
+#endif /* !DISABLE_JIT */
 
 void
 mono_arch_register_lowlevel_calls (void)
@@ -4679,6 +4683,7 @@ mono_arch_register_lowlevel_calls (void)
        } while (0)
 #endif
 
+#ifndef DISABLE_JIT
 void
 mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
 {
@@ -5414,6 +5419,7 @@ mono_arch_emit_epilog (MonoCompile *cfg)
        g_assert (cfg->code_len < cfg->code_size);
 
 }
+#endif /* ifndef DISABLE_JIT */
 
 /* remove once throw_exception_by_name is eliminated */
 static int
@@ -5437,6 +5443,7 @@ exception_id_by_name (const char *name)
        return 0;
 }
 
+#ifndef DISABLE_JIT
 void
 mono_arch_emit_exceptions (MonoCompile *cfg)
 {
@@ -5562,6 +5569,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
 
        g_assert (cfg->code_len <= cfg->code_size);
 }
+#endif
 
 #if DEAD_CODE
 static int
index bde06c44788c758980c8f59c68b84676656c6502..d741005704766fc766a6fe4b2222a747100028e1 100644 (file)
@@ -3607,6 +3607,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile)
 
        return jinfo;
 }
+#endif
 
 /*
  * mini_get_shared_method:
@@ -3679,6 +3680,7 @@ mini_get_shared_method (MonoMethod *method)
        return res;
 }
 
+#ifndef DISABLE_JIT
 /*
  * mini_method_compile:
  * @method: the method to compile
@@ -4797,6 +4799,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
 
        mono_destroy_compile (cfg);
 
+#ifndef DISABLE_JIT
        if (domain_jit_info (target_domain)->jump_target_hash) {
                MonoJumpInfo patch_info;
                GSList *list, *tmp;
@@ -4814,6 +4817,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
        }
 
        mono_emit_jit_map (jinfo);
+#endif
        mono_domain_unlock (target_domain);
        mono_loader_unlock ();