platform/upstream/dotnet/runtime.git
5 years agoMerge pull request mono/mono#13973 from directhex/netcore-pipeline
Jo Shields [Wed, 10 Apr 2019 16:44:50 +0000 (12:44 -0400)]
Merge pull request mono/mono#13973 from directhex/netcore-pipeline

[netcore] Add a Pipeline yaml for Core build

Commit migrated from https://github.com/mono/mono/commit/fd8598a994f72588bd0482920d772543f26ba1a1

5 years agoMerge pull request mono/mono#13961 from directhex/makedist_again
Jo Shields [Wed, 10 Apr 2019 16:08:11 +0000 (12:08 -0400)]
Merge pull request mono/mono#13961 from directhex/makedist_again

[netcore] Fix `make dist`

Commit migrated from https://github.com/mono/mono/commit/08a8880dddbed33538030a8e71e53502889ef361

5 years agoMake nullable embedding API's public. (mono/mono#13950)
Johan Lorensson [Wed, 10 Apr 2019 15:29:00 +0000 (11:29 -0400)]
Make nullable embedding API's public. (mono/mono#13950)

Currently we have two nullable API's that will have value in the public
embedding API (already requestsed by users), eliminating the needs to go
from native->managed and back to get nullable information about a type.

mono_class_is_nullable
mono_class_get_nullable_param

This PR moves them from class-internals.h into class.h and mark them
with MONO_API and when needed include GC UNSAFE/SAFE transition.

Commit migrated from https://github.com/mono/mono/commit/b016a0a9455db3b1eb41c28e2b3acbcd29a42275

5 years ago[configure] Add failsafe for missing submodules (mono/mono#13957)
Alexander Köplinger [Wed, 10 Apr 2019 13:26:28 +0000 (15:26 +0200)]
[configure] Add failsafe for missing submodules (mono/mono#13957)

GitHub provides a way to download a .zip/.tar.gz of the repository content in their UI, however the archive doesn't contain git submodules.

The mono build then fails with confusing "missing file" errors.

Since GitHub doesn't let us disable the archive download we should at least add some logic to detect this broken case and bail out.

Commit migrated from https://github.com/mono/mono/commit/e8caaa1dbd880767bcf07ccfa8b9f695377ddd8d

5 years ago[utils] stub mono_setmmapjit on Win32 and Wasm
Aleksey Kliger [Tue, 9 Apr 2019 15:54:38 +0000 (11:54 -0400)]
[utils] stub mono_setmmapjit on Win32 and Wasm

Commit migrated from https://github.com/mono/mono/commit/72c8776d8f0e7a257ee771eac735e4435eaef571

5 years agoDo not use MAP_JIT by default, instead make this something that is toggled by Xamarin...
Miguel de Icaza [Wed, 13 Mar 2019 17:38:29 +0000 (13:38 -0400)]
Do not use MAP_JIT by default, instead make this something that is toggled by Xamarin.Mac which needs it

Commit migrated from https://github.com/mono/mono/commit/bc4a1ac85a959ecdebfe155cde3ac3aa18d2e9f3

5 years ago[aot] use g_malloc () instead of malloc () (mono/mono#13953)
Bernhard Urban [Tue, 9 Apr 2019 20:25:53 +0000 (22:25 +0200)]
[aot] use g_malloc () instead of malloc () (mono/mono#13953)

[aot] use g_malloc () instead of malloc ()

Unbreaks jemalloc support as it hooks into `g_malloc ()` instead of replacing `malloc ()`.

```
%4  0x000055ee6af0d27b in sigabrt_signal_handler (_dummy=6, _info=0x7ffc7b0c4ff0, context=0x7ffc7b0c4ec0) at mini-posix.c:232
%5  <signal handler called>
%6  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
%7  0x00007f4ae0d73801 in __GI_abort () at abort.c:79
%8  0x000055ee6b2ab6ed in rtree_child_leaf_tryread (elm=0x55ee6b75b028 <je_extents_rtree+704104>, dependent=true) at src/rtree.c:205
%9  0x000055ee6b2ab95f in je_rtree_leaf_elm_lookup_hard (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, init_missing=false) at src/rtree.c:292
%10 0x000055ee6b242f70 in rtree_leaf_elm_lookup (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, init_missing=false) at include/jemalloc/internal/rtree.h:369
%11 0x000055ee6b242fb5 in rtree_read (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true) at include/jemalloc/internal/rtree.h:394
%12 0x000055ee6b2431ee in rtree_szind_slab_read (tsdn=0x7f4ae1f05738, rtree=0x55ee6b6af1c0 <je_extents_rtree>, rtree_ctx=0x7f4ae1f05758, key=94482510772944, dependent=true, r_szind=0x7ffc7b0c6000, r_slab=0x7ffc7b0c6004) at include/jemalloc/internal/rtree.h:446
%13 0x000055ee6b24d468 in ifree (tsd=0x7f4ae1f05738, ptr=0x55ee6c7dfad0, tcache=0x7f4ae1f058f0, slow_path=true) at src/jemalloc.c:2126
%14 0x000055ee6b24de06 in mono_jefree (ptr=0x55ee6c7dfad0) at src/jemalloc.c:2290
%15 0x000055ee6b2c6c68 in monoeg_g_free (ptr=0x55ee6c7dfad0) at gmem.c:83
%16 0x000055ee6adefafa in emit_method_code (acfg=0x7f4ae0986000, cfg=0x7f4ae0ad4e00) at aot-compiler.c:6243
%17 0x000055ee6adf9534 in emit_code (acfg=0x7f4ae0986000) at aot-compiler.c:9704
%18 0x000055ee6ae04a9d in emit_aot_image (acfg=0x7f4ae0986000) at aot-compiler.c:13535
%19 0x000055ee6ae03b7c in mono_compile_assembly (ass=0x7f4ae09a9300, opts=374434303, aot_options=0x7f4ae093c000 "bind-to-runtime-version,outfile=./../../class/lib/build-linux//Microsoft.CodeAnalysis.CSharp.dll.so", global_aot_state=0x7ffc7b0c6438) at aot-compiler.c:13357

```

Commit migrated from https://github.com/mono/mono/commit/de1fc96374c5fc4a97e8861cd5d76d92b1e0413f

5 years ago[netcore] Runtime nupkg fixes (mono/mono#13934)
Jo Shields [Tue, 9 Apr 2019 15:41:46 +0000 (11:41 -0400)]
[netcore] Runtime nupkg fixes (mono/mono#13934)

We can now build `--with-core=only` on Linux or Mac with the same makefile, and have a functional `make nupkg` rule which attempts to produce a .nupkg of the runtime in the format consumed by core-setup.

Commit migrated from https://github.com/mono/mono/commit/430307e24ba62668a54a77216f6a80b460067307

5 years agoMerge pull request mono/mono#13955 from directhex/more-loadedllvm-magic
Jo Shields [Tue, 9 Apr 2019 15:28:34 +0000 (11:28 -0400)]
Merge pull request mono/mono#13955 from directhex/more-loadedllvm-magic

Make sure mini_method_is_default_method is in loaded LLVM

Commit migrated from https://github.com/mono/mono/commit/6544999e86535ce353e2d5ab6e27c962b1b3bea7

5 years agoMake sure mini_method_is_default_method is in loaded LLVM
Jo Shields [Tue, 9 Apr 2019 14:53:53 +0000 (10:53 -0400)]
Make sure mini_method_is_default_method is in loaded LLVM

mono: symbol lookup error: /usr/lib/libmono-llvm.so: undefined symbol: mini_method_is_default_method

Commit migrated from https://github.com/mono/mono/commit/2c42f8d317455166f6da91c9e4d79781010ae6a1

5 years agoMerge pull request mono/mono#13928 from lateralusX/lateralusX/use-tls-key-lmf-add...
Johan Lorensson [Tue, 9 Apr 2019 09:26:35 +0000 (05:26 -0400)]
Merge pull request mono/mono#13928 from lateralusX/lateralusX/use-tls-key-lmf-add-windows

Use TLS_KEY_LMF_ADDR on Windows when pusing lmf frame.

Commit migrated from https://github.com/mono/mono/commit/00b8b21e729c3c18838bc331c17124be076026d7

5 years ago[netcore] Allow reflection invocation of methods with ByRef return types (mono/mono...
Filip Navara [Tue, 9 Apr 2019 08:42:18 +0000 (10:42 +0200)]
[netcore] Allow reflection invocation of methods with ByRef return types (mono/mono#13901)

CoreCLR allows reflection on methods with ByRef return types under certain conditions. The PR implementing it is https://github.com/dotnet/coreclr/pull/17639.

Mono already implemented most of it in the marshalling code but artificially blocked it in `ves_icall_InternalInvoke`. I changed the condition for the exception to match the condition in `emit_invoke_call` (marshal-ilgen.c). It's similar to the condition in CoreCLR, but it may not handle byref-like types correctly. It would have to fixed on both places if it turns out to be the case.

The remaining issue is that null references returned in ByRef are not checked and converted to correct exception. It should result in `NullReferenceException` with special message that doesn't get wrapped in `TargetInvocationException`. I put a TODO marker at a place where I think it should be handled, but it's a bit over my head to implement it.

/cc @vargaz

Commit migrated from https://github.com/mono/mono/commit/444946325661fb1b76be77ae8398c3978eaf01c3

5 years agoMerge pull request mono/mono#13930 from lateralusX/lateralusX/add-supported-additiona...
Johan Lorensson [Tue, 9 Apr 2019 08:16:44 +0000 (04:16 -0400)]
Merge pull request mono/mono#13930 from lateralusX/lateralusX/add-supported-additional-defines-windows

Make sure additional supported enable defines ends up in config.h on Windows.

Commit migrated from https://github.com/mono/mono/commit/fd4539b0ed8acb0be65da38a071ec905d198067f

5 years ago[merp] Restore non-assertion behavior in debugger-engine.c (mono/mono#13865)
Alexander Kyte [Tue, 9 Apr 2019 02:23:35 +0000 (22:23 -0400)]
[merp] Restore non-assertion behavior in debugger-engine.c (mono/mono#13865)

Commit migrated from https://github.com/mono/mono/commit/b0ae9dbdaac492e1a047595c7774ef499658d40a

5 years ago[llvm] If a true/false branch of a conditional branch is marked as out-of-line, emit...
Zoltan Varga [Tue, 9 Apr 2019 01:57:44 +0000 (21:57 -0400)]
[llvm] If a true/false branch of a conditional branch is marked as out-of-line, emit an llvm.expect call. (mono/mono#13915)

Commit migrated from https://github.com/mono/mono/commit/69b6667e2fbddaf15fa670b2c4b7ef1a9ddb7f8c

5 years agoMerge pull request mono/mono#13759 from kjpou1/wasm-update-sdk
Larry Ewing [Mon, 8 Apr 2019 18:23:55 +0000 (13:23 -0500)]
Merge pull request mono/mono#13759 from kjpou1/wasm-update-sdk

[wasm] Update to emscripten 1.38.30

Commit migrated from https://github.com/mono/mono/commit/e51645a5604defdc959d3c2a06956770d3f82b18

5 years agoMake sure additional supported enable defines ends up in config.h on Windows.
lateralusX [Mon, 8 Apr 2019 14:59:10 +0000 (16:59 +0200)]
Make sure additional supported enable defines ends up in config.h on Windows.

Commit migrated from https://github.com/mono/mono/commit/03071d5acaa171442d7a65fdc4a877c9d85a9ec1

5 years agoUse TLS_KEY_LMF_ADDR on Windows when pusing lmf frame.
lateralusX [Tue, 2 Apr 2019 12:01:38 +0000 (14:01 +0200)]
Use TLS_KEY_LMF_ADDR on Windows when pusing lmf frame.

Commit migrated from https://github.com/mono/mono/commit/f204ccf058f1b086b82470681772ba246db38b5c

5 years ago[AOT] fix winaot LLVM profile (mono/mono#13909)
Bernhard Urban [Mon, 8 Apr 2019 14:16:37 +0000 (16:16 +0200)]
[AOT] fix winaot LLVM profile (mono/mono#13909)

[AOT] fix winaot LLVM profile

Regression due to https://github.com/mono/mono/pull/13877

Commit migrated from https://github.com/mono/mono/commit/6c774081b5622dca6bcd229017faa17a5f4bf0fa

5 years ago[jit] Avoid adding a needless zext which confuses abcrem. (mono/mono#13890)
Zoltan Varga [Mon, 8 Apr 2019 13:06:11 +0000 (09:06 -0400)]
[jit] Avoid adding a needless zext which confuses abcrem. (mono/mono#13890)

[jit] Avoid adding a needless zext which confuses abcrem.

Fixes https://github.com/mono/mono/issues/13889.

Commit migrated from https://github.com/mono/mono/commit/e6385a35c9fb9784b44743ee66732f876edc2f34

5 years agoRevert "[image] Create MonoImageStorage to own the image raw data (mono/mono#13892...
Alexander Köplinger [Mon, 8 Apr 2019 11:09:46 +0000 (13:09 +0200)]
Revert "[image] Create MonoImageStorage to own the image raw data (mono/mono#13892)" (mono/mono#13916)

This reverts commit mono/mono@a56573fb7c61adc4a0629a540d0ba093c1f951d8.

Commit migrated from https://github.com/mono/mono/commit/da34285bc180c2eaf06e38808392726aafbbaf01

5 years ago[llvm] do not emit safe points for simple methods (mono/mono#13887)
Egor Bogatov [Mon, 8 Apr 2019 08:53:52 +0000 (11:53 +0300)]
[llvm] do not emit safe points for simple methods (mono/mono#13887)

* do not emit sp on method entry for simple methods

* do not emit sp on method entry for simple methods

* address feedback

Commit migrated from https://github.com/mono/mono/commit/b49e72950e31975cdd3f0062e112b87ebf12d9d9

5 years agoReenable working Enum tests
Filip Navara [Sun, 7 Apr 2019 19:01:57 +0000 (21:01 +0200)]
Reenable working Enum tests

Commit migrated from https://github.com/mono/mono/commit/194c27587828223fb863caa863580e986be397b2

5 years ago[netcore] Remove an assertion which is no longer needed.
Zoltan Varga [Sun, 7 Apr 2019 06:23:12 +0000 (02:23 -0400)]
[netcore] Remove an assertion which is no longer needed.

Commit migrated from https://github.com/mono/mono/commit/8170457d4fde93c601a5ee41d621b9cd3f477100

5 years ago[image] Create MonoImageStorage to own the image raw data (mono/mono#13892)
Aleksey Kliger (λgeek) [Sun, 7 Apr 2019 09:23:29 +0000 (05:23 -0400)]
[image] Create MonoImageStorage to own the image raw data (mono/mono#13892)

Create a new data structure: MonoImageStorage.

It is an object that will have the responsibility for the raw data of a
MonoImage.  It has a string key and a refcount that is used to share a
MonoImageStorage between multiple MonoImage objects.

The reason we need this is because the current MonoAssembly/MonoImage design is
broken for multiple domains and (more evidently) it will be broken when we add
AssemblyLoadContext support.  The issue is that a MonoImage may be shared
between multiple domains (or ALCs), but it has a 'references' field which
points to a single other MonoAssembly.

This is a problem because the references of an image may be resolved
differently in different domains (or ALCs).

The eventual solution will be to stop sharing MonoImages based on path name (or
in the case of in-memory images based on a name made up from the address of the
byte blob).

However we still don't want to open the same data more than once (if we're on a
config where we don't have mmap, we malloc some memory and dump the data in
there - we don't want to do that multiple times for the same file).

So the solution is to create this MonoImageStorage object and make it possible
to share it based on path name, but don't give it any responsibilities except
for owning the memory.  It doesn't know anything about metadata or assemblies
or any of that stuff - it just owns a chunk of memory and knows when and how to
free it.

This commit just adds the MonoImageStorage object and wires it up in MonoImage
loading.  There should be no observable behavioral changes from this commit.

Commit migrated from https://github.com/mono/mono/commit/a56573fb7c61adc4a0629a540d0ba093c1f951d8

5 years agoPropagate System.Globalization.Invariant from runtimeconfig.json to GlobalizationMode
Filip Navara [Sat, 6 Apr 2019 16:35:00 +0000 (18:35 +0200)]
Propagate System.Globalization.Invariant from runtimeconfig.json to GlobalizationMode

Commit migrated from https://github.com/mono/mono/commit/9a63a2d41f79472d28bf7b9786e4d57f2750e470

5 years agoUpdate CoreFX / Runtime versions, download the CoreFX binaries and use them for runni...
Filip Navara [Sat, 6 Apr 2019 15:31:35 +0000 (17:31 +0200)]
Update CoreFX / Runtime versions, download the CoreFX binaries and use them for running the tests

Commit migrated from https://github.com/mono/mono/commit/eddd208dfb6d1439bf859e855f6370c96290857b

5 years agoRemove obsolete AOT relocations for code clarity, assuming no need to support old...
Jay Krell [Sun, 7 Apr 2019 06:21:36 +0000 (23:21 -0700)]
Remove obsolete AOT relocations for code clarity, assuming no need to support old AOT images. (mono/mono#13893)

Remove mono_get_throw_exception_by_name declaration.

Commit migrated from https://github.com/mono/mono/commit/b3917b60ec83e521449455851b5f9b7f3e1194c7

5 years ago[metadata] Fix memory leak for the last iteration of the loop, Coverity mono/mono...
Miguel de Icaza [Sat, 6 Apr 2019 09:46:27 +0000 (05:46 -0400)]
[metadata] Fix memory leak for the last iteration of the loop, Coverity mono/mono#1444258 (mono/mono#13856)

Commit migrated from https://github.com/mono/mono/commit/7116ecaf4eeceed143023352d597e4d09f1dfc95

5 years ago[Coverity] Ensure that we never return -1 from pagesize operation, helps eliminate...
Miguel de Icaza [Sat, 6 Apr 2019 09:41:28 +0000 (05:41 -0400)]
[Coverity] Ensure that we never return -1 from pagesize operation, helps eliminate many false positives (mono/mono#13863)

Commit migrated from https://github.com/mono/mono/commit/8567415aea784cff65c51d5347870a14c2605956

5 years ago[metadata] Handle condition in ftell, Coverity 1307192 (mono/mono#13862)
Miguel de Icaza [Sat, 6 Apr 2019 09:35:07 +0000 (05:35 -0400)]
[metadata] Handle condition in ftell, Coverity 1307192 (mono/mono#13862)

ftell can be a negative value, handle that scenario.

Commit migrated from https://github.com/mono/mono/commit/af4b09ba27f4238c49696b529984167e9baa1a3d

5 years ago[netcore] Implement RuntimeImports.RhBulkMoveWithWriteBarrier (mono/mono#13840)
Filip Navara [Sat, 6 Apr 2019 09:26:55 +0000 (11:26 +0200)]
[netcore] Implement RuntimeImports.RhBulkMoveWithWriteBarrier (mono/mono#13840)

* [netcore] Implement RuntimeImports.RhBulkMoveWithWriteBarrier

* Add the actual write barrier to RhBulkMoveWithWriteBarrier

* Rename ves_icall_System_Runtime_RuntimeImports_Memmove_wbarrier to ves_icall_System_Runtime_RuntimeImports_RhBulkMoveWithWriteBarrier

Fixes 15 failures in System.Memory.Tests.

Commit migrated from https://github.com/mono/mono/commit/f29dd7622c7bb7a4734d2cf4b20899d494364b57

5 years ago[netcore] Fix Marshal.IsPinnable regression (mono/mono#13876)
Filip Navara [Sat, 6 Apr 2019 09:21:07 +0000 (11:21 +0200)]
[netcore] Fix Marshal.IsPinnable regression (mono/mono#13876)

Fix regression from https://github.com/mono/mono/pull/13807/files#diff-e881a4d9491559282e7ae2021f8ad3a4R54.

CoreCLR code for reference: https://github.com/dotnet/coreclr/blob/mono/mono@2f4a7564beb6f8c1f4929504ee2221953d25fc39/src/vm/marshalnative.cpp#L276-L278

Fixes `System.Tests.StringTests.Ctor_CharPtr_DoesNotAccessInvalidPage` in `System.Runtime.Tests`.

My understanding is that IsPinnable should return `true` for:
- Any blittable type
- Any array of blittable types
- Any array of primitive types (covers bool[])
- String, Utf8String (handled separately in managed code in Mono)

It should not return `true` for:
- Primitive non-blittable type
- Value types that are not blittable (eg. contain pointers to other GC objects)

Commit migrated from https://github.com/mono/mono/commit/d074481a29ed3fd0d797a1de4e8aae20c349effd

5 years ago[AOT] remove confusing llcopts flag (mono/mono#13877)
Bernhard Urban [Fri, 5 Apr 2019 20:05:56 +0000 (22:05 +0200)]
[AOT] remove confusing llcopts flag (mono/mono#13877)

[AOT] remove confusing llcopts flag

Introduced by
https://github.com/mono/mono/commit/mono/mono@2eeaf888c1d0a681c8705bd609f76196d8fb82ed

Commit migrated from https://github.com/mono/mono/commit/61100b24e09be5e9ed125d4ac0126ca52f8bcbc5

5 years agoMerge pull request mono/mono#13866 from lambdageek/fix-no-gc-unsafe-dl-fallback-register
Jo Shields [Fri, 5 Apr 2019 19:50:57 +0000 (15:50 -0400)]
Merge pull request mono/mono#13866 from lambdageek/fix-no-gc-unsafe-dl-fallback-register

[mono-dl] Don't do thread state transitions in mono_dl_fallback_register

Commit migrated from https://github.com/mono/mono/commit/0fc2363a4a2d9eac90033726af4e48a7f0dd6d06

5 years ago[merp] Fix image size reported (mono/mono#13847)
Alexander Kyte [Fri, 5 Apr 2019 19:26:13 +0000 (15:26 -0400)]
[merp] Fix image size reported (mono/mono#13847)

* [merp] Point managed image_size at correct size field

* [merp] Bump merp version number

Fixes mono/mono#13834

Commit migrated from https://github.com/mono/mono/commit/5f5c51f3ef40a91053b38cc4ef9673098bab2fe9

5 years ago[llvm] Make GOT a typed struct (mono/mono#13803)
Alexander Kyte [Fri, 5 Apr 2019 19:25:09 +0000 (15:25 -0400)]
[llvm] Make GOT a typed struct (mono/mono#13803)

Commit migrated from https://github.com/mono/mono/commit/715d33c46e6d6669fbdadcdf1203f59e5ad4e2f4

5 years ago[interp] Add intrinsics for common object methods (mono/mono#13762)
Vlad Brezae [Fri, 5 Apr 2019 19:10:16 +0000 (22:10 +0300)]
[interp] Add intrinsics for common object methods (mono/mono#13762)

GetHashCode is 2x faster while GetType is 10x faster.

Commit migrated from https://github.com/mono/mono/commit/47a0ad469b3961f75890fcca5bf1b80cc7881f84

5 years ago[netcore] Avoid loading the globalization native lib in invariant mode. (mono/mono...
Zoltan Varga [Fri, 5 Apr 2019 18:48:00 +0000 (14:48 -0400)]
[netcore] Avoid loading the globalization native lib in invariant mode. (mono/mono#13853)

* [netcore] Avoid loading the globalization native lib in invariant mode.

* Fix a c++-ism.

Commit migrated from https://github.com/mono/mono/commit/25157c4ccdbf94a7ade368031aed17e9673cba31

5 years agoRemove -noappdomain and -noshadow too
Filip Navara [Fri, 5 Apr 2019 11:16:45 +0000 (13:16 +0200)]
Remove -noappdomain and -noshadow too

Commit migrated from https://github.com/mono/mono/commit/7bf675a760b671ab38bdb55ded9d75d3cb388d69

5 years agoKeep the xunit parallelization setting at default value to allow 'Xunit.CollectionBeh...
Filip Navara [Fri, 5 Apr 2019 09:54:59 +0000 (11:54 +0200)]
Keep the xunit parallelization setting at default value to allow 'Xunit.CollectionBehavior(DisableTestParallelization = true)' override

Commit migrated from https://github.com/mono/mono/commit/b60ca5fb6b3e92b787e13df35824e9eb0e65cd81

5 years ago[llvm] Give LLVM noalias info about alloc functions (mono/mono#13801)
Alexander Kyte [Fri, 5 Apr 2019 15:12:34 +0000 (11:12 -0400)]
[llvm] Give LLVM noalias info about alloc functions (mono/mono#13801)

From: https://llvm.org/docs/LangRef.html

```
Furthermore, the semantics of the noalias attribute on return values are stronger than the semantics of the attribute when used on function arguments. On function return values, the noalias attribute indicates that the function acts like a system memory allocation function, returning a pointer to allocated storage disjoint from the storage for any other object accessible to the caller.
```

Think this probably helps LLVM reorder the method calls, telling it that allocating won't return a pointer to something else on the stack.

Commit migrated from https://github.com/mono/mono/commit/0cbdcd8e5aecbac86706f7d7859f2cdc2898ef01

5 years ago[metadata] Don't free_aggregate_modifiers in mono_metadata_free_type (mono/mono#13785)
Aleksey Kliger (λgeek) [Fri, 5 Apr 2019 15:01:24 +0000 (11:01 -0400)]
[metadata] Don't free_aggregate_modifiers in mono_metadata_free_type (mono/mono#13785)

The aggregate modifiers container is owned by a MonoImageSet.  The aggregate
modifiers may be shared by more than one MonoType that happen to need the same
modifiers. (Similar to how generic instantiations are shared)

When the image set is cleaned up the aggregate modifier cleanup will free the
types in the aggregate modifiers container (the call to
free_aggregate_modifiers in mono_metadata_clean_for_image).

With this extra call to free_aggregate_modifiers in mono_metadata_free_type may
cause the same memory to be freed twice.

Fixes https://github.com/mono/mono/issues/13775

Commit migrated from https://github.com/mono/mono/commit/c434294b24ea90a86d92c7bae658e927242ad9b0

5 years agoAdd MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR and MONO_PATCH_INFO_SPECIFIC_TRAMPOLINE_LAZY...
Jay Krell [Fri, 5 Apr 2019 07:43:28 +0000 (00:43 -0700)]
Add MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR and MONO_PATCH_INFO_SPECIFIC_TRAMPOLINE_LAZY_FETCH_ADDR. (mono/mono#13794)

* Add MONO_PATCH_INFO_LAZY_FETCH_ADDR and MONO_PATCH_INFO_TRAMP_ADDR.
These are int-based alternatives to MONO_PATCH_INFO_JIT_ICALL_ADDR + sprintf.

This clarifies work to remove the JIT icall hash tables that are used with:
 MONO_PATCH_INFO_JIT_ICALL
 MONO_PATCH_INFO_JIT_ICALL_ADDR
 MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL

making it easier to make those enum-based, indexing a fixed size dense array.

As a related side effect, that could be achieved otherwise,
this fixes apparent leaks.

And clarify MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL slightly, by making
searches for it find one more hit.

That is, those three enums are mostly used with a fixed set of strings.
Except for as in this PR where they are used with indefinite strings.
The removal of the indefinite strings eases replacement of the fixed
set of strings with an enum.

* Bump MONO_AOT_FILE_VERSION.

* PR feedback: Remove unused code and historical commentary.
Also updated PR title with more verbose actual names of the new symbols:
  `MONO_PATCH_INFO_TRAMPOLINE_FUNC_ADDR`
  `MONO_PATCH_INFO_SPECIFIC_TRAMPOLINE_LAZY_FETCH_ADDR`

* Add missing break.

Commit migrated from https://github.com/mono/mono/commit/36c5f3f3704c86ed67673afdfe74268e0337b1f0

5 years ago[netcore] System.Runtime.InteropServices test fixes. (mono/mono#13807)
Zoltan Varga [Fri, 5 Apr 2019 06:13:52 +0000 (02:13 -0400)]
[netcore] System.Runtime.InteropServices test fixes. (mono/mono#13807)

* [netcore] Fix Marshal test failures.

* [netcore] Add exclusions for System.Runtime.InteropServices.Tests.

* [netcore] Make an icall internal.

* Add more test exclusions.

* Address review comments.

Commit migrated from https://github.com/mono/mono/commit/3344bd64c894d20fd13c4b81c4f7e01bc2a62795

5 years ago[interp] Add more netcore intrinsics. (mono/mono#13849)
Zoltan Varga [Fri, 5 Apr 2019 06:13:34 +0000 (02:13 -0400)]
[interp] Add more netcore intrinsics. (mono/mono#13849)

* [interp] Add more netcore intrinsics.

* Address review comments.

* Fix a warning.

Commit migrated from https://github.com/mono/mono/commit/22e2cd87a727188b04bb43c8b73f8edb6531e3e9

5 years agoFix .vscode/c_cpp_properties.json
Alexander Köplinger [Thu, 4 Apr 2019 23:04:12 +0000 (01:04 +0200)]
Fix .vscode/c_cpp_properties.json

Commit migrated from https://github.com/mono/mono/commit/7030a95c84a5a971b3bc6361de27c4c9c055c23b

5 years ago[mono-dl] Don't do thread state transitions in mono_dl_fallback_register
Aleksey Kliger [Thu, 4 Apr 2019 22:09:41 +0000 (18:09 -0400)]
[mono-dl] Don't do thread state transitions in mono_dl_fallback_register

1. it doesn't touch the managed runtime

2. it may be called (arguably it ought to be called only) before the runtime is
initialized (and in particular before the current thread is attached).

Commit migrated from https://github.com/mono/mono/commit/275d1f5d16ae23d8edb071ea82f1893226889aa8

5 years ago[interp] Fix GetFunctionPointer (mono/mono#13708)
Vlad Brezae [Thu, 4 Apr 2019 20:19:50 +0000 (23:19 +0300)]
[interp] Fix GetFunctionPointer (mono/mono#13708)

This method returns a function pointer that can be called with a calli instruction. On interpreter we use a pointer to InterpMethod while on jit we use the native code address. Normally, GetFunctionPointer should return the InterpMethod pointer if called from interp or the native code address if called from jit. Since we don't have any information about the execution engine of the caller, we solve this by intrinsifying all these calls, that happen in the interpreter.

Passing such function pointers between jitted and interp code is probably still unreliable.

Fixes https://github.com/mono/mono/issues/13654

Commit migrated from https://github.com/mono/mono/commit/474305cbce2eaba12186d61583ab358bc5957abe

5 years agoMerge pull request mono/mono#13858 from kg/disable-llvmjit-on-ci
Jo Shields [Thu, 4 Apr 2019 20:14:54 +0000 (16:14 -0400)]
Merge pull request mono/mono#13858 from kg/disable-llvmjit-on-ci

Disable llvmjit in the packaging test ci lane so we can turn the lane back on

Commit migrated from https://github.com/mono/mono/commit/4b46c5fca4c5c7dc2754150179d3b76e2fb93643

5 years ago[DIM] Do not order implemented interfaces (mono/mono#13721)
Thays Grazia [Thu, 4 Apr 2019 18:38:21 +0000 (15:38 -0300)]
[DIM] Do not order implemented interfaces (mono/mono#13721)

This test https://github.com/dotnet/coreclr/blob/mono/mono@1649da12db73c8c07513c9168cb30ec70c310063/tests/src/Regressions/coreclr/20452/twopassvariance.il

On mono we were ordering the list of implemented interfaces and shouldn't do this as it's described on ECMA-335 Section II.12.2.1 and II.12.2.2.
The ordering was removed on ilasm and some changes were needed on metadata either because it's not ordered anymore.

There were two bugs, one on ilasm and other on class initialization on mono.

### ILAsm ###

If we get the .exe generated by .net Framework it doesn't execute on mono without modifications because we ordered the implemented interfaces list by id. And doing that the order defined on source code is ignored.

If we get the .exe generated by Mono it doesn't execute on .net Framework because on IlAsm we order the list and loose the order defined on source code.

The interfaces on metadata before these changes on IlAsm were like this:
```
1: Fooer1 implements class IFoo<class Derived>
2: Fooer1 implements class IFoo<class Base>
3: Fooer2 implements class IFoo<class Base>
4: Fooer2 implements class IFoo<class Derived>
5: Fooer3 implements class IFoo<object>
6: Fooer3 implements class IBar<class Derived>
7: Fooer3 implements class IBaz<class Base>
8: IBar implements class IFoo<!0>
9: IBaz implements class IFoo<!0>
10: Fooer4 implements IQux
11: Fooer4 implements class IBar<class Derived>
12: IQux implements class IFoo<class Base>
13: IQux implements class IFoo<class Derived>
14: Fooer5 implements IQux
15: Fooer5 implements class IBar<class Derived>
16: Fooer6 implements class IBar<class Base>
17: Fooer6 implements class IFoo<class Base>
18: Fooer7 implements class IFoo<class Base>
19: Fooer7 implements class IBar<class Base>
```

And After the changes they follow the definition order which is the same order of IlAsm for .net framework and .net core.
```
1: IBar implements class IFoo<!0>
2: IBaz implements class IFoo<!0>
3: IQux implements class IFoo<class Base>
4: IQux implements class IFoo<class Derived>
5: Fooer1 implements class IFoo<class Base>
6: Fooer1 implements class IFoo<class Derived>
7: Fooer2 implements class IFoo<class Derived>
8: Fooer2 implements class IFoo<class Base>
9: Fooer3 implements class IBaz<class Base>
10: Fooer3 implements class IBar<class Derived>
11: Fooer3 implements class IFoo<object>
12: Fooer4 implements IQux
13: Fooer4 implements class IBar<class Derived>
14: Fooer5 implements class IBar<class Derived>
15: Fooer5 implements IQux
16: Fooer6 implements class IFoo<class Base>
17: Fooer6 implements class IBar<class Base>
18: Fooer7 implements class IBar<class Base>
19: Fooer7 implements class IFoo<class Base>
```

### Mono vtable layout ###

Internally when Mono computes the interface table for each class, it would previously sort the interfaces by `MonoClass:interface_id` which is a unique id assigned (roughly) in load order.  This was incorrect because the order of the interfaces determines the final vtable for the class.  This PR changes the interface table computation so that the interfaces of a single class are ordered in declaration order, following ECMA.

One consequence is that we can no longer use binary search with the interface id as the key to find out if a class implements an interface.  We have to do a linear scan. On the other hand, we expect that the number of interfaces implemented by a single class is small in practice.

This is how the Vtable for Fooer1 and Fooer2 looks like after the changes:
```
*** Vtable for class 'Fooer1' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fd78681db20]
[O][001][INDEX 001] object:GetHashCode () [0x7fd78681daf8]
[O][002][INDEX 002] object:Finalize () [0x7fd78681dad0]
[O][003][INDEX 003] object:Equals (object) [0x7fd78681daa8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fd786503800]
[I][005][INDEX 000] IFoo:Gimme () [0x7fd7865038c0]
Packed interface table for class Fooer1 has size 2
[000][UUID 078][SLOT 004][SIZE 001] interface IFoo[Base]
[001][UUID 079][SLOT 005][SIZE 001] interface IFoo[Derived]
```
and
```
*** Vtable for class 'Fooer2' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fd78681db20]
[O][001][INDEX 001] object:GetHashCode () [0x7fd78681daf8]
[O][002][INDEX 002] object:Finalize () [0x7fd78681dad0]
[O][003][INDEX 003] object:Equals (object) [0x7fd78681daa8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fd7865038c0]
[I][005][INDEX 000] IFoo:Gimme () [0x7fd786503800]
Packed interface table for class Fooer2 has size 2
[000][UUID 079][SLOT 004][SIZE 001] interface IFoo[Derived]
[001][UUID 078][SLOT 005][SIZE 001] interface IFoo[Base]
```

This is how the VTable for Fooer1 and Fooer2 looks like before the changes, as you can see Packed interface table are the same in Fooer1 and Fooer2, so the behavior of both classes was the same:

```
Vtable for class 'Fooer1' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fcf3801d920]
[O][001][INDEX 001] object:GetHashCode () [0x7fcf3801d8f8]
[O][002][INDEX 002] object:Finalize () [0x7fcf3801d8d0]
[O][003][INDEX 003] object:Equals (object) [0x7fcf3801d8a8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fcf37c29880]
[I][005][INDEX 000] IFoo:Gimme () [0x7fcf37c29940]
Packed interface table for class Fooer1 has size 2
[000][UUID 076][SLOT 004][SIZE 001] interface IFoo[Base]
[001][UUID 077][SLOT 005][SIZE 001] interface IFoo[Derived]
```

```
Vtable for class 'Fooer2' at "FINALLY" (size 6)
[O][000][INDEX 000] object:ToString () [0x7fcf3801d920]
[O][001][INDEX 001] object:GetHashCode () [0x7fcf3801d8f8]
[O][002][INDEX 002] object:Finalize () [0x7fcf3801d8d0]
[O][003][INDEX 003] object:Equals (object) [0x7fcf3801d8a8]
[I][004][INDEX 000] IFoo:Gimme () [0x7fcf37c29940]
[I][005][INDEX 000] IFoo:Gimme () [0x7fcf37c29880]
Packed interface table for class Fooer2 has size 2
[000][UUID 076][SLOT 005][SIZE 001] interface IFoo[Base]
[001][UUID 077][SLOT 004][SIZE 001] interface IFoo[Derived]
```

Commit migrated from https://github.com/mono/mono/commit/beb81d3deb068f03efa72be986c96f9c3ab66275

5 years ago[llvm] Fix llvm JIT. (mono/mono#13835)
Zoltan Varga [Thu, 4 Apr 2019 13:46:06 +0000 (09:46 -0400)]
[llvm] Fix llvm JIT. (mono/mono#13835)

[llvm] Fix llvm JIT.

<!--
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/aba1bac992971a1784fdf1db9a346bc7a305876c

5 years ago[netcore] Improve support for rare enum types (mono/mono#13825)
Filip Navara [Thu, 4 Apr 2019 09:08:07 +0000 (11:08 +0200)]
[netcore] Improve support for rare enum types (mono/mono#13825)

* [netcore] Improve support for rare enum types (IntPtr, UIntPtr, Single, Double, Char, Boolean backing types)

* Add back Intrinsic attribute

* Update Enum.cs

Commit migrated from https://github.com/mono/mono/commit/9270f159bf33f6f692222375ecf771225d8280b4

5 years ago[netcore] Implement missing Math and MathF methods (mono/mono#13833)
Egor Bogatov [Thu, 4 Apr 2019 08:37:05 +0000 (11:37 +0300)]
[netcore] Implement missing Math and MathF methods (mono/mono#13833)

* Add missing Math(f) methods

* remove extra empty line

Commit migrated from https://github.com/mono/mono/commit/271c4448b440e5f0385f6f2c78679158fa311ce4

5 years ago[interp] Optimize static vtype field access (mono/mono#13769)
Vlad Brezae [Thu, 4 Apr 2019 08:06:19 +0000 (11:06 +0300)]
[interp] Optimize static vtype field access (mono/mono#13769)

We want to avoid calling stackval_to/from methods. Also include the field address in the instruction stream. This makes static vtype field access 10x faster.

Refactor the code a bit.

Commit migrated from https://github.com/mono/mono/commit/e6c43065f757e57819648f9dc9e18bd840d27b0c

5 years ago[gsharedvt] Fix sizeof opcode (mono/mono#13817)
Vlad Brezae [Wed, 3 Apr 2019 18:26:00 +0000 (21:26 +0300)]
[gsharedvt] Fix sizeof opcode (mono/mono#13817)

[gsharedvt] Fix sizeof opcode

We were setting the stack type by using another global local named ins.

This lead to missing methods in the aot image due to invalid IL. Fixes https://github.com/mono/mono/issues/13479.

Commit migrated from https://github.com/mono/mono/commit/cfa75e8ca5faceddc0aef3e3cddb08d6c7b918a7

5 years agoMerge pull request mono/mono#13828 from directhex/loadedllvmaot
Jo Shields [Wed, 3 Apr 2019 18:09:29 +0000 (14:09 -0400)]
Merge pull request mono/mono#13828 from directhex/loadedllvmaot

Add MONO_LLVM_INTERNAL to re-fix LLVM AOT with loadedllvm

Commit migrated from https://github.com/mono/mono/commit/4c07ca4e464d55b972b0d633ee2d81dd2d40659f

5 years agoMerge pull request mono/mono#13750 from directhex/test-installed-prefix-mono
Jo Shields [Wed, 3 Apr 2019 17:38:20 +0000 (13:38 -0400)]
Merge pull request mono/mono#13750 from directhex/test-installed-prefix-mono

Add tests to ensure `make install` prefix is functional

Commit migrated from https://github.com/mono/mono/commit/124025fc4de5c1fdcacf80b728fab4a48157b96b

5 years agoAdd MONO_LLVM_INTERNAL to re-fix LLVM AOT with loadedllvm
Jo Shields [Wed, 3 Apr 2019 17:19:57 +0000 (13:19 -0400)]
Add MONO_LLVM_INTERNAL to re-fix LLVM AOT with loadedllvm

Commit migrated from https://github.com/mono/mono/commit/656208c0047eee2d21319ed249f306680b913da7

5 years ago[interp] Add intrinsics for Math operations (mono/mono#13635)
Vlad Brezae [Wed, 3 Apr 2019 16:56:35 +0000 (19:56 +0300)]
[interp] Add intrinsics for Math operations (mono/mono#13635)

Commit migrated from https://github.com/mono/mono/commit/f98a81b488e7941ff0f92c88ad28da9e900a52cc

5 years ago[netcore] Simplify runtime and tests synchronization
Marek Safar [Wed, 3 Apr 2019 13:27:48 +0000 (15:27 +0200)]
[netcore] Simplify runtime and tests synchronization

Commit migrated from https://github.com/mono/mono/commit/9bdf6c2c6c72e139db5dab5dcb800d1c4a7a2bc2

5 years ago[netcore] Bump SDK version
Filip Navara [Tue, 2 Apr 2019 22:15:14 +0000 (00:15 +0200)]
[netcore] Bump SDK version

Commit migrated from https://github.com/mono/mono/commit/bd8ec579016b8512931f7f872e18e260013eb23e

5 years agoRename cabs/cimag/creal to mono_cabs/mono_cimag/mono_creal without macro to rename...
Jay Krell [Wed, 3 Apr 2019 07:26:28 +0000 (00:26 -0700)]
Rename cabs/cimag/creal to mono_cabs/mono_cimag/mono_creal without macro to rename. (mono/mono#13663)

Also make cimag/creal macros for guaranteed inlining -- instead of passing structs by value.
And add spaces before parens to follow coding convention (which is designed
to ease low tech searches for entire words).

This was agreed to when the code was first ported to C++ but got dropped.
The compromise though was to put the defines relatively late to limit their impact.

Commit migrated from https://github.com/mono/mono/commit/5ed727ed8ec595ad440c9f70a69d9bc970eccb86

5 years agoMerge pull request mono/mono#13797 from directhex/remove-csc-dim-some-more
Jo Shields [Tue, 2 Apr 2019 18:04:55 +0000 (14:04 -0400)]
Merge pull request mono/mono#13797 from directhex/remove-csc-dim-some-more

Remove csc-dim script, since csc-dim is gone

Commit migrated from https://github.com/mono/mono/commit/688ac23fb69edb61995369d162b90b1bfc73ebb3

5 years ago[netcore] Cleanup + test fixes (mono/mono#13795)
Filip Navara [Tue, 2 Apr 2019 15:49:20 +0000 (17:49 +0200)]
[netcore] Cleanup + test fixes (mono/mono#13795)

Avoid using `wget` since it's not installed on macOS by default.

Commit migrated from https://github.com/mono/mono/commit/02be9aeba324089a46a10a1cecddf40826e71f64

5 years ago[netcore] Fix few Array tests (mono/mono#13756)
Egor Bogatov [Tue, 2 Apr 2019 12:48:53 +0000 (15:48 +0300)]
[netcore] Fix few Array tests (mono/mono#13756)

* fix test

* fix tests

* Fix ArgumentNullException empty ParamName

* System.Text.Tests.StringBuilderTests are fine

* fix BlockCopy test

* enable more tests

* Enable more tests

* address feedback

Commit migrated from https://github.com/mono/mono/commit/3bb6fe8797d70edd53330fe391a042f7c74a1978

5 years ago[netcore] Fixes for System.Reflection tests. (mono/mono#13776)
Zoltan Varga [Tue, 2 Apr 2019 07:02:25 +0000 (03:02 -0400)]
[netcore] Fixes for System.Reflection tests. (mono/mono#13776)

* [netcore] Add error checking for assembly version parsing, pass the full 32 bit value to managed code.

* [netcore] Implement RuntimeType.StructLayoutAttribute.

* [runtime] Implement RuntimeFieldHandle.GetValueDirect (), convert SetValueDirect () to handles.

* [netcore] Implement Assembly.GetFiles ()/GetForwardedTypes ().

* [runtime] Handle 'ARM' as a valid architecture in assembly name parsing.

* [netcore] Implement ParameterInfo.MarshalAsAttribute, AssemblyName.EscapedCodeBase.

* [netcore] Add exclusions for System.Reflection.Tests.

* [netcore] Update test exclusions.

* [netcore] Fix CustomAttributeExtensions.

* [netcore] Add a list of passing test suites.

* [netcore] Add a missing argument check.

* Update Object.cs

Commit migrated from https://github.com/mono/mono/commit/df846bcbc9706e325f3b5dca4d09530b80e9db83

5 years ago[netcore] Add exception for System.Threading.ThreadPool tests
Filip Navara [Mon, 1 Apr 2019 21:44:00 +0000 (23:44 +0200)]
[netcore] Add exception for System.Threading.ThreadPool tests

Commit migrated from https://github.com/mono/mono/commit/a63a85b21d8bb9494aacec2ef796290daaf8a1dc

5 years ago[netcore] Add exception for System.IO tests
Filip Navara [Mon, 1 Apr 2019 21:39:21 +0000 (23:39 +0200)]
[netcore] Add exception for System.IO tests

Commit migrated from https://github.com/mono/mono/commit/ed01dc0e92fb147b9266d1515a0543d4e2d1656d

5 years ago[netcore] Add exception for System.Text.Json tests
Filip Navara [Mon, 1 Apr 2019 21:23:13 +0000 (23:23 +0200)]
[netcore] Add exception for System.Text.Json tests

Commit migrated from https://github.com/mono/mono/commit/8b2463b57cbd2d2cf1e2842e3b70660fc2187a02

5 years ago[netcore] Fix a number of SRE argument checking failures.
Zoltan Varga [Mon, 1 Apr 2019 04:46:03 +0000 (00:46 -0400)]
[netcore] Fix a number of SRE argument checking failures.

Commit migrated from https://github.com/mono/mono/commit/cee8934bcedbf9617d0f87a01d0634b2af3dc992

5 years ago[sre] Emit custom modifiers for return values.
Zoltan Varga [Mon, 1 Apr 2019 03:47:02 +0000 (23:47 -0400)]
[sre] Emit custom modifiers for return values.

Commit migrated from https://github.com/mono/mono/commit/476514ec988c05cc4f80b191692641ed9a6c6a4f

5 years agoFix tarball builds
Jo Shields [Mon, 1 Apr 2019 19:50:51 +0000 (15:50 -0400)]
Fix tarball builds

Commit migrated from https://github.com/mono/mono/commit/262a543a17bad3fb43ff42501b7c3eea0bbf5f71

5 years agoAdd netcore/Makefile to .gitignore (mono/mono#13771)
Martin Baulig [Mon, 1 Apr 2019 18:14:22 +0000 (14:14 -0400)]
Add netcore/Makefile to .gitignore (mono/mono#13771)

Commit migrated from https://github.com/mono/mono/commit/f42f1026cd8a015c45c13aca77613e1c0370823d

5 years ago[interp] Add Internal.Runtime.CompilerServices.Unsafe intrinsics. (mono/mono#13732)
Zoltan Varga [Mon, 1 Apr 2019 17:15:52 +0000 (13:15 -0400)]
[interp] Add Internal.Runtime.CompilerServices.Unsafe intrinsics. (mono/mono#13732)

[interp] Add Internal.Runtime.CompilerServices.Unsafe intrinsics.

Commit migrated from https://github.com/mono/mono/commit/37a09e9eb0deee136fe875d36345e318cfd103ed

5 years agoFix a few deficiencies in mono_path_filename_in_basedir. Mainly strstr. (mono/mono...
Jay Krell [Mon, 1 Apr 2019 16:43:10 +0000 (09:43 -0700)]
Fix a few deficiencies in mono_path_filename_in_basedir. Mainly strstr. (mono/mono#13719)

* Fix a few deficiencies in mono_path_filename_in_basedir.
The main one is that strstr is too loose.
Add tests.
Make it case insensitive on Win32 and allow some denormal input.
 Note that case sensitivity is a function of file system, not
 operating system, but a lot of code gets it wrong, so here does too.

Add more data to asserts.

Account for test reality -- filename is not absolute.

The Win32 code paths can be tested on Unix and vice versa
w/o compromise. See https://github.com/mono/mono/pull/13707

* Reduce testing per PR feedback.

* Edit/add comments.
This is an attempt to clarify and hopefully doesn't backfire.

* Try to make tests clearer, and stop skipping some oops.

* PR: Restore case insensitivity testing on Windows. Tweak a little bit.

* Include the .c file instead of .h to fix some builds.

Commit migrated from https://github.com/mono/mono/commit/ff1d485b56bec3d62a83f9dbeb29548aa353b014

5 years agoMerge pull request mono/mono#13767 from directhex/master
Jo Shields [Mon, 1 Apr 2019 15:40:54 +0000 (11:40 -0400)]
Merge pull request mono/mono#13767 from directhex/master

Bump version to 6.3

Commit migrated from https://github.com/mono/mono/commit/c4eb7d679be48286122bcc03ba261d2bef9df389

5 years agoBump version to 6.3
Jo Shields [Mon, 1 Apr 2019 14:43:21 +0000 (10:43 -0400)]
Bump version to 6.3

Commit migrated from https://github.com/mono/mono/commit/b198ef5ad697005a86aaf73d3229d19bd9aef9f5

5 years agoFix WASM build (mono/mono#13763)
Filip Navara [Mon, 1 Apr 2019 10:15:50 +0000 (12:15 +0200)]
Fix WASM build (mono/mono#13763)

Broken by https://github.com/mono/mono/pull/13712.

Commit migrated from https://github.com/mono/mono/commit/acb8dd1183acb4ed4b9b967004a0499cf44de45c

5 years ago[sdks,mac] Remove dependency on MXE in favor of MinGW
Marek Habersack [Tue, 15 Jan 2019 16:29:05 +0000 (17:29 +0100)]
[sdks,mac] Remove dependency on MXE in favor of MinGW

It turns out that homebrew now has a package for the MinGW gcc-based windows
cross compiler which is awesome as it allows us to skip building MXE and use the
latest version of the GCC suite pre-packaged for Mac. This commit removes almost
all traces of MXE (except for `mxe.mk` itself, because I don't know if any bot
or external tool, whatever, use targets in it) and adds the following brew
packages to SDK bot provisioning as well as to the `provision-mxe` target of
Mono SDKs:

  * mingw-w64
  * xamarin/xamarin-android-windeps/mingw-zlib

The latter package builds a Windows version of zlib using MinGW and it comes
from Xamarin's own homebrew tap at https://github.com/xamarin/homebrew-xamarin-android-windeps/blob/mono/mono@f4cc90845ff1953800d8d71035566a12d9b7aa24/mingw-zlib.rb

Additionally, this commit adds a new `configure` flag: `--with-static-zlib=PATH`
which allows one to specify the static zlib archive to use when linking Mono.
The static archive supersedes the otherwise indicated or detected zlib. This is
the recommended mode of operation for MinGW builds as it avoids problems with
`zlib.dll` versions on the target machine.

Commit migrated from https://github.com/mono/mono/commit/acbeffd07339aea56f3157d2dd88d27e7f24d538

5 years ago[System.Private.CoreLib/mscorlib] Implement Interlocked.MemoryBarrierProcessWide...
Filip Navara [Sun, 31 Mar 2019 10:08:51 +0000 (12:08 +0200)]
[System.Private.CoreLib/mscorlib] Implement Interlocked.MemoryBarrierProcessWide (mono/mono#13712)

* Implement Interlocked.MemoryBarrierProcessWide

* Bump MONO_CORLIB_VERSION

* Bump API snapshot submodule

Commit migrated from https://github.com/mono/mono/commit/9ccfd778e34aa12cf718968381968a46451f6468

5 years agofix IsPinnable
Egor Bogatov [Sat, 30 Mar 2019 00:38:18 +0000 (02:38 +0200)]
fix IsPinnable

Commit migrated from https://github.com/mono/mono/commit/282a9635b39ea73b2c8ec8704d47b4046c19464a

5 years agoenable more tests
Marek Safar [Fri, 29 Mar 2019 16:07:40 +0000 (17:07 +0100)]
enable more tests

Commit migrated from https://github.com/mono/mono/commit/4d7931cd0f71005ab4797bbab3a49d91e464df98

5 years ago[netcore] Reorder test targets
Marek Safar [Fri, 29 Mar 2019 13:58:40 +0000 (14:58 +0100)]
[netcore] Reorder test targets

Commit migrated from https://github.com/mono/mono/commit/c302bfdc660142fb03805535fe36b7cbc068f1b2

5 years ago[arm] Don't use C++ keyword as a variable name (mono/mono#13744)
Aleksey Kliger (λgeek) [Fri, 29 Mar 2019 20:27:49 +0000 (16:27 -0400)]
[arm] Don't use C++ keyword as a variable name (mono/mono#13744)

Fixes the nightly C++ Jenkins jobs
https://jenkins.mono-project.com/job/test-mono-mainline-linux-cxx/

Commit migrated from https://github.com/mono/mono/commit/20b523ee9c57802981ec89d23289b7dd62dd8376

5 years agoMerge pull request mono/mono#13633 from rfht/master
Jo Shields [Fri, 29 Mar 2019 17:27:48 +0000 (13:27 -0400)]
Merge pull request mono/mono#13633 from rfht/master

Fix DNS Name Resolution Failure on OpenBSD (GitHub issue mono/mono#8168)

Commit migrated from https://github.com/mono/mono/commit/fbc7da2a3f80f8262f45ee2a924ef5dc9f2571c4

5 years ago[netcore] Guard for skipFrames overflow, update test exclusions (mono/mono#13745)
Filip Navara [Fri, 29 Mar 2019 16:53:52 +0000 (17:53 +0100)]
[netcore] Guard for skipFrames overflow, update test exclusions (mono/mono#13745)

* [netcore] Guard for skipFrames overflow

* [netcore] Remove Timer tests exclusion

* [netcore] Remove unnecessary null check

Commit migrated from https://github.com/mono/mono/commit/a7a225ceafc6344092a4703727930a71505873d4

5 years agoUpdate tests
Egor Bogatov [Fri, 29 Mar 2019 14:45:59 +0000 (16:45 +0200)]
Update tests

Commit migrated from https://github.com/mono/mono/commit/8cce577994863df13a2a2ead85b20726f28c3eb9

5 years ago[netcore] Ongoing work. (mono/mono#13731)
Zoltan Varga [Fri, 29 Mar 2019 11:47:16 +0000 (07:47 -0400)]
[netcore] Ongoing work. (mono/mono#13731)

Commit migrated from https://github.com/mono/mono/commit/77e99d080d9c4419c546f0ba1023bf5653ac2dbd

5 years ago[netcore] Improve xtest command (mono/mono#13703)
Egor Bogatov [Thu, 28 Mar 2019 17:00:34 +0000 (19:00 +0200)]
[netcore] Improve xtest command (mono/mono#13703)

The python script now also extracts downloaded zips and `make xtest-%` is now able to consume these artifacts.
E.g.
```
make xtest-System.Collections.Tests COREFX_ROOT=/prj/corefx-repo
```
We still need COREFX_ROOT because of two missing files:
`CoreFx.Private.TestUtilities.dll` and `xunit.console.deps.json`
maybe I should just add them to our repo?

Also this PR fixes `RemoteExecutorConsoleApp` problems for `make xtest-%`

Commit migrated from https://github.com/mono/mono/commit/2522547cd5ba592e21fdba2e94a9feeb20037daf

5 years agoMerge pull request mono/mono#13705 from kjpou1/wasm-issue-12871
Larry Ewing [Thu, 28 Mar 2019 16:44:43 +0000 (11:44 -0500)]
Merge pull request mono/mono#13705 from kjpou1/wasm-issue-12871

[wasm] Fix System.DllNotFoundException: libc

Commit migrated from https://github.com/mono/mono/commit/49ba9f32ecd06971357abf365a8c0379b1c3d1c9

5 years ago[Mono.Runtime.Tests] Remove duplicate file in .sources
Alexander Köplinger [Thu, 28 Mar 2019 15:38:09 +0000 (16:38 +0100)]
[Mono.Runtime.Tests] Remove duplicate file in .sources

Commit migrated from https://github.com/mono/mono/commit/f48b0a70c3ae4418775594200e29856dd2dd7668

5 years agoMerge pull request mono/mono#13700 from directhex/compress-with-xz
Jo Shields [Thu, 28 Mar 2019 15:22:09 +0000 (11:22 -0400)]
Merge pull request mono/mono#13700 from directhex/compress-with-xz

Switch `make dist` format from BZip2 to XZ.

Commit migrated from https://github.com/mono/mono/commit/7e99ce296081e50270147521106784319317e1ca

5 years ago[profiler] Add duration=NUM parameter to AOT profiler (mono/mono#13688)
Radek Doulik [Thu, 28 Mar 2019 14:54:36 +0000 (15:54 +0100)]
[profiler] Add duration=NUM parameter to AOT profiler (mono/mono#13688)

* [profiler] Add duration=NUM parameter to AOT profiler

It instructs the AOT profiler to write the data after NUM seconds
measured from runtime initialization.

* [profilers] Added aot:duration=NUM parameter description

Commit migrated from https://github.com/mono/mono/commit/4cf13bcd16b48b0e8b7eed99042e3746cdb1080a

5 years agoMerge pull request mono/mono#13699 from directhex/no-more-monograph
Jo Shields [Thu, 28 Mar 2019 14:18:53 +0000 (10:18 -0400)]
Merge pull request mono/mono#13699 from directhex/no-more-monograph

Delete monograph. Closes https://github.com/mono/mono/issues/7845

Commit migrated from https://github.com/mono/mono/commit/ac0f7ece3511837a6dd4c8465dbf3a07d783a155

5 years agoUpdate Makefile
Filip Navara [Wed, 27 Mar 2019 19:43:17 +0000 (20:43 +0100)]
Update Makefile

Commit migrated from https://github.com/mono/mono/commit/8f99674718a05b77fff917cfaa9c87a523b56088

5 years agoSeparate out common code from pinvoke_probe_for_module_relative_directories into...
Filip Navara [Tue, 26 Mar 2019 22:31:07 +0000 (23:31 +0100)]
Separate out common code from pinvoke_probe_for_module_relative_directories into pinvoke_probe_for_module_in_directory

Commit migrated from https://github.com/mono/mono/commit/141493c473a11c3e521faaf3086b7ed8df53b6c6

5 years ago[netcore] Move P/Invoke directory lookup from mono_dl_fallback to pinvoke_probe_for_m...
Filip Navara [Tue, 26 Mar 2019 21:23:28 +0000 (22:23 +0100)]
[netcore] Move P/Invoke directory lookup from mono_dl_fallback to pinvoke_probe_for_module_relative_directories

Commit migrated from https://github.com/mono/mono/commit/4648210f3b9bdf5ef43984998abbe4da038c9d46

5 years ago[netcore] Handle NATIVE_DLL_SEARCH_DIRECTORIES for p/invoke
Filip Navara [Tue, 26 Mar 2019 10:42:01 +0000 (11:42 +0100)]
[netcore] Handle NATIVE_DLL_SEARCH_DIRECTORIES for p/invoke

Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/3e05b4ea77e0e7e4ca0a8ef76b773bc73efa9eb0

5 years ago[interp] Small changes (mono/mono#13691)
Vlad Brezae [Thu, 28 Mar 2019 12:12:17 +0000 (14:12 +0200)]
[interp] Small changes (mono/mono#13691)

* [interp] Extract the code pushing lmf in separate function

There is no reason to not optimize the code inside do_icall

* [interp] Remove dead code

Trace ips are filled in mono_handle_exception_internal

Commit migrated from https://github.com/mono/mono/commit/23aa609af78cde121fe2cdcc53a562bb7dd7b752