* aot-compiler.c (encode_klass_info): Allow classes of the form <Type>[][].
(compile_method): Ditto.
* aot-runtime.c (decode_klass_info): Ditto.
* mini.c (mono_method_to_ir): Call mono_get_got_var () in a place where it is
needed by the code generated by inssel.brg. Also fix a warning.
svn path=/trunk/mono/; revision=71326
+2007-01-19 Zoltan Varga <vargaz@gmail.com>
+
+ * aot-compiler.c (encode_klass_info): Allow classes of the form <Type>[][].
+ (compile_method): Ditto.
+
+ * aot-runtime.c (decode_klass_info): Ditto.
+
+ * mini.c (mono_method_to_ir): Call mono_get_got_var () in a place where it is
+ needed by the code generated by inssel.brg. Also fix a warning.
Thu Jan 18 16:52:56 CET 2007 Paolo Molaro <lupus@ximian.com>
encode_klass_info (MonoAotCompile *cfg, MonoClass *klass, guint8 *buf, guint8 **endbuf)
{
if (!klass->type_token) {
+ guint32 token;
+
/* Array class */
g_assert (klass->rank > 0);
- g_assert (klass->element_class->type_token);
encode_value (MONO_TOKEN_TYPE_DEF, buf, &buf);
encode_value (get_image_index (cfg, klass->image), buf, &buf);
- g_assert (mono_metadata_token_code (klass->element_class->type_token) == MONO_TOKEN_TYPE_DEF);
- encode_value (klass->element_class->type_token - MONO_TOKEN_TYPE_DEF, buf, &buf);
+ token = klass->element_class->type_token;
+ if (!token) {
+ /* <Type>[][] */
+ g_assert (klass->element_class->rank);
+ encode_value (0, buf, &buf);
+ encode_value (klass->element_class->rank, buf, &buf);
+ token = klass->element_class->element_class->type_token;
+ }
+ g_assert (mono_metadata_token_code (token) == MONO_TOKEN_TYPE_DEF);
+ encode_value (token - MONO_TOKEN_TYPE_DEF, buf, &buf);
encode_value (klass->rank, buf, &buf);
}
else {
case MONO_PATCH_INFO_IID:
case MONO_PATCH_INFO_ADJUSTED_IID:
if (!patch_info->data.klass->type_token)
- if (!patch_info->data.klass->element_class->type_token)
+ if (!patch_info->data.klass->element_class->type_token && !(patch_info->data.klass->element_class->rank && patch_info->data.klass->element_class->element_class->type_token))
skip = TRUE;
break;
default:
} else {
token = MONO_TOKEN_TYPE_DEF + decode_value (buf, &buf);
rank = decode_value (buf, &buf);
- klass = mono_class_get (image, token);
- g_assert (klass);
- klass = mono_array_class_get (klass, rank);
+ if (token == MONO_TOKEN_TYPE_DEF) {
+ /* <Type>[][] */
+ token = MONO_TOKEN_TYPE_DEF + decode_value (buf, &buf);
+ klass = mono_class_get (image, token);
+ g_assert (klass);
+ klass = mono_array_class_get (klass, rank);
+
+ rank = decode_value (buf, &buf);
+ klass = mono_array_class_get (klass, rank);
+ } else {
+ klass = mono_class_get (image, token);
+ g_assert (klass);
+ klass = mono_array_class_get (klass, rank);
+ }
}
g_assert (klass);
mono_class_init (klass);
if (cfg->compile_aot) {
NEW_AOTCONST_TOKEN (cfg, iargs [1], MONO_PATCH_INFO_RVA, method->klass->image, GPOINTER_TO_UINT(data_ptr), STACK_PTR, NULL);
} else {
- NEW_PCONST (cfg, iargs [1], data_ptr);
+ NEW_PCONST (cfg, iargs [1], (char*)data_ptr);
}
mono_emit_method_call_spilled (cfg, bblock, memcpy_method, memcpy_method->signature, iargs, ip, NULL);
ip += 11;
*/
if (!klass->valuetype && method->wrapper_type == MONO_WRAPPER_NONE) {
MonoInst* check;
+
+ /* Needed by the code generated in inssel.brg */
+ mono_get_got_var (cfg);
+
MONO_INST_NEW (cfg, check, OP_CHECK_ARRAY_TYPE);
check->cil_code = ip;
check->klass = klass;