Egor Bogatov [Wed, 28 Aug 2019 16:01:34 +0000 (19:01 +0300)]
Merge remote-tracking branch 'origin/master' into ffast-math
Commit migrated from https://github.com/mono/mono/commit/
ffc3081c3b9576c922286c79f51fe3fb3cd49f50
imhameed [Wed, 28 Aug 2019 15:23:43 +0000 (08:23 -0700)]
Merge pull request mono/mono#16242 from lateralusX/lateralusX/windows-fix-local-valuetype-copy-llvm
OP_LLVM_OUTARG_VT doesn't always create temporary vt needed by some ABI's.
Commit migrated from https://github.com/mono/mono/commit/
bd3cc61301cc12d167b284316e9d99af92f2130b
Bernhard Urban [Wed, 28 Aug 2019 15:19:39 +0000 (17:19 +0200)]
[mini] do not re-AOT whole BCL for fullaotcheck targets (mono/mono#16536)
[mini] do not re-AOT whole BCL for fullaotcheck targets
And enable `llvmfullaotcheck` target on CI.
Fixes https://github.com/mono/mono/issues/15999
On my armv7/linux machine with a `--with-runtime-preset=fullaot_llvm` configured build, before this PR:
```console
$ time make -C mono/mini llvmfullaotcheck -j4
[...]
real 9m42.362s
user 23m2.000s
sys 0m18.480s
```
After:
```console
$ time make -C mono/mini llvmfullaotcheck -j4
[...]
real 3m1.984s
user 4m51.648s
sys 0m8.248s
```
Commit migrated from https://github.com/mono/mono/commit/
71f0f0ff827b03252e8967aeb6152a14cc3198ec
Alexander Köplinger [Wed, 28 Aug 2019 14:17:31 +0000 (16:17 +0200)]
[netcore] Add missing 'prepare' dependency to run-tests-corefx
Commit migrated from https://github.com/mono/mono/commit/
2152f0a16d68021fa28a997806992ad59fd0c7e7
Zoltan Varga [Wed, 28 Aug 2019 13:46:09 +0000 (09:46 -0400)]
Merge pull request mono/mono#16517 from vargaz/wasm-xunit4
[wasm] Enable xunit tests for corlib/System.Core.
Commit migrated from https://github.com/mono/mono/commit/
f562c7ef6a23e9f713a53b446e937eedc63728b6
Jay Krell [Wed, 28 Aug 2019 13:42:44 +0000 (06:42 -0700)]
Fix assert in x86_patch regarding second byte of Jcc instructions being 0x80-0x8F vs. 0x70-0x8F (6byte conditional branch with 32bit offset). (mono/mono#16471)
Commit migrated from https://github.com/mono/mono/commit/
c80a1eca636c82014f8fbb9873e5391cddffa9a9
Aleksey Kliger (λgeek) [Wed, 28 Aug 2019 12:34:30 +0000 (08:34 -0400)]
[merp] Initialize hang_watchdog_path earlier; be lax if it's missing (mono/mono#16298)
* [merp] Initialize hang_watchdog_path earlier; be lax if it's missing
Initialize hang_watchdog_path earlier - not just when
ves_icall_Mono_Runtime_EnableCrashReportingLog is called. That function is
only expected to be called by apps that explicitly want progress reports from
MERP when it's collecting a crash report. But we want the mono-hang-watchdog
to execute for all mono crashes (when crash reporting isn't ifdef'd out).
Also if we try to exec mono-hang-watchdog and fail for some reason, print a
nice message and then exit. We used to call g_assert_not_reached which would
kick off another MERP of the _forked child process_ which would then get
confused because it really can't run in the forked process at all.
Commit migrated from https://github.com/mono/mono/commit/
fc21168065af270d1e500fa6be618f8563d0c525
Jay Krell [Wed, 28 Aug 2019 10:51:23 +0000 (03:51 -0700)]
[interp] Outline box. (mono/mono#16456)
With additional reasonable changes this should conserve stack.
A combined PR that demonstrates actual savings probably should/will be presented.
Commit migrated from https://github.com/mono/mono/commit/
2ca04a9743ceab99714377180ba3b2b6d589ba7f
Jay Krell [Wed, 28 Aug 2019 10:11:56 +0000 (03:11 -0700)]
[interp] Minor cleanup of `stackval_from_data`. Compiler can do it. (mono/mono#16534)
I missed this earlier cleaning stackval_to_data.
Commit migrated from https://github.com/mono/mono/commit/
56b83f489b42e076bd7259cf42b4c684e63c7785
Jay Krell [Wed, 28 Aug 2019 10:10:30 +0000 (03:10 -0700)]
[interp] Asserts pessimize clang. Removing saves 16 bytes on Linux/amd64/clang. (mono/mono#16530)
Paired with https://github.com/mono/mono/pull/16456, saves 16 bytes on Linux/amd64/clang.
No change with gcc.
Contributes to https://github.com/mono/mono/issues/16172.
Commit migrated from https://github.com/mono/mono/commit/
c870df0aa7a8111743bab8bbe6b9f3f6fa8ed870
Jay Krell [Wed, 28 Aug 2019 08:56:08 +0000 (01:56 -0700)]
Remove dead Boehm code. (mono/mono#15224)
* Remove dead Boehm code.
Unity looked similarly dead.
The key points making it dead were:
create_allocator:
g_assert_not_reached() covering everything but local variables
mono_gc_get_managed_allocator:
always returning NULL, killing a bunch of code
after it
mono_gc_is_critical_method:
looking at data that was never filled in
This should have no impact, not even on Boehm.
Boehm should continue working just the same.
It is nice because it is the few/only uses of CEE_MONO_TLS.
Commit migrated from https://github.com/mono/mono/commit/
c534511003bdd84ef08dd8a7cf725d4d0f063f5e
Jay Krell [Wed, 28 Aug 2019 08:54:00 +0000 (01:54 -0700)]
[mini] Cleanup MONO_MMAP_32BIT. (mono/mono#16469)
- It _presumably_ means nothing on 32bit ARM and 32bit MIPS (was there mono/mips64?).
- Leaving only PowerPC32 and PowerPC64 (in this vicinity).
- It presumably means nothing on PowerPC32.
- Leaving PowerPC64 as the only user in this vicinity -- is it needed?
- Notice this is varyingly absent on x86, arm64, amd64, s390x.
Subject of another PR maybe.
Perhaps this was to enable the debugger to be 32bit against a 64bit target
on a biarch system, so it could do a cross-process manipulation of these pages?
That makes some sense on Windows at least.
(32bit debugger cannot debug 64bit target as of Vista, but that is using the Win32
"hard" debugger API. Mono could do otherwise).
There remains amd64 mono-codeman.c define ARCH_MAP_FLAGS MONO_MMAP_32BIT left alone.
Commit migrated from https://github.com/mono/mono/commit/
0375acd7c8b1634a44477f2a561a10cd4d01858a
Zoltan Varga [Wed, 28 Aug 2019 07:24:01 +0000 (03:24 -0400)]
Merge pull request mono/mono#16520 from vargaz/fix-llvm-2
[llvm] Fix ctlz intrinsics, they have 2 arguments.
Commit migrated from https://github.com/mono/mono/commit/
162849f97202e8a24355fb77b01657b891436383
Bernhard Urban [Tue, 27 Aug 2019 19:20:17 +0000 (21:20 +0200)]
fix cast and signature for mono_rconv_u4
Commit migrated from https://github.com/mono/mono/commit/
d6fa5ff9c6c482582149c93613468a0e0432d2af
Bernhard Urban [Tue, 27 Aug 2019 16:38:57 +0000 (09:38 -0700)]
[amd64] use opcode emulation for fconv/rconv
Commit migrated from https://github.com/mono/mono/commit/
460bfa9beb5159156df2256766d738debeffe706
Bernhard Urban [Tue, 27 Aug 2019 16:37:46 +0000 (09:37 -0700)]
[llvmaotcheck] require sse3 being available for regression tests
Commit migrated from https://github.com/mono/mono/commit/
8e6b967391533fbbe555e8aa83a5fdf501f81c36
Bernhard Urban [Tue, 27 Aug 2019 12:47:54 +0000 (08:47 -0400)]
[arm] use opcode emulation for fconv/rconv
Commit migrated from https://github.com/mono/mono/commit/
5b20322a84bac20433103ac06a59e654cf581485
Bernhard Urban [Tue, 27 Aug 2019 12:46:06 +0000 (08:46 -0400)]
[arm] account only 4 bytes on stack for single precision arguments
Fixes `test_0_arm64_small_stack_args` in gshared.cs when
* `test_0_arm64_small_stack_args` is compiled with LLVM
* `Foo3.Floats` is compiled with Mini
Commit migrated from https://github.com/mono/mono/commit/
ba824cb9213670069b85ab397a7163a50e911ff6
Bernhard Urban [Mon, 26 Aug 2019 20:00:06 +0000 (16:00 -0400)]
[arm64] use opcode emulation for fconv/rconv
LLVM eagerly optimizes constants such as NaN in a way that does not align with .NET behaviour. In the future we can change it so that we only do opcode emulation when LLVM is used.
Fixes https://github.com/mono/mono/issues/16411
Commit migrated from https://github.com/mono/mono/commit/
475defca4d4d24dc44c660244b645df5f33e20ac
Jay Krell [Mon, 26 Aug 2019 06:05:18 +0000 (23:05 -0700)]
Cleanup arm64 SeqPointInfo.
Commit migrated from https://github.com/mono/mono/commit/
645c01066c08adef6d302a25d1ed9db6047e3042
Jay Krell [Tue, 27 Aug 2019 21:39:18 +0000 (14:39 -0700)]
Inline mono_string_length_internal and mono_string_chars_internal (mono/mono#16374)
* Inline mono_string_length_internal and mono_string_chars_internal for everyone.
* Add MONO_REQ_GC_UNSAFE_MODE.
Commit migrated from https://github.com/mono/mono/commit/
f516e79dd981e174ebf04fe81b76cdbec25f6b20
Filip Navara [Tue, 27 Aug 2019 20:55:37 +0000 (22:55 +0200)]
Update version information in System.Private.CoreLib to mimic CoreCLR and make BenchmarkDotNet happy (mono/mono#16515)
BenchmarkDotNet recently updated the algorithms for .NET version detection (https://github.com/dotnet/BenchmarkDotNet/pull/1230) which made it incompatible with the version presented by Mono.
This updates the value of [ProductName](https://github.com/dotnet/coreclr/blob/mono/mono@
1f428dbc5554191dadd27511cd5cd181e4a60efb/Directory.Build.targets#L7) and [Version](https://github.com/dotnet/coreclr/blob/mono/mono@
c9007e73286456434ba12744e778e87a89fc1d90/eng/Versions.props#L5) to match what CoreCLR is currently reporting and makes the [BDN detection code](https://github.com/dotnet/BenchmarkDotNet/blob/mono/mono@
b6d0e0f1d80ed60aa157149a0dfb704a2da4ca41/src/BenchmarkDotNet/Environments/Runtimes/CoreRuntime.cs#L73-L81) happy.
Commit migrated from https://github.com/mono/mono/commit/
f4145ce10815b2f4a1d585dbdf462aa17015aed1
Ryan Lucia [Tue, 27 Aug 2019 20:53:37 +0000 (16:53 -0400)]
[netcore] Change exception thrown for SetTypedReference (mono/mono#16518)
This brings us in line with CoreCLR behavior.
Commit migrated from https://github.com/mono/mono/commit/
f9f5fff40c2012dc9631b7128d72c945620ce4fb
Zoltan Varga [Tue, 27 Aug 2019 20:34:27 +0000 (16:34 -0400)]
[llvm] Fix ctlz intrinsics, they have 2 arguments.
Commit migrated from https://github.com/mono/mono/commit/
340289d4aed8b8fe59379991d7b1320b419a2d36
Zoltan Varga [Tue, 27 Aug 2019 20:31:18 +0000 (16:31 -0400)]
[llvm] Fix the mixing of LLVM modules in the llvm JIT, use ctx->lmodule instead of module->lmodule.
Commit migrated from https://github.com/mono/mono/commit/
ab1e9be35e78e6a99f5e97cc6e1df514ddbdb8ab
Zoltan Varga [Tue, 27 Aug 2019 20:30:16 +0000 (16:30 -0400)]
Fix the netcore build. (mono/mono#16519)
Commit migrated from https://github.com/mono/mono/commit/
44d33673a5d390e1f691967eb776c608d60b7a64
Zoltan Varga [Tue, 27 Aug 2019 19:22:30 +0000 (15:22 -0400)]
Merge pull request mono/mono#16487 from vargaz/cattr-data-handles
[runtime] Convert mono_reflection_create_custom_attr_data_args () to use handles.
Commit migrated from https://github.com/mono/mono/commit/
3108d4305174a015484aa0f77226e98ea13cb948
Egor Bogatov [Tue, 27 Aug 2019 17:21:51 +0000 (20:21 +0300)]
use gunichar2
Commit migrated from https://github.com/mono/mono/commit/
e9dff75d2fb049f11fdcf595b68de1f3061bdeb7
Alexander Köplinger [Mon, 26 Aug 2019 23:50:15 +0000 (01:50 +0200)]
Remove AppContext.cs that was moved to shared
Commit migrated from https://github.com/mono/mono/commit/
f914d900f6fc639b25eca68432133fedd4f6297b
Vlad Brezae [Tue, 27 Aug 2019 17:27:22 +0000 (20:27 +0300)]
[interp] Remove unnecessary recomputation (mono/mono#16509)
Seems to have been added by mistake in https://github.com/mono/mono/pull/16317, which was meant just to remove the locals variable from InterpFrame.
Commit migrated from https://github.com/mono/mono/commit/
ccc4bf853618649602691c6a10af59f80cd18466
Jay Krell [Tue, 27 Aug 2019 13:31:10 +0000 (06:31 -0700)]
[interp] Error handling refactor (optimize non-exception path) (helps clang save stack) (mono/mono#16371)
While working on stack reduction, I believe I found that
the compiler could not tell how THROW_EX and/or NULL_CHECK terminate.
That is, essentially, the success paths preserve volatile registers.
They do not have to be spilled/filled.
This tweak should make it clearer to the compiler, optimized common paths, and not slow down uncommon paths.
This also cleans it up a little and reduces macro expansion, and then possibly should allow for reinlining what is now used only once.
Also add some const so it can be casted away less.
Believed to save 32 bytes of stack with Linux/amd64/clang, nothing for gcc.
And a nice cleanup.
Commit migrated from https://github.com/mono/mono/commit/
00c1ec421a3d47931bd9ad719faec62e60277837
Zoltan Varga [Tue, 27 Aug 2019 10:51:03 +0000 (06:51 -0400)]
Merge pull request mono/mono#16493 from EgorBo/impl-lzcnt
Implement System.Runtime.Intrinsics.X86.Lzcnt
Commit migrated from https://github.com/mono/mono/commit/
fa1288794b5a38fa717d0f8db459386c3d4b3ad3
Johan Lorensson [Tue, 27 Aug 2019 10:14:12 +0000 (12:14 +0200)]
Fix multiple SGEN_LOG to correctly scale elapsed time in usec. (mono/mono#16485)
Several SGEN_LOG entries logged usec based on result returend from TV_ELAPSED.
On SGEN's implementation of TV_ELAPSED, the result is not scaled to usec
but returned as 100ns ticks. This was not handled correctly by SGEN_LOG,
but other measures, like profile counters and SGEN binary protocol handles
it correctly.
Fix will adjust the SGEN_LOG calls currently presenting usec to correctly
scale the result. Fix also adds one additional logging measuring total
amount of time spend scanning thread data.
Commit migrated from https://github.com/mono/mono/commit/
70aba13173840818246b470e425a6d2585e7672d
Jay Krell [Tue, 27 Aug 2019 09:51:21 +0000 (02:51 -0700)]
[interp] Replace imethod with frame->imethod. (mono/mono#16459)
This conserves stack on Linux/amd64/gcc.
Commit migrated from https://github.com/mono/mono/commit/
bfe1b6182cb4e354f94d00d3206be4b83331db1d
Jay Krell [Tue, 27 Aug 2019 08:40:35 +0000 (01:40 -0700)]
CodeManager cleanup: (mono/mono#16468)
- Chunks do not need flags, only codemanagers do.
- Sort by size to minimize padding for alignment.
- Booleans only need one bit.
- Chunk is not spelled chunck.
- Suggest foo accessors be named foo() and set_foo(), not get_foo() and set_foo().
i.e. the more common "get" is implied.
- Allow free(0) w/o initialization.
Commit migrated from https://github.com/mono/mono/commit/
6cf8b6e73824545709cf6556726e0460bc7e2558
Jay Krell [Tue, 27 Aug 2019 08:36:59 +0000 (01:36 -0700)]
[monodis] Combine adjacent identical cases. (mono/mono#16501)
Commit migrated from https://github.com/mono/mono/commit/
9f9e5f7803b98494ca8773876c81e0cc582d679d
Zoltan Varga [Tue, 27 Aug 2019 07:57:44 +0000 (03:57 -0400)]
Add SETUP_ICALL_FUNCTION.
Commit migrated from https://github.com/mono/mono/commit/
c7d785f32996e9faa693f5e297d2ac47ee795acc
Jay Krell [Tue, 27 Aug 2019 07:46:35 +0000 (00:46 -0700)]
mono_attach_load_agent: Fix leaks, alloc, copy. (mono/mono#15950)
Extracted and slightly modified from https://github.com/mono/mono/pull/15868.
Commit migrated from https://github.com/mono/mono/commit/
7ca15e5a42ad03572e9209abb7e030ad712ee4b5
Jay Krell [Mon, 26 Aug 2019 23:04:46 +0000 (16:04 -0700)]
Add missing const, particularly on functions "like" memcpy. (mono/mono#16477)
But do not change the signatures of external functions.
Commit migrated from https://github.com/mono/mono/commit/
67c97d30b45751b5d87254d07c5343d92008dfb5
Zoltan Varga [Mon, 26 Aug 2019 21:31:50 +0000 (17:31 -0400)]
Merge pull request mono/mono#16451 from vargaz/gc-handle-pin
[runtime] Make the local gc handles pin the object they point to by scanning the handle area conservatively.
Commit migrated from https://github.com/mono/mono/commit/
4f8c0b9b46eb014ba7db36d824b3002c217a6c5b
Aleksey Kliger (λgeek) [Mon, 26 Aug 2019 21:13:45 +0000 (17:13 -0400)]
[threadpool-io] Throw if backend won't be able to register a FD (mono/mono#16396)
The poll+select i/o selector backend can't handle file descriptor ids greater
than FD_SETSIZE. This can happen if too many files are open and we want to
wait on it.
Previously, mono would fail in the i/o selector thread by which point it was
too late to do anything.
With this change we will fail eagerly on the thread that calls IOSelector.Add
by throwing a NotSupportedException.
Addresses https://github.com/mono/mono/issues/15931
Commit migrated from https://github.com/mono/mono/commit/
78edafd6e2d5ce886e2fd2ddc3cf8bbbffeeb860
Zoltan Varga [Mon, 26 Aug 2019 18:17:09 +0000 (14:17 -0400)]
Fix review comments.
Commit migrated from https://github.com/mono/mono/commit/
65a71a2912920768134442e04ea17c4fa7382d22
Egor Bogatov [Mon, 26 Aug 2019 18:08:53 +0000 (21:08 +0300)]
Implement Lzcnt hw intrinsics
Commit migrated from https://github.com/mono/mono/commit/
044d1519bdf40f37ec06128dd383c21157dc3c0e
Egor Bogatov [Mon, 26 Aug 2019 15:35:38 +0000 (18:35 +0300)]
[netcore] Implement missing ThreadPool methods (for metrics) (mono/mono#16076)
* Implement missing ThreadPool methods
* Address feedback
* ifdef for mono_threadpool_worker_get_completed_threads_count
* remove GetPendingUnmanagedWorkItemCount
Commit migrated from https://github.com/mono/mono/commit/
85265d884cf31f8779daba2d639eb795fbc9bd5e
Zoltan Varga [Mon, 26 Aug 2019 15:17:15 +0000 (11:17 -0400)]
[runtime] Convert mono_reflection_create_custom_attr_data_args () to use handles.
Commit migrated from https://github.com/mono/mono/commit/
a908b72037d0fd13f2a86208f35e833b62a96e55
Johan Lorensson [Mon, 26 Aug 2019 14:46:43 +0000 (16:46 +0200)]
Fix special case tramp assert in x86/amd64. (mono/mono#16476)
https://github.com/mono/mono/pull/16408 temporary fixed a tramp issue on
x86 (also exist on amd64). This commit fixes the underlying issue and re-enable
the use of noreturn outside of netcore.
The problem hit by the use of OP_NOT_REACHED on x86/amd64 is due to a specific
case when the address to patch happens to fall at the start of a different
managed method. Since the use of OP_NOT_REACHED can end a method
with the call instruction on x86/amd64 in combination with how patch location
(using the return address from stack) is resolved, the implementation in
mono_arch_patch_callsite didn't take this case into account, reading incorrect
patch data, triggering assert oh x86. So, based on timing we could end up with
the following code:
025715B3 call
02570D98
025715B8 push ebp
since the patch target is
025715B8, but also the start of a completely different
method, method_start == origin_code. The fix is to detect this case on x86/amd64
(done on each arch since the way origin_code is detected is arch specific)
and then use a method_start of NULL, that is already a supported scenario.
Commit migrated from https://github.com/mono/mono/commit/
f9be7a67d33d9bdec342401a8ed84885672e9b67
Alexander Köplinger [Mon, 26 Aug 2019 11:53:40 +0000 (13:53 +0200)]
[utils] Don't use MAP_32BIT on Apple platforms, fixes crash with XCode 11 beta6 (mono/mono#16441)
As of XCode 11 beta6 the MacOSX SDK defines the MAP_32BIT symbol:
```diff
--- /Applications/Xcode11-beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/mman.h 2019-07-25 17:43:49.
000000000 -0400
+++ /Applications/Xcode11-beta6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/mman.h 2019-08-06 21:03:07.
000000000 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2019 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
@@ -145,6 +145,10 @@
#define MAP_RESILIENT_CODESIGN 0x2000 /* no code-signing failures */
#define MAP_RESILIENT_MEDIA 0x4000 /* no backing-store failures */
+#if !defined(CONFIG_EMBEDDED)
+#define MAP_32BIT 0x8000 /* Return virtual addresses <4G only: Requires entitlement */
+#endif /* !defined(CONFIG_EMBEDDED) */
+
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
/*
```
This causes the mono_valloc() function to try to use the MAP_32BIT flag for mmap().
However as mentioned in the comment for the symbol in mman.h it seems to require a special entitlement
which isn't available/documented anywhere yet.
This in turn causes the mmap call to fail presumably because we're missing that entitlement.
Instead we now skip setting this flag on Apple platforms to make mmap() behave like it did before.
Commit migrated from https://github.com/mono/mono/commit/
2f2771fcfa22ac16a24a6a1ff2554440e5de29ca
Egor Bogatov [Mon, 26 Aug 2019 11:36:04 +0000 (14:36 +0300)]
Optimized LLVM IR (mono/mono#16448)
LLVM JIT: dump IR after optimizations
```csharp
[MethodImpl(MethodImplOptions.NoInlining)]
static int Test(int a, int b, int c) => a * b + a * c;
```
`MONO_VERBOSE_METHOD="Test"` now prints both unoptimized and optimized IR:
```llvm
*** Unoptimized LLVM IR for P:Test ***
; Function Attrs: noinline uwtable
define monocc i32 @"P:Test (int,int,int)"(i32 %arg_a, i32 %arg_b, i32 %arg_c) mono/mono#0 {
BB0:
br label %BB3
BB3: ; preds = %BB0
br label %BB2
BB2: ; preds = %BB3
%t22 = mul i32 %arg_a, %arg_b
%t25 = mul i32 %arg_a, %arg_c
%t27 = add i32 %t22, %t25
br label %BB1
BB1: ; preds = %BB2
ret i32 %t27
}
***
*** Optimized LLVM IR for P:Test ***
; Function Attrs: noinline uwtable
define monocc i32 @"P:Test (int,int,int)"(i32 %arg_a, i32 %arg_b, i32 %arg_c) mono/mono#0 {
BB0:
%t251 = add i32 %arg_b, %arg_c
%t27 = mul i32 %t251, %arg_a
ret i32 %t27
}
***
```
Commit migrated from https://github.com/mono/mono/commit/
6aaec2fe9b0c57dcd03967160d8c67bebcd91fae
Jay Krell [Mon, 26 Aug 2019 08:26:07 +0000 (01:26 -0700)]
[interp] Cleanup stackval_to_data and stackval_to_data_addr. (mono/mono#16458)
No functional change, except for debugging, look up a frame
for the prior value.
Commit migrated from https://github.com/mono/mono/commit/
6671316e35d9753539a0276c2c90c0300403b0ad
Bernhard Urban [Mon, 26 Aug 2019 07:46:12 +0000 (09:46 +0200)]
[android] remove text relocations in AOT/arm32 (mono/mono#16432)
[android] remove text relocations in AOT/arm32
Remove support for "big assemblies" for AOT on Android running on ARM 32bit. This will remove relocations in `.text` which are not allowed in the upcoming Android Q release anymore.
_If_ a customer should run into this problem, the suggested workarounds are:
* Switch to ARM64, or
* Do not use AOT compilation.
Fixes https://github.com/mono/mono/issues/16369
Commit migrated from https://github.com/mono/mono/commit/
b6ca76c48415393f09f09977327c0bcd99f10bf4
Ryan Lucia [Mon, 26 Aug 2019 03:13:39 +0000 (23:13 -0400)]
Detect additional invalid assembly names when parsing (mono/mono#16446)
Commit migrated from https://github.com/mono/mono/commit/
510f3c7d70d576cffc5f32edf8741ed841e6211d
Jay Krell [Sun, 25 Aug 2019 21:52:17 +0000 (14:52 -0700)]
Add MONO_LLVM_INTERNAL to mono_jit_compile_method. (mono/mono#16463)
Commit migrated from https://github.com/mono/mono/commit/
e95ef822a16406c2c75f973f22c6e47d0e4f4e7f
Jay Krell [Sun, 25 Aug 2019 17:11:02 +0000 (10:11 -0700)]
[interp] Outline mono_interp_box_vt. (mono/mono#16454)
Contributes to https://github.com/mono/mono/issues/16172.
Seen to reduce frame from 0xB8 to 0xA8 on Linux/amd64/gcc against master.
Possibly similar elsewhere.
(Possibly 8 added to a rounded 8.)
Add const, add braces, they might help compiler and/or programmer.
Commit migrated from https://github.com/mono/mono/commit/
2224d6b55d286e8ab1f2b222f4171f9667c27ed6
Zoltan Varga [Sat, 24 Aug 2019 15:32:37 +0000 (11:32 -0400)]
[runtime] Make the local gc handles pin the object they point to by scanning
the handle area conservatively.
Commit migrated from https://github.com/mono/mono/commit/
7d43ffda1a29315b20d2ab64d19db9d33e8faa4d
Jay Krell [Sat, 24 Aug 2019 07:56:40 +0000 (00:56 -0700)]
[interp] Outline STRMFLD_VT. (mono/mono#16355)
Without being entirely scientific about it, this case seems
to be one that uses more than typical locals and therefore
be on a sort of critical path to reduce frame size.
I have a change that reduces frame to 0x78 bytes (albeit
not yet working) and to achieve that, in this case I refetched
the locals after function calls.
This achieves similar but perhaps more elegantly.
If we rest at larger frame size then this case might not be
on the critical path.
https://github.com/mono/mono/issues/16172
Commit migrated from https://github.com/mono/mono/commit/
9d1eec6bf88656e8302441d0349dcc467a52b605
Jay Krell [Sat, 24 Aug 2019 07:56:00 +0000 (00:56 -0700)]
[windows gc] Trim one syscall per thread in garbage collection. (mono/mono#16003)
* Skip one syscall per thread in garbage collection.
Specifically do not query for guard pages.
There are better ways:
1. Visual C++ specific, __try / __except, get the guard page exception,
put back the guard page. This is a little slower (exception + two syscalls),
but exceedinly rare. __try itself is cheap on x86, free on the rest.
This was also not allowed on UWP. It will be. And is VirtualProtectFromApp.
2. Record the TEB and get from it the maximum commited page and just use MAX, trivial.
The comments are also not completely clear as to what is going on here, but they were close.
Augment them.
Commit migrated from https://github.com/mono/mono/commit/
99e9d8064272eefdba7c567f44d924ad1ec938ac
Jay Krell [Sat, 24 Aug 2019 07:52:30 +0000 (00:52 -0700)]
Remove dlmalloc from Win32. (mono/mono#15773)
Commit migrated from https://github.com/mono/mono/commit/
ab6a09741d1017800ecc2d1688562f68547d7834
Zoltan Varga [Fri, 23 Aug 2019 22:06:17 +0000 (18:06 -0400)]
Merge pull request mono/mono#16414 from vargaz/llvm-gc-poll-wrapper
[llvm] Add a mono wrapper method for the gc poll cold cconv wrapper so the EH code can unwind through it.
Commit migrated from https://github.com/mono/mono/commit/
ab9c58d76d49c750bf69ee4f6ba89c45c8a1df51
Ryan Lucia [Fri, 23 Aug 2019 19:58:10 +0000 (15:58 -0400)]
Return an empty string for assemblies loaded from stream (mono/mono#16345)
* Return an empty string for assemblies loaded from memory
* Blind attempt to fix wasm
Commit migrated from https://github.com/mono/mono/commit/
83cf007ae3e52a7c83d2a31bbc939aa08df67392
Ryan Lucia [Wed, 21 Aug 2019 22:35:24 +0000 (18:35 -0400)]
[netcore] Use requesting assembly's context for InternalLoad calls
Commit migrated from https://github.com/mono/mono/commit/
7615ba3e45654ce5b22125c818876c10b6e4fbf9
Ryan Lucia [Wed, 21 Aug 2019 20:40:08 +0000 (16:40 -0400)]
[netcore] Random loader cleanup
Commit migrated from https://github.com/mono/mono/commit/
0661bf0424f78f35571c229733d61b406f082e5b
Zoltan Varga [Fri, 23 Aug 2019 12:13:21 +0000 (08:13 -0400)]
Merge pull request mono/mono#16431 from kjpou1/wasm-maindir-cleanup
[wasm] Small cleanup of main wasm directory
Commit migrated from https://github.com/mono/mono/commit/
f0cbb79b7f17d30c6674f600f4fccef8a4f1cc87
Zoltan Varga [Fri, 23 Aug 2019 11:49:20 +0000 (07:49 -0400)]
[jit] Make mono_unwind_frame () ignore registers which are greater than NUM_DWARF_REGS.
These registers can be encountered in the unwind info for functions with a cold
cconv, like xmm0 on amd64. Since they are caller saved, they don't have to
be restored during EH.
Commit migrated from https://github.com/mono/mono/commit/
97d2d976156f5584d913844f2610683978f2a567
Zoltan Varga [Fri, 23 Aug 2019 10:40:09 +0000 (06:40 -0400)]
Merge pull request mono/mono#16429 from vargaz/llvm-jit-module
[llvm] Don't pass a module argument to the code in llvm-jit.cpp, we create a new LLVM module for each method.
Commit migrated from https://github.com/mono/mono/commit/
fdd0d7f027f2f45a8aacd304747a42e4ae7d9739
Zoltan Varga [Fri, 23 Aug 2019 10:28:40 +0000 (06:28 -0400)]
Fix the bitcode build.
Commit migrated from https://github.com/mono/mono/commit/
81f736e7745d7d94c282eb20605e970db74aeef1
Zoltan Varga [Fri, 23 Aug 2019 09:34:52 +0000 (05:34 -0400)]
[llvm] Add a cold wrapper and mono wrapper for gc poll for JITted code as well.
Commit migrated from https://github.com/mono/mono/commit/
4ed1c3335f2ddf88e1e402ad046bcb2d7cebc7d0
Zoltan Varga [Thu, 22 Aug 2019 20:15:22 +0000 (16:15 -0400)]
Fix the build.
Commit migrated from https://github.com/mono/mono/commit/
0d603261a0e27f97c0f8f7874411435010799550
Zoltan Varga [Thu, 22 Aug 2019 17:28:17 +0000 (13:28 -0400)]
[llvm] Add a mono wrapper method for the gc poll cold cconv wrapper so the EH code can unwind through it.
Commit migrated from https://github.com/mono/mono/commit/
f6b189ecab310271f456dea05e2ddd320d72acfc
Zoltan Varga [Fri, 23 Aug 2019 08:41:10 +0000 (04:41 -0400)]
Merge pull request mono/mono#16407 from vargaz/fix-llvm-simd
[llvm] Fix type issues in the llvm IR emitted for SIMD. Fix a warning.
Commit migrated from https://github.com/mono/mono/commit/
8ace3754509cd9875f3a6b28d5f90f5471bffd9a
Zoltan Varga [Fri, 23 Aug 2019 08:40:28 +0000 (04:40 -0400)]
Merge pull request mono/mono#16408 from vargaz/noreturn-methods
[jit] Special case the ThrowHelper methods only on netcore.
Commit migrated from https://github.com/mono/mono/commit/
14a76b03c51af060cd497b1e14e891b548c340d9
Egor Bogatov [Fri, 23 Aug 2019 08:17:31 +0000 (11:17 +0300)]
Merge pull request mono/mono#16412 from EgorBo/fix-ci4
[netcore] Fix CI, ignore failing tests
Commit migrated from https://github.com/mono/mono/commit/
47efe6bab00303974025dd7f41af806df49fe842
Zoltan Varga [Fri, 23 Aug 2019 07:27:41 +0000 (03:27 -0400)]
[llvm] Don't pass a module argument to the code in llvm-jit.cpp, we create a new LLVM module for each method.
Commit migrated from https://github.com/mono/mono/commit/
c357de87ec2b3d4369f6c2405c5baa919d1e1059
Zoltan Varga [Fri, 23 Aug 2019 06:08:12 +0000 (02:08 -0400)]
Merge pull request mono/mono#16379 from EgorBo/improve-dump
Improve MONO_VERBOSE_METHOD
Commit migrated from https://github.com/mono/mono/commit/
c97bfe21679544bdf4ba7f20d459b6cf219e21e8
coypoop [Thu, 22 Aug 2019 22:46:08 +0000 (22:46 +0000)]
If either sched_get_priority_{min,max} failed, don't try to set a priority (mono/mono#15898)
netbsd and linux both require that if SCHED_OTHER is used, a fixed value is used for sched_param ([0 for linux](http://man7.org/linux/man-pages/man7/sched.7.html), -1 for netbsd)
the netbsd case can also be detected by the [POSIX-defined failure](https://pubs.opengroup.org/onlinepubs/
007908799/xsh/sched_get_priority_min.html) return value for sched_get_priority_min, a return value of -1.
Commit migrated from https://github.com/mono/mono/commit/
f626f3e7aa540c9d7fb267d3beb4ec4cb32fac8d
EgorBo [Thu, 22 Aug 2019 22:12:47 +0000 (01:12 +0300)]
ignore FSW test
Commit migrated from https://github.com/mono/mono/commit/
71dce6502a5b75e74ef765e2d2b9e674680e9a80
EgorBo [Thu, 22 Aug 2019 20:08:44 +0000 (23:08 +0300)]
ignore more tests
Commit migrated from https://github.com/mono/mono/commit/
692f70cb677a127499abf930035982386f391026
EgorBo [Thu, 22 Aug 2019 18:47:45 +0000 (21:47 +0300)]
Disable the whole System.ComponentModel.Composition namespace
Commit migrated from https://github.com/mono/mono/commit/
40cf68aa98078d5dd6c62ec21db5e0e9366a6b1c
EgorBo [Thu, 22 Aug 2019 17:53:14 +0000 (20:53 +0300)]
fix macOS
Commit migrated from https://github.com/mono/mono/commit/
7678654781869c0507f6dd07c9756a9ab666f991
Steve Pfister [Thu, 22 Aug 2019 16:22:22 +0000 (12:22 -0400)]
Added a workaround for an issue with the compiler server on 32-bit linux. (mono/mono#16405)
Currently, if the process is 32-bit, roslyn tries to determine how much
memory is available. To do that, it tries to pinvoke into GlobalMemoryStatusEx,
which is not supported on mono.
Without it, the compiler server bombs on https://github.com/dotnet/roslyn/blob/mono/mono@
0e63260c5afb3fb5b74c357dd250e500172bcd63/src/Compilers/Server/VBCSCompiler/NamedPipeClientConnection.cs#L55-L59
Commit migrated from https://github.com/mono/mono/commit/
fbdad781018886353f8a02a23eee9957a092bbf3
EgorBo [Thu, 22 Aug 2019 16:02:53 +0000 (19:02 +0300)]
update rsp
Commit migrated from https://github.com/mono/mono/commit/
779fda51037cc4540e844b9760538d2bafae04e4
EgorBo [Thu, 22 Aug 2019 15:52:52 +0000 (18:52 +0300)]
ignore some tests
Commit migrated from https://github.com/mono/mono/commit/
f809fe55a88438009390a25e871d1952780dc02e
Zoltan Varga [Thu, 22 Aug 2019 14:36:43 +0000 (10:36 -0400)]
[jit] Special case the ThrowHelper methods only on netcore.
Commit migrated from https://github.com/mono/mono/commit/
49f913ac8afda7f7b2321c6b4755557e56e57ef3
Zoltan Varga [Thu, 22 Aug 2019 14:28:47 +0000 (10:28 -0400)]
[llvm] Fix type issues in the llvm IR emitted for SIMD. Fix a warning.
Commit migrated from https://github.com/mono/mono/commit/
f2f58e522b8d8702814d8b6943343d68029d0a1e
Aleksey Kliger (λgeek) [Thu, 22 Aug 2019 14:10:09 +0000 (10:10 -0400)]
[android] mono_dl_open_file: use g_file_test only on absolute paths (mono/mono#16387)
The intention of calling `g_file_test (file, G_FILE_TEST_EXISTS)` where file is
the name of a shared library we want to open is to speed up probing for
non-existent libraries.
See https://github.com/mono/mono/pull/12074
The problem is that if file is just a simple "libdl.so" then `dlopen (file)`
doesn't just look for it in the current working directory, it will probe some
other paths too. (For example on desktop linux you'd also look in all the
directories in LD_LIBRARY_PATH). So the g_file_test() call is not a robust way
to avoid calling dlopen if the filename is relative.
But it actually broke more things: https://github.com/xamarin/xamarin-android/issues/3388
When probing for "libdl.so" on Android mono_lookup_pinvoke_call will first try
prepending some paths that it knows about and we end up calling
`dlopen ("/system/lib/libdl.so")` which will fail because Bionic has security
restrictions on what code can dlopen something from /system/lib with an
absolute path. Eventually mono_lookup_pinvoke_call will go back to trying the
bare "libdl.so" which hits `g_file_test` and returns NULL.
The new code only does the file test if we pass it an absolute path, which
gives Bionic's dlopen a chance to deal with relative paths however it needs to.
Commit migrated from https://github.com/mono/mono/commit/
e74736a471f50781db06914f1c048aadabfb52bc
Zoltan Varga [Thu, 22 Aug 2019 13:07:02 +0000 (09:07 -0400)]
Merge pull request mono/mono#16300 from EgorBo/llvm-fpm
Use basic LLVM optimizations (PassManager) in JIT mode
Commit migrated from https://github.com/mono/mono/commit/
f6b0c9b7723a2e992e1728ab4782d8331048eef7
Jay Krell [Thu, 22 Aug 2019 12:57:39 +0000 (05:57 -0700)]
[interp] Replace endsp with preexisting child_frame.retval which appears equivalent. (mono/mono#16378)
This should conserve stack. I didn't verify it.
child_frame being address-taken, compiler would struggle to remove it.
So we have the same value in two places.
https://github.com/mono/mono/issues/16172
Commit migrated from https://github.com/mono/mono/commit/
5368fef5ee6859c3bc81f6c6c2cbb7635d9f4778
Zoltan Varga [Thu, 22 Aug 2019 12:43:07 +0000 (08:43 -0400)]
Merge pull request mono/mono#16390 from EgorBo/intptr-intrinsic
Make IntPtr.Zero intrinsic
Commit migrated from https://github.com/mono/mono/commit/
87a6364d58a52ffa5f930770b7226caba9e88e5d
Zoltan Varga [Thu, 22 Aug 2019 12:26:10 +0000 (08:26 -0400)]
Merge pull request mono/mono#16386 from vargaz/llvm-inline-limit
[llvm] Use a different inline limit (30) for llvm+aot.
Commit migrated from https://github.com/mono/mono/commit/
341cc0dd833b63f226347ce9e05ff41d9a568ae7
Zoltan Varga [Thu, 22 Aug 2019 11:26:36 +0000 (07:26 -0400)]
Merge pull request mono/mono#16384 from vargaz/fix-16381
[llvm] Fix an assert.
Commit migrated from https://github.com/mono/mono/commit/
3f21a2c8f3cbdfa8a5be6309d099c2f7fcc5d005
Zoltan Varga [Thu, 22 Aug 2019 09:36:17 +0000 (05:36 -0400)]
Merge pull request mono/mono#16389 from vargaz/fix-16380
[aot] Simplify a check to avoid calling into the assembly loading code while loading the aot image for corlib.
Commit migrated from https://github.com/mono/mono/commit/
254d6d37580a70fbb4fa072b0b2b16d2984b3bb5
Zoltan Varga [Thu, 22 Aug 2019 04:34:32 +0000 (00:34 -0400)]
Add comments.
Commit migrated from https://github.com/mono/mono/commit/
b7ca80ed581f3ad232107726b651f6adb407d197
Egor Bogatov [Wed, 21 Aug 2019 22:46:10 +0000 (01:46 +0300)]
Update llvm-jit.cpp
Commit migrated from https://github.com/mono/mono/commit/
279676f43ed0c310fdc2146e3cceb40561ddf04a
Egor Bogatov [Wed, 21 Aug 2019 22:43:56 +0000 (01:43 +0300)]
cleanup
Commit migrated from https://github.com/mono/mono/commit/
d02695ef47ccf628d77cceae13dbb756fbf2ce22
Egor Bogatov [Wed, 21 Aug 2019 21:47:40 +0000 (00:47 +0300)]
Merge remote-tracking branch 'origin/master' into llvm-fpm
Commit migrated from https://github.com/mono/mono/commit/
1822f2faab3e58199ed33560e18ebabad7da06e6
Bernhard Urban [Wed, 21 Aug 2019 21:16:03 +0000 (23:16 +0200)]
[netcore] Use Release configuration for default System.Private.CoreLib build (mono/mono#16391)
It seems the Configuration set inside of the System.Private.CoreLib.csproj is just completely ignored, making it default to "Debug".
Maybe because we're using Microsoft.NET.Sdk ?
Commit migrated from https://github.com/mono/mono/commit/
5c9be2dc2b7bdb75dd3eca910754d04f08cfdd06
Egor Bogatov [Wed, 21 Aug 2019 18:48:14 +0000 (21:48 +0300)]
use EMIT_NEW_PCONST
Commit migrated from https://github.com/mono/mono/commit/
cb34178cd69d0dc8a88657379f796a4811de23ff
Egor Bogatov [Wed, 21 Aug 2019 18:23:19 +0000 (21:23 +0300)]
Make IntPtr.Zero intrinsic
Commit migrated from https://github.com/mono/mono/commit/
d3ecd70eadb4b682358e25934b13a88f2a69694e
Zoltan Varga [Wed, 21 Aug 2019 18:15:25 +0000 (14:15 -0400)]
[aot] Simplify a check to avoid calling into the assembly loading code while loading the aot image for corlib.
Fixes https://github.com/mono/mono/issues/16380.
Commit migrated from https://github.com/mono/mono/commit/
c4de19ef097006408bbc52f489ec860b43cf8c17
Zoltan Varga [Wed, 21 Aug 2019 16:20:50 +0000 (12:20 -0400)]
[llvm] Use a different inline limit (30) for llvm+aot.
Commit migrated from https://github.com/mono/mono/commit/
433b9a7f70231bcdfe4bb2d9ef08a240f92090eb
Zoltan Varga [Wed, 21 Aug 2019 16:03:16 +0000 (12:03 -0400)]
[llvm] Fix an assert.
Fixes https://github.com/mono/mono/issues/16381.
Commit migrated from https://github.com/mono/mono/commit/
0e2da3c2abb0c2797cb24da05e16d76bfc179e8c