} MonoJitExceptionInfo;
/*
- * Will contain information on the generic type arguments in the
- * future. For now, all arguments are always reference types.
+ * Contains information about the type arguments for generic shared methods.
*/
typedef struct {
- int dummy;
+ /*
+ * If not NULL, determines whenever the class type arguments of the gshared method are references or vtypes.
+ * The array length is equal to class_inst->type_argv.
+ */
+ gboolean *var_is_vt;
+ /* Same for method type parameters */
+ gboolean *mvar_is_vt;
} MonoGenericSharingContext;
/* Simplified DWARF location list entry */
if (jinfo->has_generic_jit_info) {
MonoGenericJitInfo *gi = mono_jit_info_get_generic_jit_info (jinfo);
+ MonoGenericSharingContext* gsctx = gi->generic_sharing_context;
guint8 *p1;
p1 = p;
* when using generic sharing.
*/
encode_method_ref (acfg, jinfo->method, p, &p);
+
+ if (gsctx && (gsctx->var_is_vt || gsctx->mvar_is_vt)) {
+ MonoMethodInflated *inflated;
+ MonoGenericContext *context;
+ MonoGenericInst *inst;
+
+ g_assert (jinfo->method->is_inflated);
+ inflated = (MonoMethodInflated*)jinfo->method;
+ context = &inflated->context;
+
+ encode_value (1, p, &p);
+ if (context->class_inst) {
+ inst = context->class_inst;
+
+ encode_value (inst->type_argc, p, &p);
+ for (i = 0; i < inst->type_argc; ++i)
+ encode_value (gsctx->var_is_vt [i], p, &p);
+ } else {
+ encode_value (0, p, &p);
+ }
+ if (context->method_inst) {
+ inst = context->method_inst;
+
+ encode_value (inst->type_argc, p, &p);
+ for (i = 0; i < inst->type_argc; ++i)
+ encode_value (gsctx->mvar_is_vt [i], p, &p);
+ } else {
+ encode_value (0, p, &p);
+ }
+ } else {
+ encode_value (0, p, &p);
+ }
}
if (jinfo->has_try_block_holes) {
}
}
- /* This currently contains no data */
- gi->generic_sharing_context = g_new0 (MonoGenericSharingContext, 1);
-
jinfo->method = decode_resolve_method_ref (amodule, p, &p);
+
+ gi->generic_sharing_context = g_new0 (MonoGenericSharingContext, 1);
+ if (decode_value (p, &p)) {
+ /* gsharedvt */
+ int i, n;
+ MonoGenericSharingContext *gsctx = gi->generic_sharing_context;
+
+ n = decode_value (p, &p);
+ if (n) {
+ gsctx->var_is_vt = g_new0 (gboolean, n);
+ for (i = 0; i < n; ++i)
+ gsctx->var_is_vt [i] = decode_value (p, &p);
+ }
+ n = decode_value (p, &p);
+ if (n) {
+ gsctx->mvar_is_vt = g_new0 (gboolean, n);
+ for (i = 0; i < n; ++i)
+ gsctx->mvar_is_vt [i] = decode_value (p, &p);
+ }
+ }
}
if (has_try_block_holes) {