Larry Ewing [Thu, 18 Apr 2019 16:43:09 +0000 (11:43 -0500)]
Merge pull request mono/mono#14113 from vargaz/netcore-pinvoke
[wasm] Fix the types of the generated function declarations in the pinvoke table.
Commit migrated from https://github.com/mono/mono/commit/
eaba6c608c81aab472de41156127d4abbd7ee9d5
Thays Grazia [Thu, 18 Apr 2019 16:29:21 +0000 (13:29 -0300)]
Protecting boxing a null value (mono/mono#14018)
When a static method is called the obj is not used, so it can be null and it doesn't need to be boxed.
Adding an assert in the method to prevent other crash in this method if a NULL is received.
Commit migrated from https://github.com/mono/mono/commit/
bc2d8e7c92d1254a6081244be84fc1f7b62cbe33
Bernhard Urban [Thu, 18 Apr 2019 15:56:10 +0000 (17:56 +0200)]
[interp] disable tail call opt if managed debugger is enabled (mono/mono#14098)
[interp] disable tail call opt if managed debugger is enabled
Fixes https://github.com/mono/mono/issues/12981
Commit migrated from https://github.com/mono/mono/commit/
dacee1925226c11ac24401467ec6e99c81bbb9c5
Vincent Povirk [Thu, 18 Apr 2019 13:44:31 +0000 (08:44 -0500)]
Respect call convention modopts in native wrappers. (mono/mono#14017)
MS's C++ compiler emits code that uses this.
Commit migrated from https://github.com/mono/mono/commit/
8c2d1829c19f6b6af1b74fbb716c634ad3c1d578
Johan Lorensson [Thu, 18 Apr 2019 10:20:54 +0000 (06:20 -0400)]
Merge pull request mono/mono#13931 from lateralusX/lateralusX/external-direct-icalls-symbol-name
Add support for direct icalls using external functions not in icall-def.h.
Commit migrated from https://github.com/mono/mono/commit/
90869d7708c6edaae2a213624c9bf9f89a062fec
Jay Krell [Thu, 18 Apr 2019 08:10:47 +0000 (01:10 -0700)]
mono_remoting_marshal_init in mono_marshal_get_proxy_cancast to register icalls. (mono/mono#14097)
Alternatively move the registration to mono_remoting_init.
Commit migrated from https://github.com/mono/mono/commit/
c7e5f4150b74f5487710925e955d4068523fa162
Filip Navara [Thu, 18 Apr 2019 06:39:31 +0000 (08:39 +0200)]
[netcore] Fix failures in System.Tests.MulticastDelegateTests (mono/mono#14096)
Commit migrated from https://github.com/mono/mono/commit/
7e35b5128b99e3bb365184009b84c71a69fcfd05
Egor Bogatov [Thu, 18 Apr 2019 06:30:11 +0000 (09:30 +0300)]
[netcore] improve Windows support (mono/mono#14100)
* better Windows support
* remove unzip.py
* move FeaturePortableTimer to csproj
Commit migrated from https://github.com/mono/mono/commit/
61dbc22bfd40654fe66a03d45c23e2357575c7dd
Larry Ewing [Wed, 17 Apr 2019 22:55:00 +0000 (17:55 -0500)]
Merge pull request mono/mono#14088 from vargaz/wasm-direct-calls
[llvmonly] Allow direct calls to inflated methods since they can initialize themselves correctly now.
Commit migrated from https://github.com/mono/mono/commit/
93c45bae279f98b0c66349cab78a4f5d2ee83494
Larry Ewing [Wed, 17 Apr 2019 22:32:27 +0000 (17:32 -0500)]
Merge pull request mono/mono#14041 from kjpou1/wasm-sdk-packages
[wasm] [sdk] Build and package the sdk nugets.
Commit migrated from https://github.com/mono/mono/commit/
1cd911a844e3db5c31a390b13bb98dcd8ae5c32e
Vlad Brezae [Wed, 17 Apr 2019 18:47:48 +0000 (21:47 +0300)]
[interp] Small vt opcode optimisations (mono/mono#14040)
[interp] Simplify cpobj.vt
[interp] Optimize stelem.vt/ldelem.vt
[interp] Avoid unnecessary write barrier for ldobj.vt
Write barriers are only required for stores in the major heap/los.
[interp] Simplify ldfld.vt/stfld.vt
Commit migrated from https://github.com/mono/mono/commit/
3f113159169a7180bec6e187a2527aedbd10370c
Vlad Brezae [Wed, 17 Apr 2019 18:38:19 +0000 (21:38 +0300)]
[interp] Improve boxing/unboxing (mono/mono#14048)
* [interp] Remove redundant check
It can't be an enum if it is stored on the vtstack
* [interp] Optimize boxing
Makes boxing of primitives 4x faster and boxing of vt 3x faster.
* [interp] Remove unneccessary check in unbox
We do the same check as jit. Makes unboxing 10x faster.
* [interp] Extract some duplicate code for boxing
* [interp] Fix boxing of nullable with constrained calls
Before the box opcode optimization, it was handling nullable. When normally boxing a nullable we call the Box method, but this is awkward when doing a constrained call, so we just add a separate opcode. This is slightly slower than calling Box, but much faster than the old code using the generic mono_value_box_checked.
Commit migrated from https://github.com/mono/mono/commit/
183de1c3022f5b6f409349c05a1b405f9c79c2bf
lateralusX [Wed, 17 Apr 2019 15:04:08 +0000 (17:04 +0200)]
Review feedback.
Commit migrated from https://github.com/mono/mono/commit/
c31b4dd5b44410f145ae9b0b0d89993870ab6d8b
Egor Bogatov [Wed, 17 Apr 2019 14:39:38 +0000 (17:39 +0300)]
[netcore] Fix two System.Tests.PseudoCustomAttributeTests tests (mono/mono#14073)
Now all custom attribute related tests pass in System.Runtime.Tests.
Also this PR fixes broken acceptance tests for regular mono introduced in https://github.com/mono/mono/pull/13809
Commit migrated from https://github.com/mono/mono/commit/
afcd30d8c28f5eaa00f6e5ef46f0b1ae1fbc87b6
Vlad Brezae [Wed, 17 Apr 2019 13:40:07 +0000 (16:40 +0300)]
[interp] Fix interp strmfld vt (mono/mono#14086)
* [interp] Fix store remote value type field
Looks like the culprit for some random mcs tests failures
* [interp] Delete dummy code
Commit migrated from https://github.com/mono/mono/commit/
1b4a2a68f528b6fb2936d7b0a263e8070e4dd42b
Jay Krell [Wed, 17 Apr 2019 09:06:28 +0000 (02:06 -0700)]
Replace two element hash table with two element array and cheap linear search. (mono/mono#14049)
Replace two element hash table with two element array and cheap linear search.
Maybe I misunderstand the code?
Or significant expansion is expected?
Commit migrated from https://github.com/mono/mono/commit/
d882ea388a1bc5e24c1d1d2e3b3dbf5e169adeaa
Jay Krell [Wed, 17 Apr 2019 07:41:54 +0000 (00:41 -0700)]
Factor the function mono_call_add_patch_info out of a few lines of repeated code in many backends. (mono/mono#13970)
This notably does not apply to amd64, x86.
They have more logic intertwined around the patch when they emit the call.
Commit migrated from https://github.com/mono/mono/commit/
cd5e14a3ccaa76e6ba6c58b26823863a2d0a0854
Zoltan Varga [Tue, 16 Apr 2019 23:44:28 +0000 (19:44 -0400)]
[llvmonly] Add stubs for methods which cannot be compiled since they can be called directly.
Commit migrated from https://github.com/mono/mono/commit/
605ea1555cef59c21d6b061f563212cf6b940ee8
Jay Krell [Tue, 16 Apr 2019 22:37:10 +0000 (15:37 -0700)]
Remove a few string allocs/copies, i.e. for generic trampoline names. (mono/mono#14038)
Commit migrated from https://github.com/mono/mono/commit/
6a39d91078db76dcb99f8c973d638c87092488df
Bernhard Urban [Tue, 16 Apr 2019 22:36:05 +0000 (00:36 +0200)]
[arm] align stack pointer in throw trampoline (mono/mono#14078)
This is a regression introduced by mono/mono@
e46fa20466010a18b9b9a8130f6d8c62899780b3
Fixes https://github.com/mono/mono/issues/13672
Commit migrated from https://github.com/mono/mono/commit/
98a1d40584b5e40052c93d0e4059f821ee1609fa
Zoltan Varga [Tue, 16 Apr 2019 20:39:21 +0000 (16:39 -0400)]
[llvmonly] Make direct calls to more methods, not enabled yet.
Commit migrated from https://github.com/mono/mono/commit/
61d6860f217edf521c71193bc9ed7fc2e8cf47f9
Zoltan Varga [Tue, 16 Apr 2019 20:38:52 +0000 (16:38 -0400)]
[aot] Prepend the assembly name to the mangled method names.
Commit migrated from https://github.com/mono/mono/commit/
d257f7a6638600fe737c0ef24204769eb4148f4e
Zoltan Varga [Tue, 16 Apr 2019 18:55:05 +0000 (14:55 -0400)]
[netcore] Allow cross-module direct calls to alloc wrappers.
Commit migrated from https://github.com/mono/mono/commit/
3ef6463a033d003fde8f38f814e91d9ccfeb60d7
Zoltan Varga [Tue, 16 Apr 2019 17:19:19 +0000 (13:19 -0400)]
[llvmonly] Allow direct calls to inflated methods since they can initialize themselves correctly now.
Commit migrated from https://github.com/mono/mono/commit/
b71e29a62def1c2052703d1fb50d0c429ef87cd8
Zoltan Varga [Tue, 16 Apr 2019 15:30:16 +0000 (11:30 -0400)]
[aot] Change how the context is computed in init_aot_method (). Instead of (mono/mono#14026)
getting it from the caller, save it in the aot image and read it back.
This will make it possible to emit direct calls to gshared methods later.
Commit migrated from https://github.com/mono/mono/commit/
1c568bf16f8baead9952c094967beb262bc344e5
Jay Krell [Tue, 16 Apr 2019 11:34:46 +0000 (04:34 -0700)]
Register mono_gc_wbarrier_generic_nostore_internal regular with its own name, not dynamic with a special name. (mono/mono#14042)
Commit migrated from https://github.com/mono/mono/commit/
18f0bf055eb2bfa8981062bdad3af2fb4bbc9be4
Jay Krell [Tue, 16 Apr 2019 11:34:29 +0000 (04:34 -0700)]
Register g_free icall regular, as monoeg_g_free. (mono/mono#14044)
The point here is that register_dyn is a bit obscure and could use clarification.
Commit migrated from https://github.com/mono/mono/commit/
6225a9b031fd9d70d23cbb0139b471238e7616f5
Egor Bogatov [Tue, 16 Apr 2019 10:04:02 +0000 (13:04 +0300)]
[netcore] Fix WaitHandle.SignalAndWait (mono/mono#13809)
* fix failing tests
* Add build-corefx-test-for- rule
* Update WaitHandle.cs
* fix S.T.T.rsp file
* fix build
* bump corlib version
* handle new errors in old mono
* Update w32handle.c
Commit migrated from https://github.com/mono/mono/commit/
8cd9b562ea9d79459e1646ba2eb8936b99292511
Egor Bogatov [Tue, 16 Apr 2019 09:51:26 +0000 (12:51 +0300)]
[netcore] Fix System.Tests.PseudoCustomAttributeTests.* tests (mono/mono#14065)
* fix Custom Attribute tests
* fix CA
* fix CA
* Update MonoCustomAttrs.cs
* fix MarshalAsAttribute
* Update MarshalAsAttribute.cs
* Update MarshalAsAttribute.cs
Commit migrated from https://github.com/mono/mono/commit/
d2054f6cc0021cbad644de2d94191574d1ad01c4
Zoltan Varga [Tue, 16 Apr 2019 09:48:12 +0000 (05:48 -0400)]
[netcore] Add linker descriptor for corelib. (mono/mono#14064)
* [netcore] Add linker descriptor. This is just a copy of the mscorlib descriptor.
* [netcore] Update linker descriptor for netcore.
* Remove com/remoting related classes.
* Other smaller changes.
* [netcore] Allow loading corlib from MONO_PATH.
* Update System.Private.CoreLib.xml
Commit migrated from https://github.com/mono/mono/commit/
edae380da5d29fa9267a612aadc1cd4a2541b18f
Kenneth Pouncey [Tue, 16 Apr 2019 03:20:44 +0000 (05:20 +0200)]
Merge branch 'master' of https://github.com/mono/mono into wasm-sdk-packages
Commit migrated from https://github.com/mono/mono/commit/
81b0163bca3ca81186ac98ead7eff7ed99fba45a
Zoltan Varga [Mon, 15 Apr 2019 23:23:05 +0000 (19:23 -0400)]
[llvmonly] Fix a buffer overflow. (mono/mono#14057)
Commit migrated from https://github.com/mono/mono/commit/
9d91df98df39ab89e8afb71d766c5642f8815fdb
Bernhard Urban [Mon, 15 Apr 2019 22:25:51 +0000 (00:25 +0200)]
[aot] change method table generation so that it works for larger assemblies on ARM (mono/mono#14043)
[aot] change method table generation so that it works for larger assemblies on ARM
At the end of the AOT compilation, we dump a table containing all method
entrypoints using the toolchain linker to resolve the addresses. Previously
we used `bl` for that, however on larger assemblies the offset might
overflow the 24bit immediate (thus, the linker bailing out with
"Error: branch out of range"). Instead, using `ldr pc,=<label>` followed
by `.ltorg` emits the full 32bit address to a method. That takes 8 bytes
for each method instead of 4 bytes.
( I couldn't reopen https://github.com/mono/mono/pull/3486 anymore)
Commit migrated from https://github.com/mono/mono/commit/
9ff3b0d65ee401616ac08fe43530d7a27bbe5902
Filip Navara [Mon, 15 Apr 2019 13:02:47 +0000 (15:02 +0200)]
[netcore] Misc. fixes (mono/mono#14050)
* Check for lower bounds on non-zero-based arrays
* Grab correct version of System.Reflection.Context
* Move Attribute type validation to fix checking for custom attributes using interface types
* Fix parameter checks
Commit migrated from https://github.com/mono/mono/commit/
012ac05aa9de47ae421af4c0e7d0724de2d18d82
Vlad Brezae [Mon, 15 Apr 2019 12:35:34 +0000 (15:35 +0300)]
[interp] Static field access fixes (mono/mono#14009)
* [interp] Further optimize static vt field access
We don't require any write barrier checking since we always copy between interpreter vt_stack and static data. We can also include the vt size in the code stream. Makes it over 1.5x times faster.
* [interp] Fix static field access using ldfld/stfld
Static field access using the ldfld/stfld instructions was not updated when stsfld/ldsfld were optimized.
* [interp] Fix special static vtype field access
Commit migrated from https://github.com/mono/mono/commit/
79f15ccd35a0f921a2ff6744d564cbc47d8877d0
Filip Navara [Mon, 15 Apr 2019 09:30:46 +0000 (11:30 +0200)]
[netcore] Switch to msbuild nuget which is available for all platforms (mono/mono#13989)
* Switch to msbuild nuget which is available for all platforms
* Remove check-env rule dependency
* Add missing reference to System.Composition.TypedParts
* Sort references by name
Commit migrated from https://github.com/mono/mono/commit/
8c85c298411bc43f2af66f9ca65e0c2d0293d52a
Egor Bogatov [Mon, 15 Apr 2019 06:34:23 +0000 (09:34 +0300)]
[netcore] Do not inline if [DynamicSecurityMethod] exists (mono/mono#14032)
* fix crash
* fix build
Commit migrated from https://github.com/mono/mono/commit/
2a8028f7ceea0724909b21eac54db8d84e3bc58d
Jay Krell [Sun, 14 Apr 2019 19:58:17 +0000 (12:58 -0700)]
Remove redundant check of llvm_acfg->aot_opts.direct_icalls. (mono/mono#14028)
Commit migrated from https://github.com/mono/mono/commit/
cfdcf29478ff3f3aeb634ed525fe00744020f845
Filip Navara [Sun, 14 Apr 2019 16:58:40 +0000 (18:58 +0200)]
[netcore] Make System.Private.CoreLib and host APIs compilable on Windows (mono/mono#13943)
* Fix Windows builds of CLR hosting API
* Make System.Private.CoreLib compilable on Windows
* Remove accidental change
* Fix Unix build
* Update GlobalizationMode.cs
* Update GlobalizationMode.Unix.cs
Commit migrated from https://github.com/mono/mono/commit/
7ac572217da6f4a2b0eb33ee645b07494b26a33c
Jay Krell [Sun, 14 Apr 2019 14:24:18 +0000 (07:24 -0700)]
Remove constant parameter to mono_tls_get_tls_setter and mono_tls_get_tls_getter. (mono/mono#13894)
It doesn't matter, but for code clarity.
Also strengthen the types of both of these, though rarely enough to avoid casts.
Commit migrated from https://github.com/mono/mono/commit/
568c822ae9c23acecff478a2deaeb81e942ffbc1
Vlad Brezae [Fri, 12 Apr 2019 18:50:05 +0000 (21:50 +0300)]
[interp] Optimize ldobj/stobj (mono/mono#13761)
* [interp] Remove dead code
It doesn't make sense to dereference a value type
* [interp] Emit faster instructions for ldobj
* [interp] Emit faster instructions for stobj
* [interp] Simply ldobj vt
This makes it 10x faster
* [interp] Make ldind.r8 unaligned friendly
Commit migrated from https://github.com/mono/mono/commit/
e30e45f94be90063554ce191bdadae06f9f5f3f4
Jay Krell [Thu, 11 Apr 2019 10:03:52 +0000 (03:03 -0700)]
Increase gsharedvt trampolines by 10% from 4000 to 4400.
There are many minor arguments here.
Where this matters most -- iOS -- the pool is already dynamic.
Other platforms could use a dynamic pool or JIT (despite FullAOT).
Using JIT would defeat the test coverage.
Mitigates https://github.com/mono/mono/issues/13888.
If this feels too tenative, go bigger.
Commit migrated from https://github.com/mono/mono/commit/
22bbf4416a64beb12ec2b0b5c7293892a12f0660
Maxim Lipnin [Thu, 11 Apr 2019 12:51:27 +0000 (15:51 +0300)]
[w32error] Add ENONET error case
Commit migrated from https://github.com/mono/mono/commit/
ded4fa6558b689631006f4d15e318f857ee02b22
Zoltan Varga [Thu, 11 Apr 2019 13:19:42 +0000 (09:19 -0400)]
[jit] Make dlmalloc use mono_valloc so it picks up the MAP_JIT flag on osx. (mono/mono#13979)
Fixes https://github.com/mono/mono/issues/13878.
Commit migrated from https://github.com/mono/mono/commit/
5036336df811fe55d4721c2ef9b1152456ddb32a
Miguel de Icaza [Thu, 11 Apr 2019 12:38:17 +0000 (08:38 -0400)]
[debugger-agent]: Print error if the socket can not be created, remove assert that probed the wrong value, Coverity 1307166 (mono/mono#13860)
Commit migrated from https://github.com/mono/mono/commit/
56db577988d3b2244d64d32e5f885126641b2332
Zoltan Varga [Sun, 7 Apr 2019 21:20:31 +0000 (17:20 -0400)]
[jit] Disable inlining for methods with [System.Security.DynamicSecurityMethod], its used to make methods which contain a StackCrawlMark.
Also check that the attribute is present for StackMaekMark locals.
Commit migrated from https://github.com/mono/mono/commit/
8b1a18784dd17b1a683f3d73ecb51d5b2c7f974f
Marek Safar [Thu, 11 Apr 2019 09:08:41 +0000 (11:08 +0200)]
Merge pull request mono/mono#13815 from radical/nuget-5
[nuget] Bump to nuget 5.0.0
Commit migrated from https://github.com/mono/mono/commit/
995bbb998c638b3fe563dbaa5aff6c5198d1d5ce
Filip Navara [Thu, 11 Apr 2019 08:31:22 +0000 (10:31 +0200)]
[netcore] Implement Assembly.GetExecutingAssembly with stack mark parameter (mono/mono#13903)
* Implement Assembly.GetExecutingAssembly with stack mark parameter
* Address PR feedback
Commit migrated from https://github.com/mono/mono/commit/
8ba5a5201f0a7aeb35d33709186ddfa0eb4d9d68
Filip Navara [Thu, 11 Apr 2019 08:31:11 +0000 (10:31 +0200)]
[netcore] Fix marshalling of ref ptr return types (mono/mono#13914)
* Fix marshalling of ref ptr return types
* Revert assert -> exception change
Commit migrated from https://github.com/mono/mono/commit/
847296f1f0f71468fb08d1c6b48a4a1775f94c5c
Filip Navara [Thu, 11 Apr 2019 08:30:59 +0000 (10:30 +0200)]
Do not crash the runtime in System.Reflection.Emit.ILGeneration tests (mono/mono#13917)
Commit migrated from https://github.com/mono/mono/commit/
a26f73dcd97f839bbddd7f8b9b1b121c7e2bb099
Johan Lorensson [Thu, 11 Apr 2019 08:18:47 +0000 (04:18 -0400)]
Merge pull request mono/mono#13959 from filipnavara/link-windows
[windows] Link libgcc statically on Windows
Commit migrated from https://github.com/mono/mono/commit/
562ac284e4e4705384b129712f8c1fbb897bf69e
Johan Lorensson [Thu, 11 Apr 2019 06:58:59 +0000 (02:58 -0400)]
Merge pull request mono/mono#13946 from lateralusX/lateralusX/merge-icall-hash-maps
Merge icall_hash and icall_hash_foreign into one.
Commit migrated from https://github.com/mono/mono/commit/
0c1489b83687f1cd76748a557eba7414adfdd20c
Thays Grazia [Wed, 10 Apr 2019 22:25:49 +0000 (19:25 -0300)]
Cleaning exceptions during static constructor loading (mono/mono#13962)
Cleaning exceptions during static constructor loading
Reset the stack_trace and trace_ips because the type initialization exception is reused.
Fixes mono/mono#13714
Commit migrated from https://github.com/mono/mono/commit/
bf8d7ef448d340e464c3a5443cdfbbb5b1863cf3
Jo Shields [Wed, 10 Apr 2019 19:46:09 +0000 (15:46 -0400)]
Merge pull request mono/mono#13976 from directhex/another-llvm-symbol
Add another symbol for loadedllvm
Commit migrated from https://github.com/mono/mono/commit/
9d4d20b38907c0b8909d2d51154444e4be0122fd
Jo Shields [Wed, 10 Apr 2019 19:45:30 +0000 (15:45 -0400)]
Add another symbol for loadedllvm
Closes https://github.com/mono/mono/issues/13974
Commit migrated from https://github.com/mono/mono/commit/
8fa16b329ca14d144c38e12b452830e55778a559
Marek Safar [Wed, 10 Apr 2019 17:08:07 +0000 (19:08 +0200)]
Merge pull request mono/mono#13972 from filipnavara/netcore-nullability
[netcore] Disable nullability-related warnings
Commit migrated from https://github.com/mono/mono/commit/
c10e8da1b5ba21056eae5368e65a2679f5b6a9f8
Marek Safar [Wed, 10 Apr 2019 17:07:08 +0000 (19:07 +0200)]
Merge pull request mono/mono#13963 from Dotnet-GitSync-Bot/mirror-merge-
10135517
Mirror changes from mono/corefx,coreclr,corert
Commit migrated from https://github.com/mono/mono/commit/
e1164a8dbde92f203f286d1ffb4dac1198a57829
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
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
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
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
lateralusX [Tue, 2 Apr 2019 12:16:20 +0000 (14:16 +0200)]
Merge icall_hash and icall_hash_foreign into one.
icalls registered with mono_add_internal_call, mono_add_internal_call_with_flags
or mono_add_internal_call_internal ended up in two different hash tables
depending if they were "foreign" or not. This caused double lookups in
mono_lookup_internal_call_full. There are also use cases where it could be
interesting to keep additional flags related to the icall, that could be
used by codegen for various optimization.
This PR merge the two hash tables into one and add a flag describing icall
details. The flag could later be extended with additional behaviors going
forward if needed.
Commit migrated from https://github.com/mono/mono/commit/
18bba37796444b5339cac84a2f89e5c14b6961fd
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
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
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
Filip Navara [Tue, 9 Apr 2019 16:52:12 +0000 (18:52 +0200)]
Link libgcc statically on Windows
Commit migrated from https://github.com/mono/mono/commit/
f90133579f522ec794fec6a5c218c41e9ca07ada
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
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
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
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
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
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
lateralusX [Mon, 8 Apr 2019 15:33:34 +0000 (17:33 +0200)]
Add support for direct icalls not defined in icall-def.h.
An icall declaration can now use the following attribute:
MonoDirectICallSymbolNameAttribute("MyNativeCFunction")
and if not already defined in icall-def.h and direct-icalls are used when
AOT compile the assembly, a direct call will use symbol defined in attribute
as the symbol for direct call. Using this attribute will also enable inlining
for the specific icall wrapper generating inlined direct icalls to external
defined native methods.
This feature is valuable when embedding the runtime and extend with icalls
added using mono_add_internal_call. By applying the above attribute, it is
possible to do AOT with direct-icalls and get static linked icalls without
the need to extend and rebuild cross compiler in the process.
Commit migrated from https://github.com/mono/mono/commit/
491a4d5da8e523d6191e6027ea7f3cee226d6ba8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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