diff options
author | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2019-04-11 15:36:21 +0300 |
---|---|---|
committer | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2019-04-11 15:36:21 +0300 |
commit | 71f882382b9114f8d990fb8f9c421027e105e911 (patch) | |
tree | fa7c0ba90dcbb95961004ba077a9586ada64781d | |
parent | b1921c263550cc0cafe8861f6c7e9d7961f0fc35 (diff) | |
parent | 5ac37ccd38582334a6e12210f86b1c3597d5abb2 (diff) |
Merge remote-tracking branch 'origin/2018-08-rc' into 2018-08-watchos2018-08-watchos
-rw-r--r-- | mcs/class/System/Assembly/AssemblyInfo.cs | 4 | ||||
-rw-r--r-- | mono/mini/debugger-agent.c | 12 | ||||
-rw-r--r-- | mono/mini/generics.cs | 14 | ||||
-rw-r--r-- | mono/mini/mini-llvm.c | 18 | ||||
-rw-r--r-- | mono/mini/mini.h | 2 |
5 files changed, 38 insertions, 12 deletions
diff --git a/mcs/class/System/Assembly/AssemblyInfo.cs b/mcs/class/System/Assembly/AssemblyInfo.cs index 8a5b95edf41..344249fc809 100644 --- a/mcs/class/System/Assembly/AssemblyInfo.cs +++ b/mcs/class/System/Assembly/AssemblyInfo.cs @@ -82,3 +82,7 @@ using System.Runtime.InteropServices; #if XAMMAC || XAMMAC_4_5 [assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] #endif + +#if MONODROID +[assembly: InternalsVisibleTo ("Mono.Android, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")] +#endif diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index ab6ba342095..6a7f5ef3a6a 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -3977,13 +3977,17 @@ thread_end (MonoProfiler *prof, uintptr_t tid) /* We might be called for threads started before we registered the start callback */ if (thread) { - DEBUG_PRINTF (1, "[%p] Thread terminated, obj=%p, tls=%p.\n", (gpointer)tid, thread, tls); + DEBUG_PRINTF (1, "[%p] Thread terminated, obj=%p, tls=%p (domain=%p).\n", (gpointer)tid, thread, tls, (gpointer)mono_domain_get ()); - if (mono_thread_internal_is_current (thread) && !mono_native_tls_get_value (debugger_tls_id) + if (mono_thread_internal_is_current (thread) && + (!mono_native_tls_get_value (debugger_tls_id) || + !mono_domain_get ()) ) { /* - * This can happen on darwin since we deregister threads using pthread dtors. - * process_profiler_event () and the code it calls cannot handle a null TLS value. + * This can happen on darwin and android since we + * deregister threads using pthread dtors. + * process_profiler_event () and the code it calls + * cannot handle a null TLS value. */ return; } diff --git a/mono/mini/generics.cs b/mono/mini/generics.cs index 6cb61e16e1a..857ad44f3e0 100644 --- a/mono/mini/generics.cs +++ b/mono/mini/generics.cs @@ -1448,6 +1448,20 @@ class Tests var res = builder.Caller (ref awaiter); return res == typeof (bool) ? 0 : 1; } + + struct OneThing<T1> { + public T1 Item1; + } + + [MethodImpl (MethodImplOptions.NoInlining)] + static T FromResult<T> (T result) { + return result; + } + + public static int test_42_llvm_gsharedvt_small_vtype_in_regs () { + var t = FromResult<OneThing<int>>(new OneThing<int> {Item1 = 42}); + return t.Item1; + } } #if !__MOBILE__ diff --git a/mono/mini/mini-llvm.c b/mono/mini/mini-llvm.c index 589a92de939..c5e82be6b29 100644 --- a/mono/mini/mini-llvm.c +++ b/mono/mini/mini-llvm.c @@ -2236,12 +2236,14 @@ static void emit_args_to_vtype (EmitContext *ctx, LLVMBuilderRef builder, MonoType *t, LLVMValueRef address, LLVMArgInfo *ainfo, LLVMValueRef *args) { int j, size, nslots; + MonoClass *klass; - size = mono_class_value_size (mono_class_from_mono_type (t), NULL); + t = mini_get_underlying_type (t); + klass = mono_class_from_mono_type (t); + size = mono_class_value_size (klass, NULL); - if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (t))) { + if (MONO_CLASS_IS_SIMD (ctx->cfg, klass)) address = LLVMBuildBitCast (ctx->builder, address, LLVMPointerType (LLVMInt8Type (), 0), ""); - } if (ainfo->storage == LLVMArgAsFpArgs) nslots = ainfo->nslots; @@ -2262,8 +2264,8 @@ emit_args_to_vtype (EmitContext *ctx, LLVMBuilderRef builder, MonoType *t, LLVMV switch (ainfo->pair_storage [j]) { case LLVMArgInIReg: { part_type = LLVMIntType (part_size * 8); - if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (t))) { - index [0] = LLVMConstInt (LLVMInt32Type (), j * sizeof (gpointer), FALSE); + if (MONO_CLASS_IS_SIMD (ctx->cfg, klass)) { + index [0] = LLVMConstInt (LLVMInt32Type (), j * TARGET_SIZEOF_VOID_P, FALSE); addr = LLVMBuildGEP (builder, address, index, 1, ""); } else { daddr = LLVMBuildBitCast (ctx->builder, address, LLVMPointerType (IntPtrType (), 0), ""); @@ -2310,6 +2312,7 @@ emit_vtype_to_args (EmitContext *ctx, LLVMBuilderRef builder, MonoType *t, LLVMV int j, size, nslots; LLVMTypeRef arg_type; + t = mini_get_underlying_type (t); size = get_vtype_size (t); if (MONO_CLASS_IS_SIMD (ctx->cfg, mono_class_from_mono_type (t))) @@ -3021,11 +3024,12 @@ emit_entry_bb (EmitContext *ctx, LLVMBuilderRef builder) case LLVMArgAsIArgs: { LLVMValueRef arg = LLVMGetParam (ctx->lmethod, pindex); int size; + MonoType *t = mini_get_underlying_type (ainfo->type); /* The argument is received as an array of ints, store it into the real argument */ - ctx->addresses [reg] = build_alloca (ctx, ainfo->type); + ctx->addresses [reg] = build_alloca (ctx, t); - size = mono_class_value_size (mono_class_from_mono_type (ainfo->type), NULL); + size = mono_class_value_size (mono_class_from_mono_type (t), NULL); if (size == 0) { } else if (size < TARGET_SIZEOF_VOID_P) { /* The upper bits of the registers might not be valid */ diff --git a/mono/mini/mini.h b/mono/mini/mini.h index 04d65af35de..46637a6b772 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -624,7 +624,7 @@ typedef struct { LLVMArgStorage storage; /* - * Only if storage == ArgValuetypeInReg/LLVMArgAsFpArgs. + * Only if storage == ArgVtypeInReg/LLVMArgAsFpArgs. * This contains how the parts of the vtype are passed. */ LLVMArgStorage pair_storage [8]; |