Calvin Buckley [Sun, 24 Nov 2019 22:08:19 +0000 (18:08 -0400)]
Allow runtime to be built with C++ on AIX (mono/mono#17672)
* Allow runtime to be built with C++ on AIX
Many AIX/PPC/BE specific codepaths didn't do casting properly,
since C++ is much stricter than C about pointer typing.
Also specify the C99 format macros early as possible, since
inttypes may get included before eglib gets a chance to set the
macros.
Also explicitly use -pthread, since not using it is the cause of
many libstdc++ crashes on AIX.
* Oops, should have been that define instead
* Suggested changes from Jay on style
* Remove unneeded cast
Commit migrated from https://github.com/mono/mono/commit/
a3f4def8b6951fed5c248bd1875e90a7ab748d15
Alexander Köplinger [Sat, 23 Nov 2019 23:16:20 +0000 (00:16 +0100)]
Fix warnings in runtime build (mono/mono#17887)
This makes at least the netcore-mono build in dotnet/runtime warning-free.
Commit migrated from https://github.com/mono/mono/commit/
280e9d2423549d86686716f0818bcdbac9702ea1
Alexander Köplinger [Sat, 23 Nov 2019 09:06:40 +0000 (10:06 +0100)]
[netcore] Disable libmonoruntime-support.la build on netcore (mono/mono#17885)
It's used for the zlib compression helpers used by System.IO.Compression in the old Mono BCL.
On corefx this is handled differently so we don't need it there.
To avoid automake complaining about missing files we include the .c files directly instead of in the Makefile.
Commit migrated from https://github.com/mono/mono/commit/
165e28ae97cc3bcac2f36484c74e8cd7c39ee9f1
Alexander Köplinger [Fri, 22 Nov 2019 22:00:28 +0000 (23:00 +0100)]
[netcore] Disable a test which fails on the interpreter
The test is wrong, will be fixed upstream.
Commit migrated from https://github.com/mono/mono/commit/
2ccd6122bd89533436e68198409350dc0fd99d3c
Alexander Köplinger [Fri, 22 Nov 2019 21:48:11 +0000 (22:48 +0100)]
Make configure.ac and Makefile.am work without certain directories (mono/mono#17871)
Those folders won't be present in the dotnet/runtime repository.
We need to factor out AC_OUTPUT into a separate file so we can continue
to share configure.ac but not the list of files in AC_OUTPUT since
autotools doesn't support variables there.
Commit migrated from https://github.com/mono/mono/commit/
0d8037217302a15c83687dcd31e4136baf4f360f
Zoltan Varga [Fri, 22 Nov 2019 19:34:14 +0000 (20:34 +0100)]
[runtime] Treat calling a non-virtual method through an open delegate the same as the normal case instead of the OPEN_VIRTUAL case. (mono/mono#17832)
* [runtime] Treat calling a non-virtual method through an open delegate the same as the normal case instead of the OPEN_VIRTUAL case.
* [amd64] Fix the return value mapping in gsharedvt calls, the return address might be in different registers in the caller and callee.
* [runtime] Always initialize del->method_ptr even if interp_method is set, JITted code makes calls through it in mixed mode.
* Add a test for open delegates and gsharedvt.
* Increase nrgctx trampoline count, its needed by dynamic-method-churn.exe in full-aot-interp mode.
Commit migrated from https://github.com/mono/mono/commit/
93e46c687b0f1b3bea7ecf362a667f3bd8b59fc5
Jonathan Chambers [Fri, 22 Nov 2019 17:03:23 +0000 (17:03 +0000)]
Replace embedded libgc with Unity fork of recent Boehm (bdwgc) (mono/mono#16832)
* Initial commit to migrate libgc to bdwgc.
* Fix submodule url
* Don't force Boehm as runtime wrapper. Was just for testing locally.
* Build bdwgc as single object file. Helps with performance.
* Bump bdwgc submodule.
* Attempt to fix windows MSVC based build.
* Remove any references to GC_INSIDE_DLL as we manually managed threads on Windows.
* Allow building boehm on Windows amd64.
* Allow building boehm with msvc.
* Bump bdwgc to fix line endings
* Use LF for sh, am, m4, and ac files in bdwgc
* Bump bdwgc & libatomic_ops with fix for cygwin
* Bump bdwgc to fix mono-boehm being generated as libtool wrapper script.
* Link the static boehm library.
* Revert "Link the static boehm library."
This reverts commit mono/mono@
1f90d81d08308a61c890743cd79d8f6bb791bc99.
* Use --export-all-symbols on cygwin/mingw to fix issues with boehm causing mono symbols not to be exported.
* Fix
Commit migrated from https://github.com/mono/mono/commit/
cc137237d86b0553e844dc34c9a3cbc5b20782c0
Filip Navara [Fri, 22 Nov 2019 12:51:43 +0000 (13:51 +0100)]
Fix InternalGetHashCode for boehm/null GC (mono/mono#17859)
It was unintentionally shifting the address to left instead of right. It should be shift right to get rid of zeroes from the alignment.
Commit migrated from https://github.com/mono/mono/commit/
0fed03ed63ed4ea742c4511d8edc3bc1c6f4044f
Alexander Köplinger [Fri, 22 Nov 2019 12:18:10 +0000 (13:18 +0100)]
Fix automake warning
Commit migrated from https://github.com/mono/mono/commit/
5fedc42ccf6a182586280b6a324c221a7703b55f
Zoltan Varga [Fri, 22 Nov 2019 11:42:55 +0000 (12:42 +0100)]
[wasm] Add aot+netcore support. (mono/mono#17798)
* [wasm] Compile corelib as 32 bit.
* [wasm] Add a netcore cross compiler.
* [wasm] Add netcore+aot support.
* [aot] Load the dedup module lazily instead of at startup.
The previous version didn't work on netcore because it couldn't resolve references to corlib etc.
since they were not yet registered in the root domain at the time of loading.
* Add more icall trampoline signatures.
* Add more netcore pinvokes.
* Fix the build.
* Add more icall trampoline signatures.
* Add an --embed-file option to the packager.
* Add more netcore pinvokes.
* [interp] Return FALSE for IsDynamicCodeCompiled.
* Add a netcore project and targets for running BenchmarkDotNet.
* Fix pinvoke tables.
* Add missing files.
* Fix make clean.
* Add a comment.
* Revert "Fix pinvoke tables."
This reverts commit mono/mono@
998065e77614b7e621d2873510aabc3930669ca9.
* Make xunit-runner into a dotnet project. Add a netcore version.
Commit migrated from https://github.com/mono/mono/commit/
ecd67a91c4bbeef046f8521da93f106da8fc0191
Egor Bogatov [Fri, 22 Nov 2019 08:14:23 +0000 (11:14 +0300)]
[netcore] Run tests with Interpreter (mono/mono#17862)
* Run tests with interp and llvm
* fix build
* Run tests with llvm
* Add a few tests to rsp for LLVM
Commit migrated from https://github.com/mono/mono/commit/
6a5c44b15e65782cac21673cd33138a92a6b6207
Jay Krell [Thu, 21 Nov 2019 19:15:29 +0000 (11:15 -0800)]
Remove handles/MonoError from Mono.RuntimeGPtrArrayHandle. (mono/mono#17806)
Commit migrated from https://github.com/mono/mono/commit/
dadc3d3117535ec44b887b8390181beda7b75b31
Jo Shields [Thu, 21 Nov 2019 18:48:00 +0000 (19:48 +0100)]
Stop referencing files from Mono BCL in Netcore System.Private.CoreLib (mono/mono#17866)
Commit migrated from https://github.com/mono/mono/commit/
9e00330af303bdc2b5f4ea2302e8bbcdfdc45524
Bernhard Urban-Forster [Thu, 21 Nov 2019 10:56:03 +0000 (11:56 +0100)]
[interp] fix array_element_size intrinsic (mono/mono#17857)
[interp] fix array_element_size intrinsic
`mono_class_array_element_size` gives us the size of the provided MonoClass if it would be an array element. But here we want the element size of a given array's MonoClass. That's what `mono_array_element_size` is returning.
This leads to all kind of weird crashes otherwise, specifically here:
https://github.com/mono/mono/blob/mono/mono@
2c20649539ac16e069a65f2a750c793eb341e50f/netcore/System.Private.CoreLib/src/System/Array.Mono.cs#L64
Which is then used later to compute the size to memset in order to clear the content of an array. If it's larger than it should be, then this will cause memory corruption. For example this would crash eventually:
```csharp
using System;
using System.Collections.Generic;
namespace HelloWorld {
class Program {
static void Main(string[] args) {
for (int j = 0; j < 0x1000; j++) {
var d = new Dictionary<string, string> ();
for (int i = 0; i < 197; i++)
d.Add (i + "", i + "foo");
d.Clear ();
}
}
}
}
```
Thanks to @EgorBo for reporting.
Commit migrated from https://github.com/mono/mono/commit/
058d157648f593f41a2afbf878c0f401ecb804b7
Alexander Köplinger [Thu, 21 Nov 2019 09:01:39 +0000 (10:01 +0100)]
[metadata] Remove native threadpool from netcore build (mono/mono#17856)
We use the managed threadpool there.
Commit migrated from https://github.com/mono/mono/commit/
b6e4ddd73c436ce23ae7036a7170f59b545e46b7
Egor Bogatov [Wed, 20 Nov 2019 20:25:24 +0000 (23:25 +0300)]
[llvm] Recognize GEP (mono/mono#17844)
* initial impl
* improve jit
* fix copy-paste
* disable for non-netcore
* clean up
Commit migrated from https://github.com/mono/mono/commit/
2c20649539ac16e069a65f2a750c793eb341e50f
Zoltan Varga [Wed, 20 Nov 2019 18:56:09 +0000 (19:56 +0100)]
[interp] Move the freeing of interp method info into a callback. (mono/mono#17852)
[interp] Move the freeing of interp method info into a callback.
Commit migrated from https://github.com/mono/mono/commit/
4961d411e7f6a425c4b7fad86b72f02947f9c817
Egor Bogatov [Wed, 20 Nov 2019 15:53:14 +0000 (18:53 +0300)]
enable gss on android (mono/mono#17838)
Commit migrated from https://github.com/mono/mono/commit/
27e6e812f14163d1cb6555803148947043065386
Alexander Köplinger [Wed, 20 Nov 2019 07:28:58 +0000 (08:28 +0100)]
[debugger-agent] Fix CMD_VM_ALL_THREADS returning wrong value due to unitialized variable (mono/mono#17847)
`remove_gc_finalizing` wasn't initialized so its value is undefined.
The `count_thread_check_gc_finalizer()` function only sets it in some cases so we could end up with the variable having an undefined (and probably not 0) value.
This resulted in the returned thread count from the debuggee being wrong because we'd decrement `count` even though we shouldn't.
Regression from https://github.com/mono/mono/pull/15618
Commit migrated from https://github.com/mono/mono/commit/
0396037d31dacac06358faf30eb05d8e00b8b231
dotnet-maestro[bot] [Tue, 19 Nov 2019 15:47:57 +0000 (16:47 +0100)]
[master] Update dependencies from dotnet/arcade dotnet/core-setup dotnet/corefx (mono/mono#17690)
* Update dependencies from https://github.com/dotnet/arcade build
20191102.1
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19552.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19552.1
* Update dependencies from https://github.com/dotnet/core-setup build
20191104.1
- Microsoft.NETCore.App - 5.0.0-alpha.1.19554.1
* Update dependencies from https://github.com/dotnet/corefx build
20191103.8
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19553.8
* Update dependencies from https://github.com/dotnet/arcade build
20191108.11
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19558.11
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19558.11
* Update dependencies from https://github.com/dotnet/core-setup build
20191109.5
- Microsoft.NETCore.App - 5.0.0-alpha.1.19559.5
* Update dependencies from https://github.com/dotnet/corefx build
20191109.6
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19559.6
* Update dependencies from https://github.com/dotnet/arcade build
20191117.2
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.19567.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.19567.2
* Update dependencies from https://github.com/dotnet/core-setup build
20191114.1
- Microsoft.NETCore.App - 5.0.0-alpha.1.19564.1
* Update dependencies from https://github.com/dotnet/corefx build
20191113.6
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19563.6
* Use NETCoreApp version 5.0.0-alpha.1.19563.3
Later versions have an issue and the new dotnet/runtime assets aren't ready yet.
* Disable failing tests
* Fix merge error
Commit migrated from https://github.com/mono/mono/commit/
a6db160596bb987af11fb2844d51c9a3a7c73133
Zoltan Varga [Mon, 18 Nov 2019 12:55:15 +0000 (13:55 +0100)]
[interp] Add some missing netcore intrinsics. (mono/mono#17782)
Commit migrated from https://github.com/mono/mono/commit/
b8fe43da3ed89337c51dfa8f4e07955ed204761d
Steve Pfister [Mon, 18 Nov 2019 11:13:16 +0000 (06:13 -0500)]
Bump corefx to pick up https://github.com/mono/corefx/pull/370 (mono/mono#17758)
Backport of https://github.com/dotnet/corefx/pull/34560
Added HAVE_LCHFLAGS & HAVE_STAT_FLAGS to configure.
Commit migrated from https://github.com/mono/mono/commit/
0269f7b479f245c13b30c1b44cc91cc224c48b93
Filip Navara [Sun, 17 Nov 2019 23:24:11 +0000 (00:24 +0100)]
[llvm] Add support for LLVM JIT on ARM64 (mono/mono#17827)
* [llvm] Add support for LLVM JIT on ARM64
* Fix tabs
Commit migrated from https://github.com/mono/mono/commit/
e2ccdac3f48d2c7726a69bf813df6992badfae01
Nikolay Sivov [Fri, 15 Nov 2019 16:56:55 +0000 (19:56 +0300)]
[mini] Fix NULL pointer crash in mono_decompose_vtype_opts(). (mono/mono#17801)
* [mini] Fix NULL pointer crash in mono_decompose_vtype_opts().
All other call sites for mono_type_size() are already passing non-null pointer there.
* [mini] Rename variable dummy -> align.
Commit migrated from https://github.com/mono/mono/commit/
18dd48cad81592f66ce7d21a5293c76d69864501
Zoltan Varga [Fri, 15 Nov 2019 08:04:35 +0000 (09:04 +0100)]
[runtime] Add MONO_EMPTY_SOURCE_FILE to a couple of files. (mono/mono#17795)
* [runtime] Add MONO_EMPTY_SOURCE_FILE to a couple of files.
* Fix a typo.
* Revert unrelated changes.
Commit migrated from https://github.com/mono/mono/commit/
25b7e6bd427f47ee08dbd2dd6333780da1ea97be
Jay Krell [Thu, 14 Nov 2019 07:18:02 +0000 (23:18 -0800)]
Remove handles from System.Diagnostics.Debugger. (mono/mono#17713)
* Remove handles from System.Diagnostics.Debugger.
memset (&x, 0, sizeof (type)) to memset (&x, 0, sizeof (x)).
* Bump API snapshot submodule
Commit migrated from https://github.com/mono/mono/commit/
19a44cd32bbf4d993a0e833a76250e563828233f
Zoltan Varga [Wed, 13 Nov 2019 21:34:01 +0000 (22:34 +0100)]
[interp] Add some inline checks from the JIT. (mono/mono#17784)
Commit migrated from https://github.com/mono/mono/commit/
1d81534d27a01f23e0a75cee8097b565671080a1
Zoltan Varga [Wed, 13 Nov 2019 17:12:09 +0000 (18:12 +0100)]
[runtime] Fix some handle usage in native-library.c (mono/mono#17781)
Commit migrated from https://github.com/mono/mono/commit/
a0fcc29d5d67cf4f2e70072294b2ba4751324226
Jay Krell [Wed, 13 Nov 2019 16:55:52 +0000 (08:55 -0800)]
Remove handles from ves_icall_System_Array_CanChangePrimitive. (mono/mono#17708)
Remove handles from ves_icall_System_Array_CanChangePrimitive.
Commit migrated from https://github.com/mono/mono/commit/
73431403c7e7525122526eae016f80e9d9398d3e
Thays Grazia [Wed, 13 Nov 2019 15:29:33 +0000 (16:29 +0100)]
[debugger] Assert when async debug a generic method (mono/mono#17727)
* When we try to call a method to get the async_id to do an async debug and we are trying to do this in a generic method like this:
async Task<T> ExecuteAsync_Broken<T>()
{
await Task.Delay(2);
return default;
}
We need to inflate the generic type before call the method or we will get the error: Could not execute the method because the containing type 'System.Runtime.CompilerServices.AsyncTaskMethodBuilder1[T_REF]’, is not fully instantiated.
Fixes mono/mono#17549
Fixes mono/mono#17569
Commit migrated from https://github.com/mono/mono/commit/
dd18ec40dd60e9cde7732436f843942cb51605af
imhameed [Wed, 13 Nov 2019 00:35:44 +0000 (01:35 +0100)]
[llvm] Use explicit null checks with LLVM. (mono/mono#16954)
* [llvm] Use explicit null checks with LLVM.
When the LLVM backend is used for a method, explicit null checks will
unconditionally be used at the mini IR level. We had previously used
implicit null checks at the mini IR level combined with llvm-volatile
loads and stores to avoid mis-optimization of the generated code.
During AOT compilation, LLVM's `ImplicitNullChecks` pass is enabled.
This conservatively elides these explicit null checks. This pass only
modifies branches tagged with `make.implicit` metadata.
Null check branches are now tagged with `make.implicit` metadata, with
three exceptions:
1. For platforms with backends that do not support zero page fault
handling, null check branches are not tagged with `make.implicit`.
2. This commit also adds a `MONO_DEBUG` option:
`llvm-disable-implicit-null-checks`. When it is enabled, null check
branches are not tagged with `make.implicit`.
3. This commit alters the behavior of the `explicit-null-checks`
`MONO_DEBUG` option. Enabling `explicit-null-checks` also implies
`llvm-disable-implicit-null-checks`, because this option is documented
(e.g. in https://www.mono-project.com/docs/debug+profile/debug/) to
completely disable signal/seh-based null checks.
* Add llvm-disable-implicit-null-checks to the MONO_DEBUG help string.
* Add llvm-disable-implicit-null-checks to mono.1.
* Don't tag null checks in EH regions with `make.implicit`.
This relocates the logic formerly used to guard individual LLVM-level
loads and stores with explicit null checks inside EH regions.
* Use atomic/volatile loads and stores for the terimation flag in thread-suspend-suspended.
LLVM was hoisting the load of and branch against `finished` out of
thread t1's loop, resulting in an infinite spin.
* Use ImplicitNullChecks with LLVM JIT.
* Suppress emission of the .llvm_faultmaps section.
Bump external/llvm to release_60
(mono/mono@
7a8dc89adbe7e123220e070a527e096ee91e66d5).
* [ci] use LLVM built from repository
Commit migrated from https://github.com/mono/mono/commit/
fe0f824db5fa1f3021aad6dc4a6eb428133d8a4e
Zoltan Varga [Wed, 13 Nov 2019 00:30:09 +0000 (01:30 +0100)]
[wasm] Change netcore support to use a prebuilt corefx runtime. (mono/mono#17773)
* [wasm] Change netcore support to use a prebuilt corefx runtime.
* [wasm] Build and test netcore support on CI.
* [wasm] Disable netcore tests on CI for now.
* [wasm] Add an error check.
* [wasm] Add a linker exclusion.
* [wasm] Add netcore runtimes to the nupkg.
Commit migrated from https://github.com/mono/mono/commit/
eaf895f2d0ec8c6056ed6b4777579d2e08a8444d
Filip Navara [Tue, 12 Nov 2019 17:46:00 +0000 (18:46 +0100)]
Mirror changes from mono/corefx,coreclr (mono/mono#17777)
* Rewrite the rest of the array non-generic fast paths in C# (mono/mono#27703)
* Rewrite the rest of the array non-generic fast paths in C#
* Add missing resource string
* Use CorElementType and handle native ints to match the unmanaged implementation
* Avoid try pattern for Sort and Reverse
* Match the native implementation more closely
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Rewrite Enum.CompareTo in C# (dotnet/coreclrmono/mono#27792)
* Rewrite Enum.CompareTo in C#
* Handle floating point too for match the existing native implementation
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove unused argument from GetRegionDisplayName (dotnet/coreclrmono/mono#27806)
* Remove unused argument from GetRegionDisplayName
* Address race conditions in CultureData
While most of the race conditions in this file are benign, in these cases, a thread could end up returning an intermediate value due to multiple potential writes to the same field.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Fix StyleCop rule SA1129 ("Do not use default value type constructor") (mono/mono#27716)
Will enable the rule in corefx once these changes have propagated.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
* Remove non-shared Enum.CompareTo/InternalCompareTo implementation, add new Array icalls used by shared code
Commit migrated from https://github.com/mono/mono/commit/
bd278dd00dd24b3e8c735a4220afa6cb3ba317ee
Jo Shields [Tue, 12 Nov 2019 08:31:08 +0000 (09:31 +0100)]
Move zlib to its own directory, and re-enable subdir-objects
This has the following benefits:
* Clearer structure for mirroring
* Slight build time improvement on bundled zlib use (as it only builds once)
* Removes pages of subdir-objects spew from autogen
Commit migrated from https://github.com/mono/mono/commit/
8bceb40878f3ff21cf3e521d0fe987a8fd6f1326
Jo Shields [Mon, 11 Nov 2019 16:42:51 +0000 (17:42 +0100)]
Delete some LLVM test cases from `make dist` (mono/mono#17772)
Many of the tests from the llvm-project monorepo cause problems to `make dist`
Commit migrated from https://github.com/mono/mono/commit/
c256fc86b6c011bcce691dd6f9415660c58306c5
Alexis Christoforides [Mon, 11 Nov 2019 12:03:03 +0000 (13:03 +0100)]
[netcore] Complete Monitor.LockContentionCount implementation (mono/mono#17719)
* [netcore] Complete Monitor.LockContentionCount implementation
Fixes https://github.com/mono/mono/pull/16538
Commit migrated from https://github.com/mono/mono/commit/
722c6f7dd59d235c2403c110869b74d8e63ac07d
Marek Safar [Sat, 9 Nov 2019 17:37:10 +0000 (18:37 +0100)]
Fixes build
Commit migrated from https://github.com/mono/mono/commit/
d90030d2738dfc21dafa8de30d51b28bc83de0c3
Alexander Köplinger [Fri, 8 Nov 2019 23:33:00 +0000 (00:33 +0100)]
[netcore] Fix RuntimePropertyInfo.GetValue() in FullAOT scenarios (mono/mono#17757)
It tried to use dynamic codegen which is not available in FullAOT.
We can use the `RuntimeFeature.IsDynamicCodeSupported` to check for this, added a JIT intrinsic which returns false in FullAOT.
Used a linker friendly way to check for TypeBuilder by adding an `internal virtual IsTypeBuilder` method in the `Type` class which returns false, and overwrote it in `TypeBuilder`.
Commit migrated from https://github.com/mono/mono/commit/
ed2d5f69e0cf04242ac29dae851bf8ec38f2b651
Zoltan Varga [Fri, 8 Nov 2019 19:43:32 +0000 (14:43 -0500)]
[wasm] Bump emscripten. (mono/mono#17748)
* [wasm] Bump emscipten to 1.39.2.
* Disable some code in libtest.c which causes emscripten to fail.
* [wasm] Source emscripten env before make install as well.
Commit migrated from https://github.com/mono/mono/commit/
73b50890cc1fd2cb8ea4b7c209c03bfbd491359b
Nathan Ricci [Fri, 8 Nov 2019 18:58:37 +0000 (13:58 -0500)]
Implement GC.GetGCMemoryInfo (mono/mono#17607)
Implement the GC.GetGCMemoryInfo API.
Commit migrated from https://github.com/mono/mono/commit/
5b0a822afb97375ba90e0a6bcab53b4b4755b2c1
Ryan Lucia [Fri, 8 Nov 2019 18:42:56 +0000 (13:42 -0500)]
[loader] Unmanaged library refactoring and NativeLibrary implementation (mono/mono#17369)
Commit migrated from https://github.com/mono/mono/commit/
d5b6cf33b3d2a89189be4e6bddcf0207e9887ecd
Ryan Lucia [Fri, 8 Nov 2019 18:14:06 +0000 (13:14 -0500)]
[netcore] Run individual CoreCLR test suites (mono/mono#17753)
This is implemented in a lazy way for convenience when manually testing until the tests are wired up to xunit
Commit migrated from https://github.com/mono/mono/commit/
68d142912d8a949c1874629391fb7d7b87fccd92
Alexis Christoforides [Fri, 8 Nov 2019 16:40:04 +0000 (11:40 -0500)]
[merp] Remove extraneous waitpid invocation (mono/mono#17723)
The extraneous call basically guarantees that the call right after will fail. Fixes merp stating that its process has failed when it hasn't.
Commit migrated from https://github.com/mono/mono/commit/
23f2baa71ed905e3298c10189adec8134bc6ed7c
Jo Shields [Fri, 8 Nov 2019 15:42:20 +0000 (10:42 -0500)]
Merge pull request mono/mono#17749 from directhex/dotnet-llvm-monorepo
[LLVM] Change llvm submodule to dotnet-org fork of official LLVM git repo
Commit migrated from https://github.com/mono/mono/commit/
3948a065af512e9ac6298a68e98035b5ac1f4d3c
lateralusX [Fri, 8 Nov 2019 08:39:07 +0000 (09:39 +0100)]
Fix Windows LLVM build using new repository structure.
Commit migrated from https://github.com/mono/mono/commit/
fad91a1c1e09df85040f8772d91eb6a5369303b4
Zoltan Varga [Thu, 7 Nov 2019 23:18:12 +0000 (18:18 -0500)]
[aot] Improve the aot mangler a bit, handle bool/char as a primitive type and avoid emitting a System prefix. (mono/mono#17739)
Commit migrated from https://github.com/mono/mono/commit/
c0a9d6bf7622cebacd1c1d56a56db9b0a5edab20
Ryan Lucia [Thu, 7 Nov 2019 20:02:23 +0000 (15:02 -0500)]
[netcore] Propagate ALCs through reflection functions (mono/mono#16949)
* [reflection] Pass assembly load context through mono_reflection_get_type_with_rootimage
The entry points are mono_reflection_type_from_name_checked and
mono_reflection_get_type_checked which for now pass in an ambient ALC, but
should be updated to take an ALC argument.
Internally mono_reflection_get_type_with_rootimage is recursive through a half
dozen helper functions which all get an ALC argument too.
The principle place where the ALC is used is in
_mono_reflection_get_type_from_info which passes it to
mono_assembly_loaded_internal and to replace the call to mono_assembly_load by
a direct call to mono_assembly_request_byname with an explicit ALC set in the
request.
* Mark mono_assembly_load as external only
* Pass an alc through non-static reflection functions
* Fix usage in wasm debugger
* Relax assertions due to wasm
Commit migrated from https://github.com/mono/mono/commit/
2c22d0de2edb09cfb008e587c40ee525fbe3749c
Jo Shields [Thu, 7 Nov 2019 16:58:32 +0000 (11:58 -0500)]
[llvm] redirect from mono llvm-mirror fork to dotnet llvm-project fork
Commit migrated from https://github.com/mono/mono/commit/
b61263e994a326e3b3d302bca0194f73f0b6534e
Aleksey Kliger (λgeek) [Thu, 7 Nov 2019 16:42:52 +0000 (11:42 -0500)]
[profiler] Fix log profiling of native to managed wrappers (mono/mono#17740)
* [profiler] Add test case for pinvokes and reverse pinvokes
* [profiler] Fix crash in native to managed wrappers
When we call back to managed from a pinvoke, we're in GC Safe mode and the
profiler instrumentation is inserted in the wrapper before it does the
transition to GC Unsafe. So we need an extra transition before the profiler
calls its locking functions
Fixes https://github.com/mono/mono/issues/17687
* [coop] Mark internal GC Unsafe functions with MONO_PROFILER_API
Allow the profiler to transition to GC Unsafe mode
* [profiler] ptestrunner.pl fix profiler modules directory
we used to specify mono/mini/.libs but that's not where the profiler plugins live, they're in mono/profiler/.libs. We probably picked up the profiler plugins from the system Mono install.
Commit migrated from https://github.com/mono/mono/commit/
2c56ac54c05b2fca5daa3629c337001c35fae40b
Thays Grazia [Thu, 7 Nov 2019 14:22:25 +0000 (11:22 -0300)]
[embed] Assert when call mono_runtime_object_init (mono/mono#17589)
* Fix assert when calling externally call mono_runtime_object_init, mono_object_get_domain, mono_string_to_utf8
* Adding samples/embed as unit-test
Commit migrated from https://github.com/mono/mono/commit/
4bdacea237f2ae7ed444e0336dad503d9a0535ac
Jay Krell [Thu, 7 Nov 2019 06:36:07 +0000 (22:36 -0800)]
Remove handles from ves_icall_System_Array_InternalCreate. (mono/mono#17681)
Remove handles from ves_icall_System_Array_InternalCreate.
Also combine two allocas.
Commit migrated from https://github.com/mono/mono/commit/
7b4b5e72d9ff818e64df21c4b82c9c5b0a01fdee
Zoltan Varga [Thu, 7 Nov 2019 00:50:59 +0000 (19:50 -0500)]
[runtime] Fix locking in mono_get_seq_points (). (mono/mono#17738)
Fixes https://github.com/mono/mono/issues/17737.
Commit migrated from https://github.com/mono/mono/commit/
0680073b878a9bbbda61be19b9c360f80a6ca156
Johan Lorensson [Wed, 6 Nov 2019 15:51:31 +0000 (16:51 +0100)]
Switch away from Start-Process, Wait-Process in build.ps1. (mono/mono#17730)
Running Start-Process, Wait-Process on msbuild.exe have showed a couple
of hangs in the build script. This is most likely due to msbuild.exe
spawned child processes (like compile servers) running longer than
spawned msbuild.exe process. Since there is no specific requirements
when spawning the process from build.ps1, switch to regular process
exec and LastExitCode.
Commit migrated from https://github.com/mono/mono/commit/
bda239f44ca8068c3a6d6cbcb10704c2387ad2f2
Johan Lorensson [Wed, 6 Nov 2019 15:51:14 +0000 (16:51 +0100)]
Explicit update/init only LLVM BTLS repro on external MSVC build. (mono/mono#17691)
Reduce the scope of git submodule update --init to only LLVM and/or BTLS
repositories when building external MSVC dependencies.
Commit migrated from https://github.com/mono/mono/commit/
1a6c092019877dacd33d57c104ac4cdf8933fd9b
Marek Safar [Wed, 6 Nov 2019 08:29:04 +0000 (09:29 +0100)]
[System.Private.CoreLib] Remove unused Array methods
Commit migrated from https://github.com/mono/mono/commit/
965beadc1e8d1ade051726db17f819451fc0dff9
Jay Krell [Wed, 6 Nov 2019 02:56:10 +0000 (18:56 -0800)]
Handles reduction -- 4 MERP functions. (mono/mono#17711)
Handles reduction -- 4 MERP functions.
Commit migrated from https://github.com/mono/mono/commit/
1e8e3578310f5183ba692c125bfd85d596335ee0
Jay Krell [Tue, 5 Nov 2019 21:38:40 +0000 (13:38 -0800)]
error_init reduction. (mono/mono#17712)
Commit migrated from https://github.com/mono/mono/commit/
aa506ca1bb56251f8791cf7de2dba6c8f87f24b8
Ryan Lucia [Tue, 5 Nov 2019 19:35:00 +0000 (14:35 -0500)]
[loader] Skip the full pinvoke resolution process for __Internal (mono/mono#17701)
Commit migrated from https://github.com/mono/mono/commit/
f477bce54866af7ef417057f141be5e08d0b920e
Bernhard Urban-Forster [Tue, 5 Nov 2019 18:09:32 +0000 (19:09 +0100)]
[mini] Fix Coverity CID 1455161 & 1455162 (mono/mono#17615)
* [mini] Fix Coverity CID 1455161 & 1455162
> Null-checking "ji" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
* do not rely on assert to guard ji-nullness. refactor a bit
Commit migrated from https://github.com/mono/mono/commit/
93b97d5582cf89d20f2deff9f6232402c30ce3bc
Johan Lorensson [Tue, 5 Nov 2019 12:16:32 +0000 (13:16 +0100)]
Fix MSVC intellisense for LLVM sources. (mono/mono#17706)
Commit migrated from https://github.com/mono/mono/commit/
6f73c2dab8b19237800f9150fac6368d15220f5b
Johan Lorensson [Tue, 5 Nov 2019 06:57:06 +0000 (07:57 +0100)]
Fix correct accumulated time for parallelized jobs in SGEN. (mono/mono#17518)
* Fix correct accumulated time for parallelized jobs in SGEN.
Current implementation incorrectly accumulate time for scan jobs for
the follow metrics when running parallel minor GC:
time_minor_scan_major_blocks,
time_minor_scan_los,
time_major_scan_mod_union_blocks,
time_major_scan_mod_union_los
Commit fix so updates are atomic making sure values are correct in cases
where parallel minor GC is used.
* Implement 64-bit atommic add fallback in SGEN.
Commit migrated from https://github.com/mono/mono/commit/
44e6226c31d8ffcae58f81350d71a728edecfe22
Nikolay Sivov [Tue, 5 Nov 2019 06:56:44 +0000 (09:56 +0300)]
[mono] Fix ProcessExit handler argument. (mono/mono#17680)
Problem was spotted with mono tracing hitting ProcessExit handler,
and crashing on first argument.
Commit migrated from https://github.com/mono/mono/commit/
95743afa802ef737ec815506be6667e5379e7c19
Egor Bogatov [Tue, 5 Nov 2019 06:50:37 +0000 (09:50 +0300)]
[netcore] Intrinsify Buffer.IsPrimitiveTypeArray (mono/mono#17438)
* Improve IsPrimitive intrinsic
* Implement it for interpreter
* clean up
* clean up
Commit migrated from https://github.com/mono/mono/commit/
fdc6495a549fbd3a4b222b888a7a72ba7b65330c
Vlad Brezae [Mon, 4 Nov 2019 17:58:38 +0000 (19:58 +0200)]
[interp] Use GetType instrinsic also on net4x (mono/mono#17654)
We didn't do this because it had some issues when GetType was invoked through reflection. This issue would also be present with jit but, because jit doesn't use direct wrappers, the GetType call can't be intrinsified in that scenario. See https://github.com/mono/mono/pull/5350 for the context of the issue.
Commit migrated from https://github.com/mono/mono/commit/
b3b9960ed13a2f8e199bf4c32f9de92e9abf2f4b
Egor Bogatov [Mon, 4 Nov 2019 17:48:04 +0000 (20:48 +0300)]
[netcore] Copy Array.Clear impl from CoreCLR (mono/mono#17411)
* Address feedback
* fix build error
* Fix has_reference usage in object.c
* Fix fallback impl
* Rename to ArrayHasReferences
* Rename to ObjectHasReferences
* Rollback to ArrayHasReferences
* Rename to ObjectHasReference
* remove redundant is_array variable
* ObjectHasReferences can accept any object
* undo changes in Program.cs
* undo changes in Program.cs
Commit migrated from https://github.com/mono/mono/commit/
cf8495e2f73a56770d5a9d876ab865485b4f353b
Filip Navara [Mon, 4 Nov 2019 17:40:13 +0000 (18:40 +0100)]
Intrinsify Activator.CreateInstance<T> for value types with no ctor (mono/mono#17688)
* Intrinsify Activator.CreateInstance<T> for value types with no ctor
* Fix failed test, address feedback
Commit migrated from https://github.com/mono/mono/commit/
07fa0bd3b40d4831800e1da6f68556d690884119
Zoltan Varga [Mon, 4 Nov 2019 17:14:59 +0000 (12:14 -0500)]
[jit] Allow Unsafe.As<TFrom, TTo> on gsharedvt types. (mono/mono#17692)
Commit migrated from https://github.com/mono/mono/commit/
929a8a7fd836cc4d6d746c30d4ef1c5b73aed248
Bernhard Urban-Forster [Mon, 4 Nov 2019 14:56:46 +0000 (15:56 +0100)]
[interp] use mask instead of bool expression (mono/mono#17683)
Discovered by Coverity:
```
>>> CID 1455205: (CONSTANT_EXPRESSION_RESULT)
>>> The expression "flag && 2" is suspicious because it performs a
Boolean operation on a constant other than 0 or 1.
```
Commit migrated from https://github.com/mono/mono/commit/
237f210ea24cbc201b8746fb0003cf7bec8b97b0
Johan Lorensson [Mon, 4 Nov 2019 07:55:36 +0000 (08:55 +0100)]
Mono NetCore Windows only build/test. (mono/mono#17646)
Support for Windows Mono NetCore build/test wihtout any need for
cygwin/wsl/automake just MSBuild and MSVC. Windows build support mirror
technologies used by coreclr/aracade builds msbuild + powershell.
Windows only Mono NetCore build, makes a port of existing build.sh and
Makefile, implementing a build.ps1 and build.targets. So far full build
support + execution of corefx test suite is implemented. Other make file
rules can be added when needed.
MSVC build runtime seems to hits a couple of additional test failures
in corefx test suite that needs to be investigated further.
Building NetCore Mono on Windows can now be done without cygwin or wsl.
Build depends on regular VS install (or build tools), if xunit summary
is requested, python needs to be installed.
Commit migrated from https://github.com/mono/mono/commit/
c0e237b7340a58384e191f7bdc6d954b9585330b
Egor Bogatov [Mon, 4 Nov 2019 03:39:19 +0000 (06:39 +0300)]
[netcore] Improve Array.CreateInstance (mono/mono#17673)
* Rewrite Array.CreateInstance
* Rewrite Array.CreateInstance
* Address feedback
* Convert the icall to NOHANDLES
* fix build errors, remove NOHANDLES
* Fix GC.KeepAlive usage
* Remove icall definition for GC.KeepAlive (it's no an icall)
* Fix failing tests (expect details in the AOORE)
Commit migrated from https://github.com/mono/mono/commit/
137ffe8b7c18d8a153f9311a8b30b53139ee2073
Filip Navara [Sun, 3 Nov 2019 17:28:32 +0000 (18:28 +0100)]
[netcore] Improve default constructor lookup, (mono/mono#17666)
* [netcore] Improve default constructor lookup, cache when no default constructor is found (common for struct)
* Address PR feedback
Commit migrated from https://github.com/mono/mono/commit/
8131518bb12a059ffc71fa6c6030b103b5c6d35b
Alexander Köplinger [Sun, 3 Nov 2019 11:27:43 +0000 (12:27 +0100)]
[netcore] Disable shared compilation for System.Private.CoreLib
There's a dotnet process hanging around which seems to lock the build when called from the SDKs Makefiles.
Commit migrated from https://github.com/mono/mono/commit/
4888c49c26aa7b3239bebb2048e77ae33c800567
Alexander Köplinger [Sat, 2 Nov 2019 23:40:29 +0000 (00:40 +0100)]
[netcore] Fix strong name key for System.Private.CoreLib
It's using the silverlight key: https://github.com/dotnet/coreclr/blob/mono/mono@
34fe045a27e150bde7ee54e0d5f0df635922519d/src/System.Private.CoreLib/System.Private.CoreLib.csproj#L112
Commit migrated from https://github.com/mono/mono/commit/
40c1cd357646dc8406b74f3888f8f6a4c10cfb7b
Alexander Köplinger [Fri, 25 Oct 2019 23:17:01 +0000 (01:17 +0200)]
[netcore] Fix out of tree build for netcore/ folder
Commit migrated from https://github.com/mono/mono/commit/
d89b96a298ef75ef8bcd94bae122fba3a042277a
Bernhard Urban-Forster [Sat, 2 Nov 2019 15:45:36 +0000 (16:45 +0100)]
[interp] s/MONO_API_ERROR_INIT/error_init_reuse/g (mono/mono#17650)
[interp] s/MONO_API_ERROR_INIT/error_init_reuse/g
Commit migrated from https://github.com/mono/mono/commit/
62ee01b36bbc2fbef85ffd456f71eabd2a254c2a
Zoltan Varga [Sat, 2 Nov 2019 07:57:25 +0000 (03:57 -0400)]
[jit] Call mono_class_setup_fields () before accessing field->offset. (mono/mono#17667)
Fixes https://github.com/mono/mono/issues/17665.
Commit migrated from https://github.com/mono/mono/commit/
803c657b24b9110fe69a6df460807dfb1b7e72a1
Jay Krell [Fri, 1 Nov 2019 21:36:06 +0000 (14:36 -0700)]
Move MonoError from managed wrappers to native wrappers. (mono/mono#15894)
Move MonoError from managed wrappers to native wrappers.
Move MonoError from managed wrappers (ilgen) to native wrappers (C preprocessor).
Alternative to https://github.com/mono/mono/pull/15869.
Which says: Previously, we would emit a call to memset
since the struct is large (> 100 bytes). Only the error code
field needs to be initialized.
Which that PR and this PR both fix, in different ways.
In the past:
- This did not work due to a possible dependency on precise GC,
interacting with what gets zeroed or not here.
That is why I put it on the managed side.
We'll see if that reproduces.
(https://github.com/mono/mono/pull/11294/files#diff-efe0070415f3f0c0f24ed0221aa1962aR339
external/coreclr/tests/src/CoreMangLib/cti/system/weakreference/weakreferenceisaliveb.exe.)
- Some indication that embedding API should expose MonoError
and not set_pending_exception. This does not seem relevant
presently, and the code seems better structured and
more efficient this way. It can revisited if/when new public API
is the dominant concern, or do it this way for these functions,
and another way for actual public functions.
(https://github.com/mono/mono/pull/11294#issuecomment-
432443485)
Commit migrated from https://github.com/mono/mono/commit/
4b9dc08ac19cfc3c451bba2fa7fefc7e31fc1ecc
Zoltan Varga [Fri, 1 Nov 2019 16:52:45 +0000 (12:52 -0400)]
[netcore] Cleanups. (mono/mono#17661)
* [netcore] Remove the type_info field from RuntimeType, extend the TypeCache structure instead.
* [netcore] Remove some linker exclusions which are not needed.
Commit migrated from https://github.com/mono/mono/commit/
e9d68e9485611d47c3ad17f3b4d178089e68cab0
Jo Shields [Fri, 1 Nov 2019 14:26:08 +0000 (10:26 -0400)]
[System.Net.Http]: Bring `HttpClient` from CoreFX on monotouch and xammac. (mono/mono#17628)
Commit migrated from https://github.com/mono/mono/commit/
16d1a2e6f124ca80875870841b0ce1a7c605673e
Vlad Brezae [Fri, 1 Nov 2019 12:55:58 +0000 (14:55 +0200)]
[interp] Handle remoting field access same as jit (mono/mono#17641)
Doing this we avoid using slow ldrmfld in the common case of loading fields from instance methods, when we execute on the real object. We could do this also for strmfld but we need to track on the stack if the instance object is this, which is not worth the trouble.
Commit migrated from https://github.com/mono/mono/commit/
166fdf60b0eecb66e36ea744a75366fec9f92170
Vlad Brezae [Fri, 1 Nov 2019 12:55:27 +0000 (14:55 +0200)]
[interp] Optimize call path (mono/mono#17623)
* [interp] Optimize void calls
By avoiding setting of retval
* [interp] Avoid computing param count for every call
* [interp] Remove wrong profiler check
From the times when interp had its own EH mechanism. We raise this event from mono_handle_exception_internal for interp.
* [interp] Remove profiling check code from method exit
We emit MINT_PROF_EXIT opcode when under profiler. Unify profiling enter/exit with tracing enter/exit since they are very similar.
Commit migrated from https://github.com/mono/mono/commit/
170d33c35b76933c1d726922a7c40a9af5a6017d
Filip Navara [Fri, 1 Nov 2019 12:30:41 +0000 (13:30 +0100)]
Lower min/max SSE operations on x64 (mono/mono#17536)
Follow up on mono/mono#17511.
Commit migrated from https://github.com/mono/mono/commit/
8aa3654de586bf87ce69608eac71675eeef74a45
Zoltan Varga [Fri, 1 Nov 2019 07:43:42 +0000 (03:43 -0400)]
[llvm] Fix a case where we treated the dreg of a store_membase instruction as a dreg, its actually the base reg. (mono/mono#17648)
Commit migrated from https://github.com/mono/mono/commit/
dc8d55d4462216db4c3cb5f9eb3167fc6b746575
Vlad Brezae [Thu, 31 Oct 2019 15:49:16 +0000 (17:49 +0200)]
[interp] Avoid emitting MINT_SAFEPOINT for every single call (mono/mono#17625)
Commit migrated from https://github.com/mono/mono/commit/
b484979aa9741673c2f820bdac7f5c925128ad9d
Jonathan Chambers [Thu, 31 Oct 2019 14:13:01 +0000 (10:13 -0400)]
Avoid caching of System.dll image and types as they may be unloaded with appdomain. (mono/mono#17602)
Commit migrated from https://github.com/mono/mono/commit/
3648cb087b0b49c05300789a1bf5724d942ca174
Alexander Köplinger [Thu, 31 Oct 2019 12:37:55 +0000 (13:37 +0100)]
Fix build
Commit migrated from https://github.com/mono/mono/commit/
ca72deed17918505422a6b0ca67201fcf7021af0
Vlad Brezae [Thu, 31 Oct 2019 13:32:50 +0000 (15:32 +0200)]
[interp] Fix interp logging (mono/mono#17636)
* [interp] Don't print NOPs during cprop
They can become numerous and distracting.
* [interp] Fix mono_interp_print_code
Regressed after code_size was changed to byte count instead of short count.
Commit migrated from https://github.com/mono/mono/commit/
1d043a31e7d207739f81b303b7ee2c79ed135859
Zoltan Varga [Thu, 31 Oct 2019 05:33:50 +0000 (01:33 -0400)]
[runtime] Add a --enable-minimal=threads configure option to disable threading support. Use it on wasm. (mono/mono#17611)
Commit migrated from https://github.com/mono/mono/commit/
dc76a95aa9d266c0c9611408b00e63dfeca214b5
Zoltan Varga [Wed, 30 Oct 2019 20:07:44 +0000 (16:07 -0400)]
[eglib] Assert in g_strlcpy () if src/dest is NULL, instead of printing a warning. (mono/mono#17507)
Related to https://github.com/mono/mono/issues/17283.
Commit migrated from https://github.com/mono/mono/commit/
5811404e55e7b61f747ea93226d506e2e3fc3210
Jo Shields [Wed, 30 Oct 2019 19:09:06 +0000 (15:09 -0400)]
Rearrange System.Private.CoreLib for easier monorepo integration (mono/mono#17517)
* [netcore] Move corlib around to match CoreCLR directory layout better
This is a prerequisite to making a sane migration of this whole
directory from mono.git to coreclr.git
Commit migrated from https://github.com/mono/mono/commit/
27921fbbd06baadeb5fa07049c587e2a214d131f
Thays Grazia [Wed, 30 Oct 2019 17:47:15 +0000 (14:47 -0300)]
[dim][regression] Explicit interface override (mono/mono#17583)
* Precedence order:
-> Override interface method in class
-> Method in class
-> DIM
Commit migrated from https://github.com/mono/mono/commit/
fffb1201bdd14e18e19a3c61d0afe25a91a2d501
Bernhard Urban-Forster [Wed, 30 Oct 2019 15:36:04 +0000 (16:36 +0100)]
[interp] fix signature mismatch between jit<>interp for string constructor (mono/mono#17595)
[interp] fix signature mismatch between jit<>interp for string constructor
Commit migrated from https://github.com/mono/mono/commit/
95cad2452622dcc7197bbc312d6b397172b4a313
Marek Safar [Wed, 30 Oct 2019 07:03:41 +0000 (08:03 +0100)]
[System.Private.CoreLib] Remove NativeRuntimeEventSource
Commit migrated from https://github.com/mono/mono/commit/
e4c0b50dec5f90cdd369a842d577bab37ba059fb
Jay Krell [Wed, 30 Oct 2019 15:06:24 +0000 (08:06 -0700)]
Inline TLS access. (mono/mono#17119)
Inline TLS access.
This attempt differs from the previous in that the TLS accessor functions are presented to far less code, i.e. not to main.c, so their data references do not need to be resolved so much.
See https://github.com/mono/mono/commit/mono/mono@
bffd4c6b99213a0b154d7efac9b0581df67775e8 etc.
Commit migrated from https://github.com/mono/mono/commit/
10ac2750e2b29c812e553778aa854e8653e0dadb
Zoltan Varga [Wed, 30 Oct 2019 14:08:50 +0000 (10:08 -0400)]
Remove some unused icalls. (mono/mono#17612)
Commit migrated from https://github.com/mono/mono/commit/
79f5e6c288a542aa67a7626c0e6b7e873b6ba78d
Filip Navara [Wed, 30 Oct 2019 13:39:47 +0000 (14:39 +0100)]
[netcore] Report errors on Windows CI (mono/mono#17616)
* [netcore] Report errors on Windows CI
* Fix Windows build
Commit migrated from https://github.com/mono/mono/commit/
3d397805d4bb5764bc2e8e0da3c83d47c4b1f569
Zoltan Varga [Wed, 30 Oct 2019 04:04:15 +0000 (00:04 -0400)]
[wasm] Print a useful error message instead of a signature mismatch error on missing icalls. (mono/mono#17600)
Commit migrated from https://github.com/mono/mono/commit/
2823ac5d95bd9558de0b164271968ac3cb2d6c58
Zoltan Varga [Wed, 30 Oct 2019 04:03:08 +0000 (00:03 -0400)]
[wasm] Fix build problems. (mono/mono#17596)
* [runtime] Add a stub for MacOsIPInterfaceProperties::ParseRouteInfo icall on non-osx platforms to fix the wasm aot build.
* [wasm] Avoid generating invalid ninja build files if an assembly is specified on the command line and its also an implicit reference.
* Put back and ifdef.
* Fix the windows build.
Commit migrated from https://github.com/mono/mono/commit/
9adce0b6321e4bcc7ca40074b7d1293d3f0e8eb2
Filip Navara [Tue, 29 Oct 2019 20:55:55 +0000 (21:55 +0100)]
Temporary build fix
Commit migrated from https://github.com/mono/mono/commit/
d49d3efd5d7832e8c599a1a34431b5c68650639a
Bernhard Urban-Forster [Tue, 29 Oct 2019 21:36:01 +0000 (22:36 +0100)]
[mini] Initial tiered compilation work (mono/mono#17551)
[mini] Initial tiered compilation work
Enable it with `./autogen.sh --enable-experiment=tiered`.
Let's consider `Simple.cs`:
```csharp
using System.Runtime.CompilerServices;
using System;
public class Simple {
public static void Main (string []args) {
HotMethod ();
Console.WriteLine ("cnt: " + cnt);
HotMethod ();
Console.WriteLine ("cnt: " + cnt);
}
static int cnt = 0;
[MethodImplAttribute (MethodImplOptions.NoInlining)]
public static void HotMethod () {
for (int i = 0; i <= 1000; i++)
cnt += i;
}
}
```
```console
$ csc Simple.cs
$ MONO_LOG_LEVEL=debug MONO_LOG_MASK=tiered ./mono/mini/mono-sgen --trace=M:Simple:HotMethod --interp=-all Simple.exe
[0x10ec275c0: 0.00000 0] ENTER:i Simple:HotMethod ()()
Mono: tiered: queued Simple:HotMethod ()
[0x10ec275c0: 0.00010 0] LEAVE:i Simple:HotMethod ()(
Mono: tiered: patching 0x7fe855803224 with patch_kind=INTERP @ tier_level=0
Mono: -> caller= Simple:Main (string[]) [{0x7fe85420df88} + 0x34 interp] (0x7fe8558031f0 0x7fe855803258) [0x7fe85420c880 - Simple.exe]
Mono: -> callee=Simple:HotMethod ()
Mono: tiered: patching 0x7fe8558031f2 with patch_kind=INTERP @ tier_level=0
Mono: -> caller= Simple:Main (string[]) [{0x7fe85420df88} + 0x2 interp] (0x7fe8558031f0 0x7fe855803258) [0x7fe85420c880 - Simple.exe]
Mono: -> callee=Simple:HotMethod ()
cnt: 500500
[0x10ec275c0: 0.04093 0] ENTER:c Simple:HotMethod ()()
[0x10ec275c0: 0.04095 0] LEAVE:c Simple:HotMethod ()(
cnt: 1001000
```
Note the suffix after `ENTER:`
* `i` indicates it's executed by the interpreter
* `c` indicates it's a compiled method (JIT)
Another example:
```console
$ make -C mono/mini gshared.exe
$ ./mono/mini/mono-sgen --interp=-all --stats ./mono/mini/gshared.exe
Regression tests: 84 ran, 0 failed in Tests
[...]
Tiered statistics
Methods promoted : 68
```
It's a basic proof-of-concept for now. An incomplete list of future work items:
* Right now it only works for direct calls, need to expand it to virtual/interface calls.
* Calls of the JIT leading into the interpreter again can't be patched yet.
* Kind of related, no concept of versioning compiled methods does exist yet. The interpreter maintains its own table of "transformed" methods, however, when doing the transition from JIT->interpreter, the wrapper+interpmethod will end up in the JIT table. We need a way to have multiple JIT compilation results for the same MonoMethod exist.
* Investigate actual performance. We might have to optimize the interp<>JIT transition.
* Patching is racy. Need to make that atomic.
* All the FIXMEs in this PR
<!--
Thank you for your Pull Request!
If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.
Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
Commit migrated from https://github.com/mono/mono/commit/
d274cfbacdb2aeab0184662997882f3d78991e48