EgorBo [Thu, 22 Aug 2019 22:12:47 +0000 (01:12 +0300)]
ignore FSW test
Commit migrated from https://github.com/mono/mono/commit/
71dce6502a5b75e74ef765e2d2b9e674680e9a80
EgorBo [Thu, 22 Aug 2019 20:08:44 +0000 (23:08 +0300)]
ignore more tests
Commit migrated from https://github.com/mono/mono/commit/
692f70cb677a127499abf930035982386f391026
EgorBo [Thu, 22 Aug 2019 18:47:45 +0000 (21:47 +0300)]
Disable the whole System.ComponentModel.Composition namespace
Commit migrated from https://github.com/mono/mono/commit/
40cf68aa98078d5dd6c62ec21db5e0e9366a6b1c
EgorBo [Thu, 22 Aug 2019 17:53:14 +0000 (20:53 +0300)]
fix macOS
Commit migrated from https://github.com/mono/mono/commit/
7678654781869c0507f6dd07c9756a9ab666f991
EgorBo [Thu, 22 Aug 2019 16:02:53 +0000 (19:02 +0300)]
update rsp
Commit migrated from https://github.com/mono/mono/commit/
779fda51037cc4540e844b9760538d2bafae04e4
EgorBo [Thu, 22 Aug 2019 15:52:52 +0000 (18:52 +0300)]
ignore some tests
Commit migrated from https://github.com/mono/mono/commit/
f809fe55a88438009390a25e871d1952780dc02e
Zoltan Varga [Wed, 21 Aug 2019 03:14:44 +0000 (23:14 -0400)]
Merge pull request mono/mono#16363 from vargaz/tp-thread-name
[runtime] Avoid resetting the tp thread name on every call to worker_callback ().
Commit migrated from https://github.com/mono/mono/commit/
977ccf7cb2553d249419d38c1f159bfde923b63b
Zoltan Varga [Wed, 21 Aug 2019 03:11:27 +0000 (23:11 -0400)]
Merge pull request mono/mono#16286 from vargaz/netcore-simd
[netcore] Add a netcore version of simd-intrinsics.c.
Commit migrated from https://github.com/mono/mono/commit/
285f33efe6cd3ead92210ffea244edfc5112e3c2
Alexander Köplinger [Tue, 20 Aug 2019 17:59:27 +0000 (19:59 +0200)]
Fix Windows build
Commit migrated from https://github.com/mono/mono/commit/
38c524cc2ad83001b3b2be28e9c7f25cbc126ca2
Alexander Köplinger [Tue, 20 Aug 2019 17:44:37 +0000 (19:44 +0200)]
[profiler] Rename helper functions to have common prefix
Unfortunately https://github.com/mono/mono/pull/16335 didn't fix the new symbols showing up in the log profiler module.
The reason is that we actually pass `--disable-visibility-hidden` for iOS builds in https://github.com/mono/mono/blob/mono/mono@
0b6d95e8ce7c882e2db9e89fa0dec850c687f65e/sdks/builds/ios.mk#L98.
Rename the helper functions instead to have a common prefix so they can be ignored in xamarin-macios tests.
Commit migrated from https://github.com/mono/mono/commit/
55f2c4d6ad8ace7690668c64378248571871c7eb
Aleksey Kliger [Mon, 19 Aug 2019 16:21:21 +0000 (12:21 -0400)]
[w32socket] Translate some errno codes to WSA_ errors imprecisely.
These aren't a perfect match, but better than falling into the `default` case
where Mono asserts and crashes.
Addresses part of https://github.com/mono/mono/issues/16024
Commit migrated from https://github.com/mono/mono/commit/
ed0063b4d593436c531e851054127a64a133be18
Aleksey Kliger [Mon, 19 Aug 2019 16:25:40 +0000 (12:25 -0400)]
[w32error] Add WSA_INVALID_PARAMETER and WSA_INVALID_HANDLE
Commit migrated from https://github.com/mono/mono/commit/
c38044d74fcdc7bedda20153917bf1ed63f0eedc
Ryan Lucia [Tue, 20 Aug 2019 18:33:39 +0000 (14:33 -0400)]
[netcore] Remove local copy of static alc resolve methods
Commit migrated from https://github.com/mono/mono/commit/
fc5e3fa0394b112ab238e1cf67a755c0f1bc8b00
Ryan Lucia [Tue, 20 Aug 2019 16:55:54 +0000 (12:55 -0400)]
[netcore] Remove unnecessary calls to mono_domain_get (mono/mono#16336)
Should use mono_alc_domain where possible
Commit migrated from https://github.com/mono/mono/commit/
0b6d95e8ce7c882e2db9e89fa0dec850c687f65e
Alexander Köplinger [Tue, 20 Aug 2019 15:59:55 +0000 (17:59 +0200)]
[netcore] Consolidate running tests between AzDO pipeline and Makefile (mono/mono#16348)
* [netcore] Consolidate running tests between AzDO pipeline and Makefile
There was some unnecessary duplication between the two that we can remove.
* Add timeout to test execution
Commit migrated from https://github.com/mono/mono/commit/
5dc4a86d9dde59823224d6dfe1f0e0bcb68e39b4
Zoltan Varga [Tue, 20 Aug 2019 15:32:46 +0000 (11:32 -0400)]
Fix the build.
Commit migrated from https://github.com/mono/mono/commit/
8a413fad719ca9068dfd36f0cb39ca94d6c8de2f
Zoltan Varga [Tue, 20 Aug 2019 15:02:01 +0000 (11:02 -0400)]
[runtime] Avoid resetting the tp thread name on every call to worker_callback ().
Commit migrated from https://github.com/mono/mono/commit/
b5cfeb3b5b350758867513de735ebf1ddf42b57e
Jo Shields [Tue, 20 Aug 2019 14:17:26 +0000 (10:17 -0400)]
Pass -fvisibility=hidden to profiler modules. (mono/mono#16335)
* Pass -fvisibility=hidden to profiler modules.
This appears to not break the profilers:
```
directhex@breakfast:/tmp$ nm -g /tmp/ponyponyponypony/lib/libmono-profiler-log.so | grep close_socket_fd
directhex@breakfast:/tmp$
directhex@breakfast:/tmp$ /tmp/ponyponyponypony/bin/mono --profile=log:report bottle.exe
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 99 bottles of beer on the wall.
[..]
No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.
Mono log profiler data
Profiler version: 3.0
Data version: 17
Arguments: log:report
Architecture: x86-64
Operating system: linux
Mean timer overhead: 86 nanoseconds
Program startup: Mon Aug 19 14:18:30 2019
Program ID: 17715
Server listening on: 41539
JIT summary
Compiled methods: 753
Generated code size: 228046
JIT helpers: 0
JIT helpers code size: 0
GC summary
GC resizes: 0
Max heap size: 0
Object moves: 0
Metadata summary
Loaded images: 3
Loaded assemblies: 3
Exception summary
Throws: 0
Executed finally clauses: 3
Thread summary
Thread: 0x7fcd968c9700, name: "Finalizer"
Thread: 0x7fcd966c8700, name: "Profiler Sampler"
Thread: 0x7fcd9b036780, name: "Main"
Thread: 0x7fcd964c7700, name: "Profiler Helper"
Thread: 0x7fcd954c5700, name: "Profiler Dumper"
Thread: 0x7fcd95cc6700, name: "Profiler Writer"
Domain summary
Domain: (nil), friendly name: "bottle.exe"
Context summary
Context: (nil), domain: (nil)
Counters:
Mono System:
User Time : 70.000ms
System Time : 0.000ms
Total Time : 140.000ms
Working Set :
22032384
Private Bytes :
63455232
Virtual Bytes :
449630208
Page Faults : 3004
CPU Load Average - 1min : 1.870000
CPU Load Average - 5min : 2.670000
CPU Load Average - 15min : 2.900000
Mono JIT:
Methods from AOT : 536
Methods JITted using mono JIT : 154
Methods JITted using LLVM : 0
```
* Add missing annotations and includes
Commit migrated from https://github.com/mono/mono/commit/
3070ab6a96c98c2f31116db691d789ac8ec970e7
Jay Krell [Tue, 20 Aug 2019 13:53:25 +0000 (06:53 -0700)]
[interp] Outline box_nullable. (mono/mono#16356)
Without being entirely scientific about it, this case seems
to be one that uses more than typical locals and therefore
be on a sort of critical path to reduce frame size.
I have a change that reduces frame to 0x78 bytes (albeit
not yet working) and to achieve that, in this case I refetched
the locals after function calls.
This achieves similar but perhaps more elegantly.
If we rest at larger frame size then this case might not be on the critical path.
https://github.com/mono/mono/issues/16172.
Commit migrated from https://github.com/mono/mono/commit/
169205813b7d8f75a435edc092c8aa6678754711
Jay Krell [Tue, 20 Aug 2019 11:03:12 +0000 (04:03 -0700)]
[interp] Reduce register/stack pressure esp. around vtable initialization. (mono/mono#16349)
Part of mono/mono#16172 though not necessarily any gain from this change, at this time.
Commit migrated from https://github.com/mono/mono/commit/
ea29349f77df3a4eb553300c1b694afe656cd56a
Alexander Köplinger [Tue, 20 Aug 2019 10:04:30 +0000 (12:04 +0200)]
[interp] Reduce register/stack pressure slightly, i.e. so that `field` does not have (mono/mono#16339)
to be preserved across `mono_get_special_static_data ()` if non-volatile registers
are all otherwise allocated.
Commit migrated from https://github.com/mono/mono/commit/
b205f1bd9cb9b6c19b90aab1de6d20c45be3bb4f
Jay Krell [Tue, 20 Aug 2019 10:03:48 +0000 (03:03 -0700)]
[interp] Relieve register/stack pressure around mono_thread_internal_current. (mono/mono#16341)
Part of mono/mono#16172 though not necessarily any gain from this change, at this time.
We might want to expose ifdef and inline mono_thread_internal_current also or instead.
Commit migrated from https://github.com/mono/mono/commit/
33153ddd2d02b55a13d11d670b8742c15264fadf
Jay Krell [Tue, 20 Aug 2019 09:47:38 +0000 (02:47 -0700)]
Fix warnings. (mono/mono#16287)
debug-mono-ppdb.c ppdb_compressed_size may be used uninitialized
ppdb_size may be used uninitialized
image.c iinfo set but not used
icall.c klass set but not used
Commit migrated from https://github.com/mono/mono/commit/
bc2accfc7edae72d24390b1c72534ff8bdcdcde6
Alexander Köplinger [Mon, 19 Aug 2019 21:52:01 +0000 (23:52 +0200)]
[netcore] Use Release configuration for CI builds (mono/mono#16329)
* [netcore] Use Release configuration for CI builds
Fixes https://github.com/mono/mono/issues/16308
* [ci] Ensure the artifacts/logs/Release folder exists
Some arcade steps need the path to exist and we only create artifacts/logs/Debug right now,
because that folder is created by eng/common/tools.sh used by init-tools.sh defaulting to Debug.
Commit migrated from https://github.com/mono/mono/commit/
9a5ae23f7e3d49b0b32ae423513d2344a837d698
Jay Krell [Mon, 19 Aug 2019 21:48:20 +0000 (14:48 -0700)]
[interp] Inline MINT_NEWOBJ_VTST_FAST (mono/mono#16314)
For purposes of stack savings, only MINT_NEWOBJ_VT_FAST w/o the "ST"
needed to be outlined, and inlining also the ST form increased
its stack use, w/o savings elsewhere.
That is, the recursive cases should generally not be outlined.
We were outlining two. We still outline one.
This is partially undoing my recent change, where I outlined both of these, but only one was justified.
Commit migrated from https://github.com/mono/mono/commit/
31aed632bab5f0cdd379640296ebcf4c14482461
Jay Krell [Mon, 19 Aug 2019 19:59:36 +0000 (12:59 -0700)]
[interp] Reduce register/stack pressure slightly, i.e. so that `field` does not have
to be preserved across `mono_get_special_static_data ()` if non-volatile registers
are all otherwise allocated.
Commit migrated from https://github.com/mono/mono/commit/
2313f1a88402784d6930ac3c73c990548a3ff1f1
Ryan Lucia [Mon, 19 Aug 2019 18:50:15 +0000 (14:50 -0400)]
[netcore] Update ALC test exclusions (mono/mono#16332)
Commit migrated from https://github.com/mono/mono/commit/
7c3dfbcbdf46d057ae4f145a8ddfc8e193d90ef5
Aleksey Kliger (λgeek) [Mon, 19 Aug 2019 15:01:09 +0000 (11:01 -0400)]
[coop] Add a handle frame in construct_culture (mono/mono#16299)
Otherwise we see warnings like these:
```
ves_icall_System_Globalization_CultureInfo_internal_get_cultures_raw USED 680 handles
```
Commit migrated from https://github.com/mono/mono/commit/
2f0cbb5aa5801144aa887a164f4c95ef146686a8
Vincent Povirk [Mon, 19 Aug 2019 11:09:14 +0000 (06:09 -0500)]
eglib: Remove broken executable test on Windows. (mono/mono#16295)
The strcmp is wrong, and it doesn't test anything meaningful anyway.
This flag is unused since mono/mono#16156 was merged.
Commit migrated from https://github.com/mono/mono/commit/
9f790cd5e2c2b5b998ce9ccdf5c4d67d8ad31507
Jay Krell [Mon, 19 Aug 2019 09:50:20 +0000 (02:50 -0700)]
[interp] Remove InterpFrame.locals, replace with reasonably efficient frame_locals macro.o (mono/mono#16317)
Contributes to mono/mono#16172.
Commit migrated from https://github.com/mono/mono/commit/
8886f71b2cb957cdf3f967d8251ec9a6102e358f
Alexander Köplinger [Mon, 19 Aug 2019 09:24:44 +0000 (11:24 +0200)]
[interp] Put finally data back in locals instead of frame to save 16 bytes of stack. (mono/mono#16307)
* Put finally data back in locals instead of frame to save 16 bytes of stack.
Partial undo of mono/mono@
f8fd60b5c088753a4a0ccb79483ebae73489e7a2.
* Add comments explaining goto main_loop vs. MINT_IN_DISPATCH.
Commit migrated from https://github.com/mono/mono/commit/
e754bb1c430d5ae65056c01fd5ef1f370ff2150a
Jay Krell [Mon, 19 Aug 2019 09:24:11 +0000 (02:24 -0700)]
[interp] Outline ves_array_element_address to save 16 bytes of stack on Linux/amd64/clang. (mono/mono#16304)
Contributes to mono/mono#16172.
Commit migrated from https://github.com/mono/mono/commit/
60cd1b35565e8a4553cc1d70de204ecb96ed54fa
Alexander Köplinger [Mon, 19 Aug 2019 09:23:23 +0000 (11:23 +0200)]
thread names: coop, constants, usually ignore-error. (mono/mono#16272)
- Convert setting thread name to be coop-compatible.
- For constant thread names, just retain the constant, not a copy.
This includes producing and using constant unicode thread names on Windows.
- Make setting a thread name often non-fatal, except where mandated by public API.
- From earlier PR: mono_free (mono-publib.c) would no longer be referenced and therefore
no longer exported. That broke profilers and maybe other externals.
Choices:
1 Use it instead of g_free randomly sometimes.
2 Call it randomly sometimes.
3 include it in external-only.c or object.c
4 Mark it external only (breaks profiler).
5 Use a .def file or Unix equivalent.
5 is best, 2 is done here, the advantages/disadvantages
among most choices are subtle. 3 is probably better than 2
but is slightly bigger change, to put off -- you'd stop
compiling mono-publib.c and move it to include/extra_redist.
The advantage of not-.def file is perhaps that it is exposed
by the compiler, so maybe easy to port and work with.
People are more comfortable with obscure C extensions than
any linker options, and there are multiple linkers to contend
with. Arguably there are fewer compilers.
Commit migrated from https://github.com/mono/mono/commit/
9001c4fa83aa2327038627e9f003ce9432a8e8d5
Jay Krell [Mon, 19 Aug 2019 09:20:37 +0000 (02:20 -0700)]
Reduce size of internal MonoErrors by 3 pointers, while trying to be compatible with old size.(mono/mono#16218)
There is an incompatibility here.
If Mono hands off an InternalError and it is accessed
like an ExternalError, like memset(sizeof()), bad.
Hopefully nobody does that.
There is also compatability -- embedders can continue to embed MonoError
in their own data. Its size and hopefully alignment is unchanged.
Commit migrated from https://github.com/mono/mono/commit/
cf0ce4f55ad92529bf969bef1cbf5cc6a502fdef
Jay Krell [Mon, 19 Aug 2019 09:19:10 +0000 (02:19 -0700)]
[interp] Replace frame.args with frame.stack, the same except for type (mono/mono#16316)
Contributes to mono/mono#16172.
Commit migrated from https://github.com/mono/mono/commit/
047c7d35faa441e9d73364b681e5826a7c00051f
Vlad Brezae [Mon, 19 Aug 2019 08:59:21 +0000 (11:59 +0300)]
[interp] Make sure we allocate stack for MINT_LD_DELEGATE_INVOKE_IMPL (mono/mono#16224)
* [interp] Make sure we allocate stack for MINT_LD_DELEGATE_INVOKE_IMPL
This opcode is pushing a function pointer from the delegate, so it needs to have stack reserved.
* [interp] Fix overflow of stack space
Commit migrated from https://github.com/mono/mono/commit/
975b543e92e296db338ac699c8d87c46f1fbbe42
Jay Krell [Mon, 19 Aug 2019 03:22:06 +0000 (20:22 -0700)]
warning: mono-threads-wasm.c no previous prototype for function mono_background_exec (mono/mono#16289)
Commit migrated from https://github.com/mono/mono/commit/
cecea63691e412e0363de91a9bea594caf1ae2cc
Jay Krell [Sun, 18 Aug 2019 14:36:33 +0000 (07:36 -0700)]
[interp] Reduce register/stack pressure slightly. (mono/mono#16303)
No savings on Linux/amd64/gcc/clang.
Commit migrated from https://github.com/mono/mono/commit/
d1f47e7b48826abd41eaab5c492f41cf4d22ac3f
Zoltan Varga [Sun, 18 Aug 2019 12:48:15 +0000 (08:48 -0400)]
Fix the build.
Commit migrated from https://github.com/mono/mono/commit/
e1b57c371a98cfc9f35ee5b900edf56fa26b7e5f
Zoltan Varga [Sun, 18 Aug 2019 10:08:31 +0000 (06:08 -0400)]
Implement a subset of Intel BMI1/BMI2 intrinsics used by corelib.
Commit migrated from https://github.com/mono/mono/commit/
4503b67a0bd311bdba7ce8a2d22191c281803798
Zoltan Varga [Sun, 18 Aug 2019 09:24:42 +0000 (05:24 -0400)]
Add support for Bmi1 instrinsics.
Commit migrated from https://github.com/mono/mono/commit/
7337a3e405d760af92ca72a9ca2f6cfdfbc97125
Zoltan Varga [Sun, 18 Aug 2019 09:23:15 +0000 (05:23 -0400)]
Make simd-methods-netcore.h less verbose.
Commit migrated from https://github.com/mono/mono/commit/
157bb9f4e3aabed6e71513462c83f5ce1d60ac36
Zoltan Varga [Sun, 18 Aug 2019 07:18:24 +0000 (03:18 -0400)]
[jit] Don't mark ThrowForUnsupportedVectorBaseType<T> as do-not-return. Assert that do-not-return methods actually don't return.
Commit migrated from https://github.com/mono/mono/commit/
121d9ca4a9012b3669e7f62b30b78e37e728d017
Zoltan Varga [Sun, 18 Aug 2019 06:01:10 +0000 (02:01 -0400)]
[llvm] Add support for 32 byte AVX types, not enabled yet.
Commit migrated from https://github.com/mono/mono/commit/
7e76abb4caa5de32fbe1299d293767fe4e809ade
Zoltan Varga [Sun, 18 Aug 2019 05:57:14 +0000 (01:57 -0400)]
[llvm] Compute cpu features lazily.
Commit migrated from https://github.com/mono/mono/commit/
1a9f9fb927939bd9939ad884a72ff8f4d4d95cc7
Zoltan Varga [Sun, 18 Aug 2019 05:55:25 +0000 (01:55 -0400)]
[jit] Enable alias analysis dce even if there are no ldaddr instructions eliminated, they could have been eliminated earlier. Enable only for netcore for now.
Commit migrated from https://github.com/mono/mono/commit/
3c6e8de0daadeddcbf9a6e8f8a1c12854f2dd54e
Zoltan Varga [Sun, 18 Aug 2019 04:50:34 +0000 (00:50 -0400)]
[llvm] Fix support for 32 byte simd values.
Commit migrated from https://github.com/mono/mono/commit/
c0e03ef28f69153fde6fe5ac34b4d1284a85ee3c
Jay Krell [Sat, 17 Aug 2019 21:27:23 +0000 (14:27 -0700)]
Add comments explaining goto main_loop vs. MINT_IN_DISPATCH.
Commit migrated from https://github.com/mono/mono/commit/
9a24e9a389130d81890a03cba1f413fbc9bec074
Zoltan Varga [Sat, 17 Aug 2019 21:22:41 +0000 (17:22 -0400)]
Fix the build.
Commit migrated from https://github.com/mono/mono/commit/
9df02d7a2d040cc059b94728189529a7ffb006cf
Zoltan Varga [Sat, 17 Aug 2019 16:26:35 +0000 (12:26 -0400)]
Fix the build.
Commit migrated from https://github.com/mono/mono/commit/
44cfea466fd6171c70ddff1f00b9a50048d60495
Zoltan Varga [Sat, 17 Aug 2019 13:16:36 +0000 (09:16 -0400)]
Add support for the System.Runtime.Intrinsics.X86.Popcnt intrinsics.
Commit migrated from https://github.com/mono/mono/commit/
7418248835be6e3a7397694d1e74248dd5ecdd49
Zoltan Varga [Sat, 17 Aug 2019 13:16:12 +0000 (09:16 -0400)]
[llvm] Add support for querying the cpu attributes from the LLVM jit.
Commit migrated from https://github.com/mono/mono/commit/
bfe4155083c53a30ce616cc0f09c3f7a82a26ed8
Zoltan Varga [Fri, 16 Aug 2019 23:32:53 +0000 (19:32 -0400)]
Fix the build.
Commit migrated from https://github.com/mono/mono/commit/
b39abe53659981c1cd5b6ad9f7a2309296c29de6
Zoltan Varga [Fri, 16 Aug 2019 09:22:43 +0000 (05:22 -0400)]
Fix the windows build.
Commit migrated from https://github.com/mono/mono/commit/
9eb687f2b999e341e525fedd101f0af343d746ff
Zoltan Varga [Fri, 16 Aug 2019 08:09:50 +0000 (04:09 -0400)]
[jit] Add a netcore version of simd-intrinsics.c.
Differences from the old versions:
- Only Vector<T> from corelib is supported.
- Only LLVM is supported.
- It uses more general opcodes like XBINOP instead of having one opcode
for every op+type combination which is not useful for LLVM.
Commit migrated from https://github.com/mono/mono/commit/
98a02059e8753b30d36517805279b5caa308241b
Zoltan Varga [Fri, 16 Aug 2019 08:09:23 +0000 (04:09 -0400)]
[jit] Optimize away box+unbox combinations which are common in corefx code.
Commit migrated from https://github.com/mono/mono/commit/
2c32eb1fa8fc7504fb24a4f00168463fbcda5c10
Zoltan Varga [Sat, 17 Aug 2019 16:22:07 +0000 (12:22 -0400)]
Merge pull request mono/mono#16210 from EgorBo/opt-llvm-jit
Auto-detect current cpu in LLVM JIT
Commit migrated from https://github.com/mono/mono/commit/
13fb0134a0d924a0d140e186bac83eb6ee40f8f9
Jay Krell [Sat, 17 Aug 2019 05:47:17 +0000 (22:47 -0700)]
Put finally data back in locals instead of frame to save 16 bytes of stack.
Partial undo of mono/mono@
f8fd60b5c088753a4a0ccb79483ebae73489e7a2.
Commit migrated from https://github.com/mono/mono/commit/
3fb7834afb70974092aa43ec0ff1d8188fdf2d68
Jay Krell [Thu, 25 Jul 2019 10:19:02 +0000 (03:19 -0700)]
thread names: coop, constants, usually ignore-error.
- Convert setting thread name to be coop-compatible.
- For constant thread names, just retain the constant, not a copy.
This includes producing and using constant unicode thread names on Windows.
- Make setting a thread name often non-fatal, except where mandated by public API.
- From earlier PR: mono_free (mono-publib.c) would no longer be referenced and therefore
no longer exported. That broke profilers and maybe other externals.
Choices:
1 Use it instead of g_free randomly sometimes.
2 Call it randomly sometimes.
3 include it in external-only.c or object.c
4 Mark it external only (breaks profiler).
5 Use a .def file or Unix equivalent.
5 is best, 2 is done here, the advantages/disadvantages
among most choices are subtle. 3 is probably better than 2
but is slightly bigger change, to put off -- you'd stop
compiling mono-publib.c and move it to include/extra_redist.
The advantage of not-.def file is perhaps that it is exposed
by the compiler, so maybe easy to port and work with.
People are more comfortable with obscure C extensions than
any linker options, and there are multiple linkers to contend
with. Arguably there are fewer compilers.
Commit migrated from https://github.com/mono/mono/commit/
0c6cb9fbc3f97e15acf6be07eb46c19a288b3937
Jay Krell [Fri, 16 Aug 2019 21:16:03 +0000 (14:16 -0700)]
[Coop] Convert mono_attach_load_agent. (mono/mono#15954)
Based on https://github.com/mono/mono/pull/15868.
Most cleanup and leak fixes moved and expanded to https://github.com/mono/mono/pull/15950.
Commit migrated from https://github.com/mono/mono/commit/
16a81cf520d82a9e4c0ff10654a627e55dc51b58
Ryan Lucia [Fri, 16 Aug 2019 20:54:47 +0000 (16:54 -0400)]
[netcore] Enable netcore resolution logic for mono_assembly_byname_lookup (mono/mono#16256)
* Use netcore_load_reference in mono_assembly_request_byname
* Add ALC static Resolve event code from CoreCLR
* Wire up the AssemblyResolve event
* Enable newly passing test
* Set requesting assembly in InternalLoad
* Remove infinite recursion
* Only call netcore_load_reference from mono_assembly_request_byname
* Remove test completely
Commit migrated from https://github.com/mono/mono/commit/
1e457cdd1e5b1efc8860ab58a9fb7a00c82bc0c2
Jay Krell [Fri, 16 Aug 2019 13:33:04 +0000 (06:33 -0700)]
Ignore NULL in mono_marshal_free_dynamic_wrappers and mono_free_method. (mono/mono#14150)
Commit migrated from https://github.com/mono/mono/commit/
e54f03168d223debdab1717eb24055662211e4f8
Jay Krell [Fri, 16 Aug 2019 13:32:48 +0000 (06:32 -0700)]
Fill in more MONO_PATCH_INFO_NONE support. (mono/mono#13990)
Commit migrated from https://github.com/mono/mono/commit/
66afab580309acb23a5ed022a2e424c400907c65
Jay Krell [Fri, 16 Aug 2019 13:32:07 +0000 (06:32 -0700)]
[interp] Localize c, i32, o as suggested. (mono/mono#16268)
This saves 16 stack bytes for clang, gcc is unmoved probably figured it out on its own.
Commit migrated from https://github.com/mono/mono/commit/
f52bfb94d514d65d1a1532d2956b4099266da607
Jay Krell [Fri, 16 Aug 2019 13:26:49 +0000 (06:26 -0700)]
[interp] Fix more MonoError reuse (mono_object_new_checked). (mono/mono#16263)
* [interp] Fix more MonoError reuse (mono_object_new_checked).
* Inline mono_interp_new/mono_object_new_checked now that we are in outlined mono_interp_newobj.
Commit migrated from https://github.com/mono/mono/commit/
4d9e6ae20e536394c9ff65c61238045db294c08e
Steve Pfister [Fri, 16 Aug 2019 11:52:22 +0000 (07:52 -0400)]
[corlib] Fix sharing mode validation rules (mono/mono#16247)
Fixes https://github.com/mono/mono/issues/16032
When we switched to corefx File.Copy on unix, the behavior changed where it opened a source and destination stream in order to pass the safe handles to Interop.Sys.CopyFile. This exposed a flaw in our sharing validation rules in MonoIO.Open, which threw an exception in this scenario:
new FileStream("source.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite, 2048, FileOptions.DeleteOnClose);
new FileStream("source.txt", FileMode.Open, FileAccess.Read, FileShare.Read, 2048, FileOptions.None);
Simplified the FileShare check down to:
1. If the caller specifies FileShare.None, then it's an exclusive lock and no
sharing is allowed.
2. If the caller specifies some other FileShare option, then FileShare.None
cannot be specified.
Commit migrated from https://github.com/mono/mono/commit/
da2c0159e9736ebb7f6d8fbe1ebc8671e4cab7e7
Egor Bogatov [Fri, 16 Aug 2019 10:43:08 +0000 (13:43 +0300)]
[netcore] Add patch-local-dotnet-aot-llvm rule (mono/mono#16120)
* Add patch-local-dotnet-aot-llvm rule
* Update Makefile
* Add run-sample-local-dotnet-llvm
Commit migrated from https://github.com/mono/mono/commit/
4dca4f66197fa118b02593b54f79570367ab46d2
Jay Krell [Fri, 16 Aug 2019 08:37:20 +0000 (01:37 -0700)]
intepreter: remove last element from various arrays (mono/mono#16134)
add const
combine lines for searchability
Commit migrated from https://github.com/mono/mono/commit/
0c637a73a9663bf6ca984037c4a5eac16ac91913
Jay Krell [Fri, 16 Aug 2019 07:13:22 +0000 (00:13 -0700)]
[interp] Fully outline enum_hasflag to save stack. (mono/mono#16228)
Alternative to https://github.com/mono/mono/pull/16197.
If you are going outline, you sometimes might as well take it all with you
instead of bouncing back and forth for a partial inlining.
Commit migrated from https://github.com/mono/mono/commit/
35fc20b6375b338f8b9965fecfebb5e815e42c55
Zoltan Varga [Fri, 16 Aug 2019 03:48:35 +0000 (23:48 -0400)]
Merge pull request mono/mono#16261 from vargaz/tp-no-random
[runtime] Use a PRNG in the threadpool instead of the os random number generator.
Commit migrated from https://github.com/mono/mono/commit/
5461fb78c745ab48cb97f8b7c65a08632f725102
Zoltan Varga [Fri, 16 Aug 2019 01:59:42 +0000 (21:59 -0400)]
Merge pull request mono/mono#16257 from EgorBo/llvm-ptr
Align C# pointers with LLVM pointers for primitive types
Commit migrated from https://github.com/mono/mono/commit/
764091677eb717da8cf5799c2b625fd529c3e93a
Jay Krell [Thu, 15 Aug 2019 22:14:37 +0000 (15:14 -0700)]
[mini] Cleanup alloca: call twice instead of once, and shrink allocation slightly. (mono/mono#16158)
It is an actual function call at least on Windows.
Commit migrated from https://github.com/mono/mono/commit/
6c05cfab5996387321164d84c267d3100b6bfb66
Jay Krell [Thu, 15 Aug 2019 22:06:50 +0000 (15:06 -0700)]
[interp] Fix more MonoError reuse. (mono/mono#16262)
Commit migrated from https://github.com/mono/mono/commit/
b654aa1ca858666539a677e96d00f594fd81c630
Jay Krell [Thu, 15 Aug 2019 21:56:33 +0000 (14:56 -0700)]
[Coop] Convert emit_invoke_call. (mono/mono#15964)
Removing calls to mono_string_new_checked.
Extracted from https://github.com/mono/mono/pull/15900.
Commit migrated from https://github.com/mono/mono/commit/
dfbf1a1bd3a792997461f8a43bdb6b5bf7738382
Jay Krell [Thu, 15 Aug 2019 21:48:18 +0000 (14:48 -0700)]
Wrap more external-only functions in GC mode transitions. (mono/mono#15895)
mono_compile_method
mono_runtime_set_main_args
mono_runtime_run_main
mono_runtime_exec_managed_code
mono_load_remote_field
mono_load_remote_field_new
mono_store_remote_field
mono_store_remote_field_new
Commit migrated from https://github.com/mono/mono/commit/
44ff0597b835d0af62f526169dba3b365c9c3411
Zoltan Varga [Thu, 15 Aug 2019 19:46:00 +0000 (15:46 -0400)]
Llvm optimizations (mono/mono#16191)
* [jit] Disable inlining for ThrowHelper methods for non-netcore as well. Add an OP_NOT_REACHED after calls to these methods to let LLVM know they don't return.
* [llvm] Use the cold calling convention instead of the preserveall one, it has the same effect and its better supported.
* [llvm] Call the aot init function using the cold cconv.
* [llvm] Make the condition in the poll function unlikely.
* [llvm] Add a wrapper around the GC poll icall so it can be called with a cold calling convention.
* Move the noreturn check before the code which is shared with calli.
Commit migrated from https://github.com/mono/mono/commit/
870aec4aadfd8b523b62070137643b0cc3a97399
Jo Shields [Thu, 15 Aug 2019 17:56:04 +0000 (13:56 -0400)]
Add missing FCONV_TO_U8 on ILP32 (WatchOS 5) (mono/mono#16276)
Commit migrated from https://github.com/mono/mono/commit/
4ec4d7a3b3b8784a28551b192b01446aaff617a4
Jay Krell [Thu, 15 Aug 2019 17:37:34 +0000 (10:37 -0700)]
Retain thread names as UTF8 instead of only UTF16. (mono/mono#15945)
Windows can still have its Unicode thread names, since we have UTF16 initially, just don't retain it.
This does penalize ves_icall_System_Threading_Thread_GetName_internal (non-netcore only),
which has to convert back to UTF16 each time.
But seems like a net win overall.
There is also a little prep work here for constant thread names and some temporary measures as multiple changes head toward the same code.
Rename `mono_thread_set_name_internal` to `mono_thread_set_name`.
Close possible race conditions.
Extracted from https://github.com/mono/mono/pull/15859.
Commit migrated from https://github.com/mono/mono/commit/
7b64f1cd005ef4f8e7f0aa5655debca2754b1755
Jay Krell [Thu, 15 Aug 2019 17:23:24 +0000 (10:23 -0700)]
[interp] Outline newobj and newobj_vt. (mono/mono#16267)
In this variation, the exception handling and resume are split between the main function and the helper function, and no address-taken occurs on ip/sp/vt_sp.
The order is a little tangled but convincing.
The helper function returns MonoException* or checks context->has_resume_state and then returns, and then the caller does the checks again.
Based on past analysis this will conserve stack, but that was not double checked here.
i.e. due to `&valuetype_this`, though it is conditional and the code could be split up into inline and outline.
Commit migrated from https://github.com/mono/mono/commit/
f35c755fea61f679a000cbf31b7249e0e320b689
Jo Shields [Thu, 15 Aug 2019 14:37:04 +0000 (10:37 -0400)]
Fix failing OSX Android lane (mono/mono#16274)
Linker order matters when using .a files, so zlib.a MUST come after
sgen.a if sgen.a was compiled with support for compressed ppdb
Commit migrated from https://github.com/mono/mono/commit/
dd6bd568a0067a1206e9460017d2f4edb63f2c32
Vlad Brezae [Thu, 15 Aug 2019 11:57:26 +0000 (14:57 +0300)]
[exceptions] Don't debug hang on ThreadAbortException (mono/mono#16240)
It is pretty much useless.
Commit migrated from https://github.com/mono/mono/commit/
6fc089bf8b253df82a04822f7a34bf0c8c59ab52
Jay Krell [Thu, 15 Aug 2019 08:56:38 +0000 (01:56 -0700)]
Reduce redundant setting of thread name. (mono/mono#16253)
Maintain a counter and only set if the counter has changed.
This cannot be fully thread safe, so is not.
Any thread can set any other thread name at any time.
You could be atomic to do better, and loop to do even better,
but the thread name could still be changed again right after the loop exists.
The previous code was also not reliable in this way, since again the name
could be changed right away.
mono/mono#16248
Commit migrated from https://github.com/mono/mono/commit/
63e1828f7e1c9694f34fd7189df6abc5cde1f192
Jay Krell [Thu, 15 Aug 2019 08:42:12 +0000 (01:42 -0700)]
[interp] [wasm] p vs. o on newobj (mono/mono#16264)
Commit migrated from https://github.com/mono/mono/commit/
5ec452666ad4c8a5d9cbab1c78b83789fc1f224f
Jay Krell [Thu, 15 Aug 2019 08:41:49 +0000 (01:41 -0700)]
[interp] Fix some, not all, of the error management. (mono/mono#16232)
From mono/mono#16190.
Commit migrated from https://github.com/mono/mono/commit/
fd4956fbf277ec56a13137e01b48efb98a5556f5
Jay Krell [Thu, 15 Aug 2019 08:39:45 +0000 (01:39 -0700)]
[interp] Short-circuit MINT_STELEM_REF on NULL. (mono/mono#16229)
Presumably this is not a useful semantic change,
to skip those functions, given NULL.
(We will probably want to outline all of this also, later).
Commit migrated from https://github.com/mono/mono/commit/
7766f9b9262701d98eb79758e24d29aab614cc65
Jay Krell [Thu, 15 Aug 2019 08:39:27 +0000 (01:39 -0700)]
[interp] Compute locals later to reduce register/stack pressure and conserve stack. (mono/mono#16231)
i.e. do not def before a function call and use after, do both after.
Commit migrated from https://github.com/mono/mono/commit/
fc724e6cf0c690b8c40ccfe12b0d2316747b1142
Jay Krell [Thu, 15 Aug 2019 08:39:03 +0000 (01:39 -0700)]
[interp] Split leave into pieces, partially outlined, to conserve stack, (mono/mono#16213)
but without changing how exception handling macros access labels and locals.
This saves 16 bytes of stack on Linux/amd64/gcc and likely similar everywhere,
as it takes an address-taken local out of interp_exec_method_full (stackval tmp_sp).
See
https://github.com/mono/mono/pull/16171
https://github.com/mono/mono/pull/16171/commits/mono/mono@
a6a8f0d5ffa875da9cda63444e401c37810a690f for a
full outlining.
Commit migrated from https://github.com/mono/mono/commit/
dde3452690d2836d790054faaf719a958cee7bb8
Nikolay Sivov [Wed, 14 Aug 2019 21:55:54 +0000 (00:55 +0300)]
[cominterop] Fix copy-paste error in ComVisibleAttribute testing helper.
This type was introduced with mono/mono@
29a95bafd87830c430432546af4bf7076ba5542f.
Commit migrated from https://github.com/mono/mono/commit/
5b66d3d5187906d708fd9c22e67e5581f117bb37
Thays Grazia [Wed, 14 Aug 2019 22:51:42 +0000 (19:51 -0300)]
Enable and document debug with sdb with netcore config.
Commit migrated from https://github.com/mono/mono/commit/
dcfec3966c027c4a9411b34138a530839b2b9889
Zoltan Varga [Wed, 14 Aug 2019 23:45:27 +0000 (19:45 -0400)]
[runtime] Use a PRNG in the threadpool instead of the os random number generator, its good enough, and its much faster.
Commit migrated from https://github.com/mono/mono/commit/
928aab1b841bb92d0eace058d4860be63ef3d76a
Egor Bogatov [Wed, 14 Aug 2019 23:39:13 +0000 (02:39 +0300)]
address feedback
Commit migrated from https://github.com/mono/mono/commit/
93eceec724659e85c12e165793926e705a44f761
Jay Krell [Wed, 14 Aug 2019 23:07:56 +0000 (16:07 -0700)]
Remove ampersand from cfg->error per old agreement. (mono/mono#16219)
Commit migrated from https://github.com/mono/mono/commit/
2463605f01643e21753cb73874ae683457280d77
Egor Bogatov [Wed, 14 Aug 2019 22:38:58 +0000 (01:38 +0300)]
handle primitive pointers in llvm
Commit migrated from https://github.com/mono/mono/commit/
ed4be03b79b4337a33c688e0c9368af23ab9ed37
Vlad Brezae [Wed, 14 Aug 2019 21:18:45 +0000 (00:18 +0300)]
[interp] Fix icall signature (mono/mono#16227)
Commit migrated from https://github.com/mono/mono/commit/
4e793ad30c24b30097ba3e9865799b6d9e7e0390
Jo Shields [Wed, 14 Aug 2019 20:58:07 +0000 (16:58 -0400)]
Fix linking of OS-provided zlib (mono/mono#16177)
* Fix linking of OS-provided zlib
This is a reduced version of https://github.com/mono/mono/pull/16091
without the Z_PREFIX stuff
* Get rid of HAVE_ZLIB, be explicit about HAVE_SYS_ZLIB vs HAVE_STATIC_ZLIB
* Proposed fixes from Alex
Commit migrated from https://github.com/mono/mono/commit/
f2d813c90df3a6c4d15eab240b0a68ec055c8f5b
Aleksey Kliger (λgeek) [Wed, 14 Aug 2019 19:07:26 +0000 (15:07 -0400)]
[metadata] Create strongly typed versions of mono_assembly_request_prepare (mono/mono#16094)
* [metadata] Create strongly typed versions of mono_assembly_request_prepare
Addresses the family of issues similar to Coverity mono/mono#1443346.
This came up as part of the Coverity review, and Coverity notices that this is
writting beyond the end of the structure. While this is correct, this requires
that the idiom be properly followed - that is, that the structure being passed
is of the given size.
Replaced instead with a method that eliminates the room for error with methods
that will initialize the whole structure, and the actual size computation is
done inside the method with the proper type sizes.
While I used methods, I feel that this should use macros.
Commit migrated from https://github.com/mono/mono/commit/
ce92c4376f31e9caf964938a3899d179bdc97e51
Egor Bogatov [Wed, 14 Aug 2019 10:59:00 +0000 (13:59 +0300)]
ignore stacktrace tests
Commit migrated from https://github.com/mono/mono/commit/
abb43f9361192c26ce2355a1f254852efd07abbf
Jay Krell [Wed, 14 Aug 2019 10:34:54 +0000 (03:34 -0700)]
[interp] Reduce frame size by partially outlining load remote field. (mono/mono#16196)
Extracted from https://github.com/mono/mono/pull/16171.
Ultimately over 100 bytes can be saved.
Tactically not outlined or indirected:
vt_sp change
ip advancement
error handling
Also partially fixes the error reuse from https://github.com/mono/mono/pull/16190.
Commit migrated from https://github.com/mono/mono/commit/
d1c0974e46bf0edd5f337e72b6032e903d90b703
Jay Krell [Wed, 14 Aug 2019 10:33:58 +0000 (03:33 -0700)]
Make small_id_mutex not recursive. (mono/mono#15485)
(Later non-recursive Windows mutexes should be SRWLOCK and only statically initialized.)
Commit migrated from https://github.com/mono/mono/commit/
60ac98ee29d267646629bc39558f44e4e5af8b4e
Jay Krell [Wed, 14 Aug 2019 10:28:00 +0000 (03:28 -0700)]
Use ERROR_DECL. (mono/mono#16220)
Commit migrated from https://github.com/mono/mono/commit/
8c5d0a790e4677150c71fc58949f0420e1a50cf1