Vlad Brezae [Thu, 12 Sep 2019 17:46:22 +0000 (20:46 +0300)]
[interp] Emit more stloc.np (mono/mono#16796)
Use STLOC_NP_O also for MINT_TYPE_P. It has the same behavior.
Commit migrated from https://github.com/mono/mono/commit/
72405f68af0d7684c3601d0d8b2c63b966022622
Filip Navara [Thu, 12 Sep 2019 16:37:52 +0000 (18:37 +0200)]
[mini] Fix couple of R4 constant folding checks (mono/mono#16782)
* Fix couple of R4 constant folding checks
* Address feedback
* Split RMOVE and FMOVE
Commit migrated from https://github.com/mono/mono/commit/
017f21c2c6b3c23c248b5d9a2d6816edd5deeb04
Jay Krell [Thu, 12 Sep 2019 12:42:23 +0000 (05:42 -0700)]
[interp] Remove unused parameters. (mono/mono#16773)
Commit migrated from https://github.com/mono/mono/commit/
9bb3912590ab6e994d6cc4cf5688b30df92e360c
Jay Krell [Thu, 12 Sep 2019 12:06:31 +0000 (05:06 -0700)]
[interp] Add assert in jmp that sp == stack at start. (mono/mono#16788)
It makes it true sometimes, only if not calling alloca.
Throwing invalid IL if false might be preferred here.
Commit migrated from https://github.com/mono/mono/commit/
c7df01524a1dd6ef713bb074c199bae908532b9b
Egor Bogatov [Thu, 12 Sep 2019 11:09:03 +0000 (14:09 +0300)]
[netcore] Add LLVM to nuget (mono/mono#16524)
* nuspec for llvm
* Add llvm to matrix
* fix scripts/ci/pipeline-netcore-runtime.yml
* fix scripts/ci/pipeline-netcore-runtime.yml
* fix scripts/ci/pipeline-netcore-runtime.yml
* run tests with llvm
* add macOS lane
* disable llvm tests for now
Commit migrated from https://github.com/mono/mono/commit/
977a37844b158e5aabbffa65891fa2ffaf1a416c
EgorBo [Wed, 11 Sep 2019 23:03:01 +0000 (02:03 +0300)]
Fix DynamicMethodToString.ToStringTest
Commit migrated from https://github.com/mono/mono/commit/
1d324e617acf855f97c191fb9ae31605e36f68b7
EgorBo [Wed, 11 Sep 2019 22:01:39 +0000 (01:01 +0300)]
use full name for llvm ir and asm dumps
Commit migrated from https://github.com/mono/mono/commit/
313ce184be497a259f9ebfd40bf1f14a8cc35794
Jay Krell [Thu, 12 Sep 2019 00:35:05 +0000 (17:35 -0700)]
[interp] Fix buffer overreads and overwrites found by valgrind. (mono/mono#16726)
* [interp] Fix buffer overreads and overwrites found by valgrind.
* Attempt to deal with inlining correctly.
* PR: Dial back IR changes. Only IL relevant.
* PR: Dial back more -- only needed changes to .NET IL manipulation, not interpreter IR manipulation.
* PR: Remove one more line.
Commit migrated from https://github.com/mono/mono/commit/
2235e37470312828bae5c0d2448f1e5ee8e651a8
Zoltan Varga [Thu, 12 Sep 2019 00:04:44 +0000 (20:04 -0400)]
[netcore] Create a separate version of threadpool.c for netcore with the domain support removed. (mono/mono#16250)
* [netcore] Create a separate version of threadpool.c for netcore with the domain support removed.
* Fix the windows build.
* Fix the build.
Commit migrated from https://github.com/mono/mono/commit/
6a1ac97dc757f7004f0d6160c4a9c8c19c587ae0
Jay Krell [Fri, 6 Sep 2019 11:52:45 +0000 (04:52 -0700)]
[interp] Reduce register pressure in endfinally.
Eventually this could contribute to stack savings. On its own, nothing.
The compiler apparently likes to create temporaries, like ip and ip - 1.
Which then have to survive functions calls, on the stack, if nonvolatile registers are exhausted.
This combats that and in a larger PR helped.
Commit migrated from https://github.com/mono/mono/commit/
f4c1358ed0c496865c24ee32efa498ace0e8ed5e
Zoltan Varga [Wed, 11 Sep 2019 04:11:51 +0000 (00:11 -0400)]
[aot] Emit interp entry code for methods which are not AOTed when using AOT profiling. Also emit most wrappers.
Commit migrated from https://github.com/mono/mono/commit/
52d24a57d266d52db53381962e11e5416d3ff1f2
Zoltan Varga [Wed, 11 Sep 2019 02:24:40 +0000 (22:24 -0400)]
[wasm] Add missing aot-profile/runtime.js. (mono/mono#16762)
* [wasm] Add missing aot-profile/runtime.js.
* [aot] Avoid writing out a zero AOTID in deterministic mode.
* [wasm] Add --aot-profile= option to packager.
Commit migrated from https://github.com/mono/mono/commit/
2e78f0c739840768d192fbc27c1cfec9dacd30e8
Vlad Brezae [Wed, 11 Sep 2019 01:54:07 +0000 (04:54 +0300)]
[docs] Improve sgen write barrier documentation (mono/mono#16761)
Commit migrated from https://github.com/mono/mono/commit/
f1a57de62128506c1f72ddc65ad6bafe7e24504b
Zoltan Varga [Tue, 10 Sep 2019 19:36:29 +0000 (15:36 -0400)]
[netcore] Disable more features. (mono/mono#16748)
Commit migrated from https://github.com/mono/mono/commit/
697ab15c1281acfbef46c26fb668546e610bd38f
Larry Ewing [Tue, 10 Sep 2019 17:08:58 +0000 (12:08 -0500)]
[wasm] test cleanup (mono/mono#15727)
* [wasm] stop excluding test_0_large_nullable_invoke on wasm
* [wasm] remove wasm exclusion from test_0_simple_double_casts
* Add category MultiThreaded to more of the concurrent collection tests
* Add more MultiThreaded annotations to HttpListener2Test
* Add category MultiThreaded to HttpWebRequestTest
* [wasm] flag more tests that are taking down the runtime
* [wasm] force sockets to throw PNSE in the ctor for now
* [wasm] enable corlib interpreter tests
* [wasm] Increase timeout for corlib tests
* try to fix wasm-cross-win-release-configure on macos
Commit migrated from https://github.com/mono/mono/commit/
47905828121f9929961cc105d1d0b835b3333b32
Marek Safar [Tue, 10 Sep 2019 09:17:57 +0000 (11:17 +0200)]
Update tests exclusion
Commit migrated from https://github.com/mono/mono/commit/
9894bfa6fadb1b2c2c1452cda65896274ddd321f
Marek Safar [Tue, 10 Sep 2019 09:08:00 +0000 (11:08 +0200)]
[netcore] Update System.Private.CoreLib public APIs
Commit migrated from https://github.com/mono/mono/commit/
96b7fead3377a0944bbb16dea309749bc995226e
Bernhard Urban [Tue, 10 Sep 2019 08:16:07 +0000 (10:16 +0200)]
[aot] move method_addresses to data.rel.so section to avoid text relocations (mono/mono#16729)
[aot] move method_addresses to data.rel.so section to avoid text relocations
Another revert of a revert! 🎉
After some discussions with @grendello and @radekdoulik, we came up with this solution. It's a better attempt to fix https://github.com/mono/mono/issues/16369 as it (1) works within the restrictions of Android 10 and (2) still works for armv7 AOT.
`.text` relocations aren't allowed in Android 10 (and this change shouldn't hurt on Linux).
AOT compilation:
```console
$ MONO_PATH=/Users/lewurm/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v1.0/ \
MONO_ENV_OPTIONS="" \
./sdks/out/android-cross-arm-release/bin/armv7-linux-android-mono-sgen \
--aot=keep-temps,outfile=here.dll.so,asmwriter,mtriple=armv7-linux-gnueabi,tool-prefix=/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-,ld-flags= \
~/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0/Mono.Android.dll
Mono Ahead of Time compiler - compiling assembly /Users/lewurm/Downloads/xamarin.android-oss-v10.0.99.136_Darwin-x86_64_pr_766265b9-Debug/bin/Debug/lib/xamarin.android/xbuild-frameworks/MonoAndroid/v10.0/Mono.Android.dll
AOTID
7DDD05DA-37E0-813A-8C27-
3E1634391BB3
Compiled: 144382/144382
Executing the native assembler: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-as" -mfpu=vfp3 -o /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ.o /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ
Executing the native linker: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld" -shared -o here.dll.so.tmp /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ.o
Stripping the binary: "/Users/lewurm/android-toolchain/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-strip" --strip-symbol=\$a --strip-symbol=\$d here.dll.so.tmp
Retained input file.
JIT time: 15031 ms, Generation time: 7374 ms, Assembly+Link time: 75130 ms.
```
Before:
```console
$ grep -C 6 'method_addresses:' /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_550yHJ
.align 3
jit_code_end:
.byte 0,0,0,0
.text 1
.align 3
method_addresses:
.local method_addresses
.type method_addresses,#function
ldr pc,=.Lm_0
.ltorg
ldr pc,=.Lm_1
.ltorg
$ arm-linux-androideabi-readelf -a here.dll.so | grep -i textrel
0x00000016 (TEXTREL) 0x0
0x0000001e (FLAGS) TEXTREL
```
After switching to `.data.rel.so`:
```console
$ grep -C 6 'method_addresses:' /var/folders/p3/5279mmgn1p575bz28j0ngfqw0000gn/T/mono_aot_1YhAgn # assembly file produced by AOT compiler
jit_code_end:
.byte 0,0,0,0
.section ".data.rel.ro"
.subsection 0
.align 3
method_addresses:
.local method_addresses
.type method_addresses,#object
ldr pc,=.Lm_0
.ltorg
ldr pc,=.Lm_1
.ltorg
$ arm-linux-androideabi-readelf -a here.dll.so | grep -i textrel
$ echo $?
1
```
Commit migrated from https://github.com/mono/mono/commit/
e40e24b4cdc902c82cfe0a140cdb284611104242
Marek Safar [Tue, 10 Sep 2019 07:04:40 +0000 (09:04 +0200)]
Disable failing tests
Commit migrated from https://github.com/mono/mono/commit/
e819930ea2365e21f3f6870b1742f31f5f702ddd
Thays Grazia [Mon, 9 Sep 2019 20:07:34 +0000 (17:07 -0300)]
Vtable [i] can be null so this should be check before use it. (mono/mono#16733)
Fixes mono/mono#16712
Commit migrated from https://github.com/mono/mono/commit/
055818f3449b5176dcf0e4eb07491b2501112701
Jay Krell [Mon, 9 Sep 2019 17:31:37 +0000 (10:31 -0700)]
[interp] Let compiler decide clear_resume_state inlining. (mono/mono#16704)
Manual inlining shows no additional stack use any longer.
Commit migrated from https://github.com/mono/mono/commit/
83f965eca5cda8dc8bfd01b969a1d1481faa6977
Zoltan Varga [Thu, 22 Aug 2019 06:01:17 +0000 (02:01 -0400)]
[llvm] Mark Vector128/Vector256 types as SIMD.
These are not currently supported, but marking them as simd helps llvm eliminate dead variables with these types, since
XZERO is easier to eliminate than VZERO.
Commit migrated from https://github.com/mono/mono/commit/
798af6613796fcbe11cf20a33a889705483197a7
Nikolay Sivov [Mon, 9 Sep 2019 17:02:46 +0000 (20:02 +0300)]
Default to SAFEARRAY(VARIANT) as CCW argument for object[]. (mono/mono#16673)
* [cominterop] Add a helper to create default marshal spec for ccw arguments.
* [cominterop] Default to SAFEARRAY(VARIANT) as CCW argument for object[].
* [cominterop] Fix build with --enable-cxx.
Commit migrated from https://github.com/mono/mono/commit/
8590a25b301ec08ac688e93df37fe3ef3c2ddb11
Jay Krell [Mon, 9 Sep 2019 15:06:16 +0000 (08:06 -0700)]
[interp] Embrace that ip is const guint16* and remove casts to that type, (mono/mono#16708)
[interp] Embrace that ip is const guint16* and remove casts to that type.
or to gint16*. Or is there a reason for this style?
Maybe could change type but still want to cast for the deref?
Commit migrated from https://github.com/mono/mono/commit/
1f76ab9270db6db36481bbfde99a7e90256b70f9
Vlad Brezae [Mon, 9 Sep 2019 14:10:50 +0000 (17:10 +0300)]
[interp] Defer local offset allocation to compacted emit phase (mono/mono#16714)
Before this commit, the only information associated with a local was just the offset at which it resides and instructions had this offset embedded from the start. This makes it awkward to have data structures indexed on the local, or have additional information per local, which we might care at some point (for example if it is multi basic block local, if the address of the local was taken etc). In addition to this, if we will want to remove some instructions that make some locals dead, it means that we will have to compact the whole locals space and update all the offsets referenced by all instructions. We solve all these problems by resolving (and allocating) the local offset at the latest time, while emitting the instruction in the compacted byte stream. At this point dead locals will remain dead, with no additional work needed to handle them.
For now, IL locals of the current method that we are compiling are immortal. We can address that later if needed.
Commit migrated from https://github.com/mono/mono/commit/
b9dbd2ff91c1ae9dbd5e1651cb239ca741406a43
Filip Navara [Sat, 31 Aug 2019 16:30:16 +0000 (18:30 +0200)]
[netcore] Tweak inlining heurestic for memcpy
Commit migrated from https://github.com/mono/mono/commit/
320f91129dbc839ccd19154ea687945aa0ce2a77
Filip Navara [Sun, 8 Sep 2019 19:57:21 +0000 (21:57 +0200)]
[netcore][x64] Implement lowering of new SIMD OPs into SSE opcodes (mono/mono#16672)
* [netcore][x64] Implement lowering of new SIMD OPs into SSE2 or SSE4.1 opcodes.
* Implement LZCNT/POPCNT in mini JIT
* Fix C++ build
Commit migrated from https://github.com/mono/mono/commit/
cf2c8575e15c53153add54453c97d1d37a6db719
Jay Krell [Sun, 8 Sep 2019 06:25:33 +0000 (23:25 -0700)]
[interp] Fix debug build. (mono/mono#16720)
Commit migrated from https://github.com/mono/mono/commit/
8c77bcdfaf841fea6214f8027afbc54c8db6de80
Jay Krell [Sat, 7 Sep 2019 19:30:48 +0000 (12:30 -0700)]
[interp] Fix recent warnings I added. (mono/mono#16722)
Commit migrated from https://github.com/mono/mono/commit/
5ba104cf39cf3ed0a6b507af7aeaf324e2a06239
Jay Krell [Sat, 7 Sep 2019 01:48:15 +0000 (18:48 -0700)]
[interp] Assign sp once is enough in leave. (mono/mono#16694)
Move vt_sp there too.
Commit migrated from https://github.com/mono/mono/commit/
b18840e92cb5b1afef6c0e5df05cc026eb32efbf
Alexis Christoforides [Fri, 6 Sep 2019 18:27:57 +0000 (14:27 -0400)]
Remove accidentally committed debug line
Commit migrated from https://github.com/mono/mono/commit/
18fb728c65b806285454af7ef3da0faa7c7160db
imhameed [Fri, 6 Sep 2019 12:55:21 +0000 (05:55 -0700)]
[jit][llvm] Track variable nullness separately from array length ranges/index ranges in abcrem. (mono/mono#16499)
* [jit][llvm] Track variable nullness separately from array length ranges/index ranges in abcrem.
"Nullness" is tracked via a separate field that is stored adjacent
variable/array value ranges; values may be "maybe-null" or "not-null";
the intersection of maybe-null and not-null yields not-null, the union of
maybe-null and not-null yields maybe-null. The existing graph traversal logic
is reused as much as possible, which makes the implementation of this
null value approximation slightly more complicated than it would be
otherwise.
Fixes https://github.com/mono/mono/issues/16310, which was caused by
the use of non-empty array length ranges as a way to encode non-null
values.
This also allows null check elision for zero-sized arrays.
* Fix C++ compatibility. Fix a typo in a comment.
* Add symmetric nullness relations.
* Make ldlen imply that the source register is not-null, similar to CHECK_THIS or any other null check.
Commit migrated from https://github.com/mono/mono/commit/
b4886817efcb1825b6dad38ef6cf3999563b3581
Vlad Brezae [Fri, 6 Sep 2019 07:31:39 +0000 (10:31 +0300)]
[metadata] Fix leaks when handling a few attributes (mono/mono#16675)
Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.
Commit migrated from https://github.com/mono/mono/commit/
e49be5b9ec63e526d6bec04a957cbe48753b651b
Thays Grazia [Fri, 6 Sep 2019 01:16:50 +0000 (22:16 -0300)]
[debugger][android] It was not initialising seq_points on MonoCompile on Android, so when was compiling dynamic methods, seq_points wasn't created and we got the assert when try to single step. (mono/mono#16691)
Commit migrated from https://github.com/mono/mono/commit/
c23a8906f3e0d8572a6c28b06e8a85f3d3c0ea8c
Vlad Brezae [Thu, 5 Sep 2019 20:10:13 +0000 (23:10 +0300)]
[interp] Kill InterpFrame.ex (mono/mono#16666)
* [interp] Reduce unnecessary uses of frame->ex
* [interp] Remove ex from InterpFrame
We save stack space and move the exception where it belongs, in ThreadContext. It was confusing what frame->ex really meant, it was probably not used / initialized properly. We move it now to ThreadContext where it represents the current exception being thrown during EH (when we have a resume state set).
Commit migrated from https://github.com/mono/mono/commit/
f0dabc6618931ccd4c544657ed1a7f3d3d803c25
Filip Navara [Thu, 5 Sep 2019 18:03:47 +0000 (20:03 +0200)]
[netcore] Bump CoreFX, core-setup dependencies (mono/mono#16681)
* [netcore] Bump CoreFX, core-setup dependencies
* Update .deps.json hacks
* Update test exclusions
Commit migrated from https://github.com/mono/mono/commit/
673c8835fd90c5aa05a8836fcfcf24711d456fc7
Jay Krell [Thu, 5 Sep 2019 17:46:12 +0000 (10:46 -0700)]
[interp] Localize endfinally_ip to leave, and it cannot be null (barring (mono/mono#16676)
[interp] Localize endfinally_ip to leave, and it cannot likely be null (unless offset carefully formed).
Commit migrated from https://github.com/mono/mono/commit/
7fc0f8842e19f2e9f83a4df8f6d56011b414e3b9
Jo Shields [Thu, 5 Sep 2019 17:25:48 +0000 (13:25 -0400)]
Fix distclean (mono/mono#16667)
* Disable `subdir-objects` mode in Automake
This forces creation of subdirectories' files (e.g. .deps/*.Plo) in the
parent directory listing the source file. This works around a situation
where two different files specify files in a different parent directory
(i.e. ../../support/adler32.c in mono/metadata/ and adler32.c in
support/) both emit files into the same place (support/.deps), causing
`make distclean` to try and delete support/.deps from two different
places, breaking distclean.
This unfortunately adds a pile of Automake warnings, during autogen.
The "correct" fix is to stop specifying zlib as a pile of flat .c files,
and instead put it in its own subdirectory, conditionally including
its .la files as required.
Partially fixes https://github.com/mono/mono/issues/16605
* Ship netcore/Makefile with an empty distclean rule
We need a netcore/ directory because we write to it during configure,
and we need a netcore/Makefile with a distclean rule, so top-level
recursive distclean doesn't fail. So specify both here.
Partially fixes https://github.com/mono/mono/issues/16605
Commit migrated from https://github.com/mono/mono/commit/
a67839540ef15948b4aebbdcee9ec44ee0f0e9a1
Fan Yang [Thu, 5 Sep 2019 16:12:57 +0000 (12:12 -0400)]
Remove redundant function call of EscapeTypeName to make (mono/mono#16425)
* Remove redundant function call
* Remove commented out line of code
Commit migrated from https://github.com/mono/mono/commit/
abe48e3fd48407a5b76a6581ae7853c66d800b19
Jay Krell [Thu, 5 Sep 2019 15:30:59 +0000 (08:30 -0700)]
[interp] Remove unused parameter to ves_pinvoke_method. (mono/mono#16677)
[interp] Remove unused parameter to ves_pinvoke_method.
It might actually cause stack pressure (but on its own, this PR does not save stack).
Commit migrated from https://github.com/mono/mono/commit/
ee85b695c8be5bddf7a29acf6674381024e16266
Zoltan Varga [Thu, 5 Sep 2019 11:55:53 +0000 (07:55 -0400)]
[netcore] Fix the range checks for Vector.CopyTo(). (mono/mono#16663)
* [netcore] Fix the range checks for Vector.CopyTo().
* [netcore] Fix Vector.get_Item () for u1/u2, the llvm type is a vector of i1/i2, so we need to zero extend.
Commit migrated from https://github.com/mono/mono/commit/
c3541c27389846dafe731999b31e4ade5263dee5
Zoltan Varga [Wed, 4 Sep 2019 22:17:07 +0000 (18:17 -0400)]
[llvm] Use branch weight metadata in some cases. (mono/mono#16668)
* [llvm] Add functions to create weighted branches.
* [llvm] Use weighted branches in GC_SAFE_POINT, some llvm passes doesn't seem to recognize llvm.expect so the LLVM JIT generates the slow inline.
Commit migrated from https://github.com/mono/mono/commit/
db626fe9d370fb1f431667ae31a370b70275ef2b
Jay Krell [Tue, 3 Sep 2019 22:47:18 +0000 (15:47 -0700)]
Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
1f21aae8cb410fb4c6e695489a27eae9d22e265d
Jay Krell [Tue, 3 Sep 2019 22:46:35 +0000 (15:46 -0700)]
Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
9fc2ade131f7c2ca7b176854b7891a998065c832
Jay Krell [Tue, 3 Sep 2019 22:46:16 +0000 (15:46 -0700)]
Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
4359ad66d0621afc79b4f46174a8a20acb418905
Jay Krell [Tue, 3 Sep 2019 22:45:52 +0000 (15:45 -0700)]
Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
e25d2e55360d6b108a51d823c45aaaae766e0923
Jay Krell [Tue, 3 Sep 2019 22:45:36 +0000 (15:45 -0700)]
Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
557645fea31c4d58987940711ca3b5ce85c7bcf9
Jay Krell [Tue, 3 Sep 2019 22:45:14 +0000 (15:45 -0700)]
Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
b3f996d45d1711e0b6b0b76d15ff78665b113a96
Jay Krell [Tue, 3 Sep 2019 22:44:59 +0000 (15:44 -0700)]
Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
8232c85e4c1e0e9d812513cb2221e19fafe41591
Jay Krell [Tue, 3 Sep 2019 22:44:43 +0000 (15:44 -0700)]
Take stars out of types where they make more sense.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
bd9ae10c7cf657e676e89eba88384e1739de6775
Jay Krell [Tue, 3 Sep 2019 22:43:44 +0000 (15:43 -0700)]
more star placement
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
b071aa91925a8d5db5a4648c162b397dde383142
Jay Krell [Tue, 3 Sep 2019 22:43:13 +0000 (15:43 -0700)]
Move stars to sometimes but not always onventional and wierd location. C syntax experiment takes it toll for decades on.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
46ea28c95b5cdd9c573f3eb0c0446050c6ed3eaa
Jay Krell [Tue, 3 Sep 2019 22:42:20 +0000 (15:42 -0700)]
Move stars to conventional but wierd place.
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
90e256352383aa3dca659f8bedf9f12fcb52dc6f
Jay Krell [Tue, 3 Sep 2019 22:41:54 +0000 (15:41 -0700)]
Update mono/eglib/gmodule-win32.c
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
b8313d586aa875bd4c0916b8e52ca960d02a5739
Jay Krell [Tue, 3 Sep 2019 22:41:11 +0000 (15:41 -0700)]
Update mono/eglib/glib.h
Co-Authored-By: Larry Ewing <lewing@microsoft.com>
Commit migrated from https://github.com/mono/mono/commit/
d0817ccdc6492665fd57ca678d5fc55a216287fb
Jay Krell [Tue, 3 Sep 2019 18:27:00 +0000 (11:27 -0700)]
Remove unnecessary cast.
Commit migrated from https://github.com/mono/mono/commit/
a7357e8177a95b7b01c92e30747e823d71a8aeda
Jay Krell [Tue, 3 Sep 2019 18:26:06 +0000 (11:26 -0700)]
Allocate MAX_PATH to start, but it usually wastes memory.
Double later for clarity.
Commit migrated from https://github.com/mono/mono/commit/
595b66c0ebe530054895f2c74bcd4212e77536b9
Jay Krell [Fri, 30 Aug 2019 00:35:08 +0000 (17:35 -0700)]
Fix C++?
Commit migrated from https://github.com/mono/mono/commit/
8723e49b0efa61d15e2eda74a90ac8a8f7a91b2e
Jay Krell [Thu, 29 Aug 2019 18:47:58 +0000 (11:47 -0700)]
cleanup
Commit migrated from https://github.com/mono/mono/commit/
fb6e2c75cd42dddc7ee7c62a72d0292e942a11b3
Jay Krell [Thu, 29 Aug 2019 18:44:13 +0000 (11:44 -0700)]
Test invalid module.
Commit migrated from https://github.com/mono/mono/commit/
da2471d0010eff53a63a3a6b852bb4000ce89408
Jay Krell [Thu, 29 Aug 2019 18:36:13 +0000 (11:36 -0700)]
Skip psapi.dll and go right to the Windows 7 or newer versions in kernel32.dll.
Commit migrated from https://github.com/mono/mono/commit/
74f1312cd395dcb37d1123a5be6ea493c52a3053
Jay Krell [Thu, 29 Aug 2019 18:29:11 +0000 (11:29 -0700)]
Remove cast.
Commit migrated from https://github.com/mono/mono/commit/
2db0c8c2d423094423137becff64d7e85996f1c2
Jay Krell [Thu, 29 Aug 2019 18:03:52 +0000 (11:03 -0700)]
comments
Commit migrated from https://github.com/mono/mono/commit/
06f4f93aa554f9710527587323efc1b0b1783d1f
Jay Krell [Thu, 29 Aug 2019 16:53:12 +0000 (09:53 -0700)]
Remove accident.
Commit migrated from https://github.com/mono/mono/commit/
3ca5b2687f67daefcc70e0c9b839810c84f917da
Jay Krell [Thu, 29 Aug 2019 13:07:16 +0000 (06:07 -0700)]
MAX_PATH reduction.
Commit migrated from https://github.com/mono/mono/commit/
f8be8c6de73646e7ed636d8ce1c36f997193bd66
Jay Krell [Sat, 31 Aug 2019 18:46:33 +0000 (11:46 -0700)]
Tweak names and fix preexisting leak under low memory.
Commit migrated from https://github.com/mono/mono/commit/
a55da2a9036199c5c18442f465c4fd007c136e62
Jay Krell [Fri, 30 Aug 2019 03:45:59 +0000 (20:45 -0700)]
[Coop] GetStackTraces.
Commit migrated from https://github.com/mono/mono/commit/
14afe79a0ab064ea769025ded95ae961e8df8247
Egor Bogatov [Wed, 4 Sep 2019 13:54:52 +0000 (16:54 +0300)]
Implement more Math LLVM intrinsics (mono/mono#16578)
* Implement more Math intrinsics
* Test on CI
* Update pipeline-netcore-runtime.yml
* undo "test on CI"
Commit migrated from https://github.com/mono/mono/commit/
30625b25df4e3d83f6abb30cea2bd57ff0c49539
Jay Krell [Tue, 3 Sep 2019 23:07:29 +0000 (16:07 -0700)]
[Coop] ves_icall_System_IOSelector_Add
Commit migrated from https://github.com/mono/mono/commit/
350dd0e2de44a8ea0cfde38fdd3fb6747481e869
Egor Bogatov [Wed, 4 Sep 2019 09:01:53 +0000 (12:01 +0300)]
Throw NRE if src or dst in Memmove are nulls (mono/mono#16650)
Commit migrated from https://github.com/mono/mono/commit/
1558316cecdf7186a3b792b021304c6356079bfe
Zoltan Varga [Wed, 4 Sep 2019 08:57:39 +0000 (04:57 -0400)]
[netcore] Fix the exception thrown by the Vector<T>.CopyTo() intrinsic. (mono/mono#16618)
Fixes https://github.com/mono/mono/issues/16616.
Commit migrated from https://github.com/mono/mono/commit/
55ac86fe8bd738a50b2c7c63cb620f535f328dcf
Jay Krell [Sat, 20 Jul 2019 07:18:29 +0000 (00:18 -0700)]
Fix overly sensitive g_ascii_strncasecmp tests.
Commit migrated from https://github.com/mono/mono/commit/
82d4d8d81d5a5d9eefaec7bac09e9eb9cd2ce32f
Jay Krell [Sat, 20 Jul 2019 07:17:23 +0000 (00:17 -0700)]
Add g_asciiz_equal_caseinsensitive, g_ascii_equal_caseinsensitive, g_asciiz_equal.
The default takes a length.
"z" means zero terminated, the usually slower not preferred.
Commit migrated from https://github.com/mono/mono/commit/
b66ec468dae0305d85db4fef48bed8f6d5866c4a
Jay Krell [Wed, 3 Jul 2019 02:55:10 +0000 (19:55 -0700)]
Cleanup and augment string handling based on https://github.com/mono/mono/pull/15522.
1. When comparing strings, check pointer equality.
Faster when they match, slower when they do not.
2. Provide string lowercasing into a provided buffer, which can equal
the input, to avoid extra malloc/free.
3. define G_STRING_CONSTANT_AND_LENGTH(x) (x), G_N_ELEMENTS (x) - 1
e.g. strncmp (foo, G_STRING_CONSTANT_AND_LENGTH ("version"))
Commit migrated from https://github.com/mono/mono/commit/
8c288f06664c65050b153da0a8952209adc958a0
Zoltan Varga [Tue, 3 Sep 2019 21:14:50 +0000 (17:14 -0400)]
[netcore] Enable Vector<T>.get_Item () intrinsics for floats/doubles.
Commit migrated from https://github.com/mono/mono/commit/
e1b568b5293a5f85c0f0c6b3c68255c810c085df
Zoltan Varga [Sun, 1 Sep 2019 11:30:07 +0000 (07:30 -0400)]
[netcore] Disable socket support to fix warnings.
Commit migrated from https://github.com/mono/mono/commit/
4107a1538993b75e08f5ed062a27bb76dfd20c5a
Alexis Christoforides [Sat, 31 Aug 2019 00:42:49 +0000 (20:42 -0400)]
Debugging
Commit migrated from https://github.com/mono/mono/commit/
e50a7360e1c417b8f29d322409ca66c76dc07e39
Alexis Christoforides [Sat, 31 Aug 2019 00:41:15 +0000 (20:41 -0400)]
[merp] Fix logic of 'is_managed' attribute
Commit migrated from https://github.com/mono/mono/commit/
4840f4161f75d55462234cc07959e354075d4269
Alexis Christoforides [Fri, 30 Aug 2019 19:57:03 +0000 (15:57 -0400)]
Fix pointing to stack on string && some add tracing
Commit migrated from https://github.com/mono/mono/commit/
4a52bd6da005dc4359c41333706286deeb308d23
Alexis Christoforides [Fri, 30 Aug 2019 13:03:42 +0000 (09:03 -0400)]
Guard writing to out_module
Commit migrated from https://github.com/mono/mono/commit/
8c0dc66d25204a25e22126a2d54ba0f09f580a51
Alexis Christoforides [Thu, 29 Aug 2019 16:19:37 +0000 (12:19 -0400)]
Update MONO_CORLIB_VERSION
Commit migrated from https://github.com/mono/mono/commit/
1b66666cc7d74a5e416483cbfcf8611df091233e
Alexis Christoforides [Thu, 29 Aug 2019 15:33:39 +0000 (11:33 -0400)]
Remove problematic assert from SIGILL handler
mono_handle_native_crash() function can actually return if the native crash has triggered or has been trigerred by more than one signal. So it is possible to reach the point of the assert
Commit migrated from https://github.com/mono/mono/commit/
001398e05bc5f16119e17a737102f6f6fb027047
Alexis Christoforides [Tue, 6 Aug 2019 07:51:20 +0000 (10:51 +0300)]
Add stub of new function when crash reporting is disabled
Commit migrated from https://github.com/mono/mono/commit/
8d4c0f3553d91704e2ff1aae6d954716ca3aa5e2
Alexis Christoforides [Tue, 16 Jul 2019 18:42:51 +0000 (14:42 -0400)]
Set out_module, to avoid getting no useful information in the printout
It seems that without this, most/all entries in the unmanaged frames list are have no useful information.
Commit migrated from https://github.com/mono/mono/commit/
4b02c3eb9df654784cdfcd40f6a9a9ab590fb337
Alexis Christoforides [Tue, 9 Jul 2019 00:35:17 +0000 (20:35 -0400)]
[merp] Add API method that whitelists all native libraries
This is so that complex consumers such as Visual Studio for Mac can forego attempting to enumerate all loaded libraries, register them one at a time and potentially keep the list updated
Commit migrated from https://github.com/mono/mono/commit/
40a8d88d8e0178d333c53ea3cb0e53363c2304ba
Zoltan Varga [Tue, 3 Sep 2019 17:27:24 +0000 (13:27 -0400)]
[wasm] Avoid aligning the stack bounds, they are not page aligned on wasm.
Commit migrated from https://github.com/mono/mono/commit/
aad54942583f8658ab6d7e7af5ffe3b76b3f35b3
Jay Krell [Tue, 3 Sep 2019 22:52:41 +0000 (15:52 -0700)]
[coop] CustomAttributeBuilder_GetBlob, etc. (mono/mono#16579)
mono_reflection_get_custom_attrs_blob_checked
ModuleBuilder_WriteToFile
ModuleBuilder_build_metadata
Commit migrated from https://github.com/mono/mono/commit/
1780e1d1f8b01feafe6ddcb2c59d241122a6e61a
Jay Krell [Tue, 3 Sep 2019 22:18:21 +0000 (15:18 -0700)]
[Coop] ves_icall_InternalInvoke. (mono/mono#16625)
* [Coop] ves_icall_InternalInvoke.
(Part taken from ves_icall_InternalExecute https://github.com/mono/mono/pull/16622.)
* error_init_reuse.
* Remove stars from types.
Commit migrated from https://github.com/mono/mono/commit/
651eb7696e7887597df0eb149cd7eb222ea807b4
Thays Grazia [Tue, 3 Sep 2019 20:28:37 +0000 (17:28 -0300)]
[debugger][android] Fixing single step inside Exception on Android (mono/mono#16596)
* Fixing single step inside Exception on Android...
The method is null because on ss_create_init_args the IL is -1 when calling method Mono_UnhandledException_internal what I think it's expected, because of that I ignore the single step on android if there is no method. (debugger-engine.c)
After that the sequence point cannot be found because it's calling a method of class DynamicMethodNameCounter what I think it's expected, because of that I remove the assert on android. (debugger-agent.c)
Fixes mono/mono#14772
* Changing comment to make it clear...
Commit migrated from https://github.com/mono/mono/commit/
1046dd746f3f99e97f034a2c2b51bdb4e19128ae
Egor Bogatov [Tue, 3 Sep 2019 20:22:04 +0000 (23:22 +0300)]
[netcore] Use CoreRT's Overlapped (mono/mono#16106)
Made it Nullability friendly
Interop.MemFree -> Marshal.FreeHGlobal
Interop.MemAlloc -> Marshal.AllocHGlobal
Fixes https://github.com/mono/mono/issues/15308
Fixes https://github.com/mono/mono/issues/15310
Also, copy ThreadPoolBoundHandle.PlatformNotSupported.cs
Commit migrated from https://github.com/mono/mono/commit/
625af20cefcc3944fa10f341329ff40fc9e27694
Jay Krell [Tue, 3 Sep 2019 20:09:24 +0000 (13:09 -0700)]
Fix non-netcore warning about add_assembly_to_alc. (mono/mono#16622)
Commit migrated from https://github.com/mono/mono/commit/
37e49876b9b5a43f4144ca2972e5bdbfa4d75090
Filip Navara [Fri, 30 Aug 2019 18:40:14 +0000 (20:40 +0200)]
[netcore] Add intrinsic implementation for Unsafe.InitBlockUnaligned
Commit migrated from https://github.com/mono/mono/commit/
4ae804bb33e394ee5f5a32742e6b500cde913cff
Vlad Brezae [Tue, 3 Sep 2019 16:36:21 +0000 (19:36 +0300)]
[interp] Transform ldloc/stloc pairs to a movloc instruction (mono/mono#16546)
* [interp] Add stack information for each instruction
For each instruction PopN indicates how many values from the top of the stack are used by the instruction. PushN signals how many values are pushed back. These are also used to prevent values from the stack being optimized out, since they might still be used by an instruction. VarPop and VarPush mean that the number is not constant, so we need to inspect the data fields of the instruction (typically for an imethod or csignature) to figure out the stack usage.
* [interp] Convert ldloc/stloc pairs to movloc
The movloc instruction operates directly on locals. This is faster due to avoiding dispatch and stack indirection. More important is that it makes it easy to do copy propagation of locals and it has no stack usage, which means that it could even be killed if the destination local is no longer referenced (as well as STLOC_NP). In the future we could reuse this mechanism of tracking the value of a stack slot to do constant propagation and kill even more instructions (we might need to have _IMM versions of opcodes for this to work).
* [interp] Enable disabling of interp optimization
* [interp] Add time tracking stat for cprop optimizations
* [interp] Move stloc.np transformations to the cprop pass
It makes more sense to do such transformations here and we also don't want transformations in the generate phase prevent us from detecting alternative transformations when running the full pass.
* [interp] Add counter for instructions that were optimized away
* [interp] Make it explicit that we are dealing with IR code
It can be confusing in verbose output.
Commit migrated from https://github.com/mono/mono/commit/
930a5d7d440a735b8b50e57ed397a700e3ee27b5
Nikolay Sivov [Mon, 2 Sep 2019 10:48:24 +0000 (13:48 +0300)]
[cominterop] Maintain object domain around ccw wrapper calls.
Commit migrated from https://github.com/mono/mono/commit/
f8718c7a056938335453fd77a71a930beed51074
Ryan Lucia [Tue, 3 Sep 2019 15:41:27 +0000 (11:41 -0400)]
Remove MAX_PATH usage in w32process (mono/mono#16553)
* Remove MAX_PATH usage in w32process
* Fixes
* Shrink buffer temporarily
* More fixes
* Reset buffer size to 260
* Fix length check and add notes
* Actually free things
* Add tracing and zero len at start
* Typo
* Fix another leak
* Simplify logic
Commit migrated from https://github.com/mono/mono/commit/
5377f9655d24c3ff19545398f89df462c77589b3
Zoltan Varga [Tue, 3 Sep 2019 12:31:16 +0000 (08:31 -0400)]
[llvm] Implement more SIMD intrinsics on netcore. (mono/mono#16449)
* [netcore] Add intrinsics for Vector128/Vector256.Count.
* [netcore] Implement Vector<T>.get_Item () as an intrinsic.
Commit migrated from https://github.com/mono/mono/commit/
98a4d5ec1eb2becf1d002a5fbb070f1079bc6fe4
Egor Bogatov [Tue, 3 Sep 2019 12:19:03 +0000 (15:19 +0300)]
Improve Fast-Math mode for LLVM (mono/mono#16599)
It turns out it's not enough to set global fast math parameters, it's also required to mark some instructions as "fast" (see https://llvm.org/docs/LangRef.html#fast-math-flags) like, for instance, clang does, see https://godbolt.org/z/U8TFST
E.g. all optimizations inside SimplifyLibCalls pass (it's a subpass of InstCombine) need it.
Commit migrated from https://github.com/mono/mono/commit/
416a31796e6a34a134d251760c6055bacc39878c
Egor Bogatov [Tue, 3 Sep 2019 11:55:22 +0000 (14:55 +0300)]
[netcore] Makefile clean up (mono/mono#16630)
Remove ASP.NET sample (we currently have to download apsnet runtime everytime)
instead we can do:
dotnet new webapp
and do make patch-app APP_PATH=/path/to/myasp (works for any kind of apps/templates)
Commit migrated from https://github.com/mono/mono/commit/
5692180ea21e596a08120090dd804872be3df1aa
Bernhard Urban [Tue, 3 Sep 2019 10:14:02 +0000 (12:14 +0200)]
Relax assembly checking for 64 bit targets to allow running mixed-mode MSVC code. (mono/mono#16330)
* [jit] Relax assembly checking for 64 bit targets to allow running mixed-mode MSVC code.
Fixes mono/mono#37913
* STACK_PTR|I8 should be the same as I8|STACK_PTR tuple
* fix i4 to ptr conv on 64bit
Commit migrated from https://github.com/mono/mono/commit/
f23113afcdd2a405b402bef3fb926c0c72ba7221
Vlad Brezae [Tue, 3 Sep 2019 08:21:56 +0000 (11:21 +0300)]
[interp] Remove varargs from InterpFrame and recompute it instead (mono/mono#16598)
It is a waste of stack space.
Commit migrated from https://github.com/mono/mono/commit/
f491af13f482fb42313aa5919ef6e2a030501994