Browse Source

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  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
Miguel de Icaza 16 years ago
parent
commit
ade0dc79fd
5 changed files with 104 additions and 54 deletions
  1. 9 0
      mono/metadata/ChangeLog
  2. 52 46
      mono/metadata/reflection.c
  3. 31 8
      mono/mini/ChangeLog
  4. 8 0
      mono/mini/mini-ppc.c
  5. 4 0
      mono/mini/mini.c

+ 9 - 0
mono/metadata/ChangeLog

@@ -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  <[email protected]>
 
 	* sgen-gc.c (gc_register_current_thread): We need

+ 52 - 46
mono/metadata/reflection.c

@@ -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)
 {

+ 31 - 8
mono/mini/ChangeLog

@@ -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  <[email protected]>
 
 	* mini.c (mono_create_tls_get): Only create a TLS operation if the
@@ -9,19 +28,23 @@
 
 2010-03-23  Neale Ferguson <[email protected]>
 
-	* 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
 

+ 8 - 0
mono/mini/mini-ppc.c

@@ -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

+ 4 - 0
mono/mini/mini.c

@@ -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 ();