mono.git
6 years agoMerge pull request #5317 from alexrp/master
Alex Rønne Petersen [Tue, 8 Aug 2017 06:55:11 +0000 (08:55 +0200)]
Merge pull request #5317 from alexrp/master

[profiler] Some profiler API improvements.

6 years ago[runtime] Avoid building a separate static library, use the shared object files for...
Zoltan Varga [Tue, 8 Aug 2017 03:48:52 +0000 (23:48 -0400)]
[runtime] Avoid building a separate static library, use the shared object files for the static library as well. (#5233)

6 years ago[jit] Remove unused mono_arch_print_tree () function. (#5258)
Zoltan Varga [Mon, 7 Aug 2017 21:44:02 +0000 (17:44 -0400)]
[jit] Remove unused mono_arch_print_tree () function. (#5258)

6 years ago[runtime] Remove empty eglib/ dir.
Zoltan Varga [Mon, 7 Aug 2017 21:19:30 +0000 (17:19 -0400)]
[runtime] Remove empty eglib/ dir.

6 years ago[runtime] Move eglib into mono/eglib so it becomes a convenience library similar...
Zoltan Varga [Mon, 7 Aug 2017 21:14:31 +0000 (17:14 -0400)]
[runtime] Move eglib into mono/eglib so it becomes a convenience library similar to utils/ etc. (#5297)

6 years ago[profiler] Split method_leave callback into a method_tail_call callback.
Alex Rønne Petersen [Mon, 7 Aug 2017 20:30:59 +0000 (22:30 +0200)]
[profiler] Split method_leave callback into a method_tail_call callback.

With this, profilers can distinguish between the two, and also know what the
target method of a tail call is.

The call instrumentation flags have been renamed accordingly and a new flag has
been added for instrumenting tail calls. I've also added a flag for exceptional
leave events, and method_exception_leave is only raised if this flag is given
for a method.

Also refactored the relevant JIT code a bit so it's easier to follow.

6 years ago[profiler] Mark generated raise functions as ICALL_DECL_EXPORT.
Alex Rønne Petersen [Mon, 7 Aug 2017 20:28:15 +0000 (22:28 +0200)]
[profiler] Mark generated raise functions as ICALL_DECL_EXPORT.

This is currently needed for method_enter, method_leave, and gc_allocation.

6 years ago[runtime] Declare MonoProfilerCallContext::return_value offset.
Alex Rønne Petersen [Mon, 7 Aug 2017 20:27:49 +0000 (22:27 +0200)]
[runtime] Declare MonoProfilerCallContext::return_value offset.

6 years ago[runtime] Add ICALL_DECL_EXPORT.
Alex Rønne Petersen [Mon, 7 Aug 2017 20:27:10 +0000 (22:27 +0200)]
[runtime] Add ICALL_DECL_EXPORT.

ICALL_EXPORT is only used on function definitions, not declarations.

6 years ago[profiler] Properly clean up the resources used by the profiler API on shutdown.
Alex Rønne Petersen [Sat, 5 Aug 2017 16:49:56 +0000 (18:49 +0200)]
[profiler] Properly clean up the resources used by the profiler API on shutdown.

Also introduce mono_profiler_set_cleanup_callback ().

6 years ago[profiler] Some improvements to the code coverage API.
Alex Rønne Petersen [Sat, 5 Aug 2017 16:18:54 +0000 (18:18 +0200)]
[profiler] Some improvements to the code coverage API.

Code coverage must now be explicitly enabled. This simplifies initialization
of some coverage-related structures and also lets us enable debug info which
is needed to produce good data.

Also change the signature of mono_profiler_get_coverage_data so it returns a
value indicating whether coverage data was available.

6 years ago[msvc] Update csproj files
Alexander Köplinger [Mon, 7 Aug 2017 20:13:59 +0000 (22:13 +0200)]
[msvc] Update csproj files

6 years ago[genproj] Simplify strong name key handling
Alexander Köplinger [Mon, 7 Aug 2017 15:54:30 +0000 (17:54 +0200)]
[genproj] Simplify strong name key handling

It doesn't need to be in a separate PropertyGroup.

6 years ago[mono-threads-posix] Fix a buffer overflow (rather an information leak / over-read...
Armin Hasitzka [Mon, 7 Aug 2017 19:10:32 +0000 (21:10 +0200)]
[mono-threads-posix] Fix a buffer overflow (rather an information leak / over-read) (#5285)

[mono-threads-posix] Fix a buffer overflow (rather an information leak / over-read)

While testing Clang's AddressSanitizer, I found and fixed a buffer overflow.

Up for discussion: it might be worth importing `strlcpy` (http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/string/strlcpy.c?rev=1.11) for similar purposes as it provides additional safety and also helps with the readability?

6 years agoMerge pull request #5321 from urisimchoni/prof-lin
Alex Rønne Petersen [Mon, 7 Aug 2017 17:11:25 +0000 (19:11 +0200)]
Merge pull request #5321 from urisimchoni/prof-lin

Profiler - inlining fixes

6 years ago[profiler] Avoid instrumenting inlined methods
Uri Simchoni [Mon, 7 Aug 2017 04:39:12 +0000 (07:39 +0300)]
[profiler] Avoid instrumenting inlined methods

An inlined method does not require instrumentation (if it
did, it would not have been inlined). The flags that
control instrumentation options are valid for the caller
method and are not to be consulted.

This patch replaces an assertion with a check and early
return. A method that "wants to be instrumented" does not
get inlined, but a method that "doesn't want to be instrumented"
can get inlined. However, the flags that control instrumention
options have been calculated against the caller method, hence
they should not be consulted at all. The extra check renders
the assertion unnecessary.

6 years ago[profile] set the "no profiling" bitmask equal to zero
Uri Simchoni [Sun, 6 Aug 2017 09:57:39 +0000 (12:57 +0300)]
[profile] set the "no profiling" bitmask equal to zero

This makes constructs such as "if (!mono_profiler_get_call_instrumentation_flags(methos))"
correct. See mono_method_check_inlining()

6 years agoMerge pull request #5313 from lambdageek/corefx-sre-fixup
Aleksey Kliger (λgeek) [Mon, 7 Aug 2017 15:58:50 +0000 (11:58 -0400)]
Merge pull request #5313 from lambdageek/corefx-sre-fixup

[sre] Fix some argument checks, enable xtests

6 years ago[System.ServiceModel.Web] Simplify AssemblyInfo.cs
Alexander Köplinger [Mon, 7 Aug 2017 15:09:34 +0000 (17:09 +0200)]
[System.ServiceModel.Web] Simplify AssemblyInfo.cs

We don't need separate AssemblyInformationalVersion for mobile and
non-mobile.

6 years ago[ci] Add CI_TAGS option for --disable-mcs-build
Alexander Köplinger [Mon, 7 Aug 2017 14:28:47 +0000 (16:28 +0200)]
[ci] Add CI_TAGS option for --disable-mcs-build

Useful if you don't want to build the class libraries e.g. for
some static analysis of the runtime.

6 years agoBump version to 5.7 (#5325)
Ludovic Henry [Mon, 7 Aug 2017 14:03:24 +0000 (16:03 +0200)]
Bump version to 5.7 (#5325)

6 years ago[w32handle] Remove use of w32handle for File, Console, Pipe and Socket (#5319)
Ludovic Henry [Mon, 7 Aug 2017 13:52:12 +0000 (15:52 +0200)]
[w32handle] Remove use of w32handle for File, Console, Pipe and Socket (#5319)

* [w32file] Remove io_ops indirection

* [w32file] Replace use of w32handle by a GHashTable for File, Console and Pipe

* [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Remove force closing of sockets on shutdown

* fixup! [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Replace use of w32handle by a GHashTable

* [w32handle] Remove dead function mono_w32handle_new_fd

* fixup! [w32file] Replace use of w32handle by a GHashTable for File, Console and Pipe

* [w32handle] Remove dead variable mono_w32handle_fd_reserve

* [fdhandle] Factor w32file and w32socket common fdhandle code

* fixup! [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Fix GC safe/unsafe transitions

* fixup! [w32handle] Remove dead variable mono_w32handle_fd_reserve

6 years ago[eglib] Add back NEWS file, it's required for the tarball
Alexander Köplinger [Mon, 7 Aug 2017 12:31:57 +0000 (14:31 +0200)]
[eglib] Add back NEWS file, it's required for the tarball

6 years agoRevert "Bump version to 5.7"
Ludovic Henry [Mon, 7 Aug 2017 12:30:20 +0000 (14:30 +0200)]
Revert "Bump version to 5.7"

This reverts commit 82eafc02e4774ed567237d15f0f24b13a674da38.

6 years agoBump version to 5.7
Ludovic Henry [Mon, 7 Aug 2017 12:19:35 +0000 (14:19 +0200)]
Bump version to 5.7

6 years ago[System.Drawing] Simplify mobile profile check
Alexander Köplinger [Mon, 7 Aug 2017 12:11:59 +0000 (14:11 +0200)]
[System.Drawing] Simplify mobile profile check

6 years ago[bcl] Specify the name of the key file on the command line instead of using the Assem...
Zoltan Varga [Mon, 7 Aug 2017 12:03:48 +0000 (08:03 -0400)]
[bcl] Specify the name of the key file on the command line instead of using the AssemblyKeyFile attribute for consistency and to make it easier to do path name manipulation on the file name. (#5316)

6 years agoMerge pull request #5320 from urisimchoni/prof-sample
Alex Rønne Petersen [Mon, 7 Aug 2017 06:45:36 +0000 (08:45 +0200)]
Merge pull request #5320 from urisimchoni/prof-sample

[profiler] fixes to profiler sample

6 years ago[profiler] fixes to profiler sample
Uri Simchoni [Sun, 6 Aug 2017 10:20:01 +0000 (13:20 +0300)]
[profiler] fixes to profiler sample

- Fix the Linux build instructions.
- Remove eglib dependencies, as they complicate the build of an
  extenral module.
- Make instance static instead of heap-allocated.
- Make the call counter 64 bits.
- Adjustments to accommodate the new profiling API.

6 years agoRevert "[w32handle] Remove use of w32handle for File, Console, Pipe and Socket (...
Ludovic Henry [Sat, 5 Aug 2017 16:59:08 +0000 (12:59 -0400)]
Revert "[w32handle] Remove use of w32handle for File, Console, Pipe and Socket (#5283)" (#5318)

This reverts commit 78735091b62b8d7f65da2c83d36ca314a23009f4.

6 years ago[w32handle] Remove use of w32handle for File, Console, Pipe and Socket (#5283)
Ludovic Henry [Sat, 5 Aug 2017 16:51:15 +0000 (12:51 -0400)]
[w32handle] Remove use of w32handle for File, Console, Pipe and Socket (#5283)

* [w32file] Remove io_ops indirection

* [w32file] Replace use of w32handle by a GHashTable for File, Console and Pipe

* [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Remove force closing of sockets on shutdown

* fixup! [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Replace use of w32handle by a GHashTable

* [w32handle] Remove dead function mono_w32handle_new_fd

* fixup! [w32file] Replace use of w32handle by a GHashTable for File, Console and Pipe

* [w32handle] Remove dead variable mono_w32handle_fd_reserve

* [fdhandle] Factor w32file and w32socket common fdhandle code

* fixup! [Socket] Avoid relying on MonoIO.DuplicateHandle

* [w32socket] Fix GC safe/unsafe transitions

* fixup! [w32handle] Remove dead variable mono_w32handle_fd_reserve

6 years agoBump boostrap mono dependency
Marek Safar [Fri, 4 Aug 2017 22:21:43 +0000 (00:21 +0200)]
Bump boostrap mono dependency

6 years agoBump corefx
Marek Safar [Fri, 4 Aug 2017 22:18:59 +0000 (00:18 +0200)]
Bump corefx

6 years ago[ci] Disable corlib-xunit on Windows for now
Alexander Köplinger [Sat, 5 Aug 2017 00:10:21 +0000 (02:10 +0200)]
[ci] Disable corlib-xunit on Windows for now

It seems to fail.

6 years ago[mcs] Adds handling for declared variables from while loop condition
Marek Safar [Fri, 4 Aug 2017 21:48:16 +0000 (23:48 +0200)]
[mcs] Adds handling for declared variables from while loop condition

6 years agoBump API snapshot submodule
monojenkins [Fri, 4 Aug 2017 18:15:39 +0000 (18:15 +0000)]
Bump API snapshot submodule

6 years agoBump cecil and linker
Marek Safar [Fri, 4 Aug 2017 14:40:16 +0000 (16:40 +0200)]
Bump cecil and linker

6 years ago[test] (corlib) Enable more xtest SRE tests
Aleksey Kliger [Thu, 3 Aug 2017 21:53:34 +0000 (17:53 -0400)]
[test] (corlib) Enable more xtest SRE tests

- MethodBuilderDefineParameter
- ConstructorBuilderDefineParameter
- FieldBuilderSetCustomAttribute
- GenericTypeParameterBuilderSetCustomAttribute
- FieldBuilderSetOffset
- ModuleBuilderDefineInitializedData
- ModuleBuilderDefineUninitializedData

6 years ago[sre] ModuleBuilder.DefineUnitializedData argument checks
Aleksey Kliger [Fri, 4 Aug 2017 19:17:03 +0000 (15:17 -0400)]
[sre] ModuleBuilder.DefineUnitializedData argument checks

1. Fix off by one in size check.
  Largest usable size is 0x3effff, first unusable size is 0x3f0000
  (Also change order of ArgumentException arguments - param name is second.
   Set it to null because of misguided CoreFX SRE test that expects a null name)
2. Check for empty string field name.

6 years ago[sre] negative FieldBuilder.SetOffset should throw ArgumentException
Aleksey Kliger [Fri, 4 Aug 2017 17:52:43 +0000 (13:52 -0400)]
[sre] negative FieldBuilder.SetOffset should throw ArgumentException

6 years ago[sre] Add explicit null checks of CustomAttributeBuilder arguments
Aleksey Kliger [Fri, 4 Aug 2017 16:32:09 +0000 (12:32 -0400)]
[sre] Add explicit null checks of CustomAttributeBuilder arguments

6 years ago[sre] ConstructorBuilder.DefineParamter(0,...) shouldn't throw
Aleksey Kliger [Thu, 3 Aug 2017 22:18:59 +0000 (18:18 -0400)]
[sre] ConstructorBuilder.DefineParamter(0,...) shouldn't throw

.NET Framework says:

> If you specify 0 (zero) for iSequence, this method returns a ParameterBuilder
>  instead of throwing an exception. There is nothing useful that you can do
>  with this ParameterBuilder.

So let's do that.

6 years ago[runtime] Install profiler-events.h as a public header.
Alex Rønne Petersen [Fri, 4 Aug 2017 19:05:12 +0000 (21:05 +0200)]
[runtime] Install profiler-events.h as a public header.

6 years ago[bcl] Grab free ports randomly in NetworkHelpers (#5312)
Alexander Köplinger [Fri, 4 Aug 2017 18:22:50 +0000 (20:22 +0200)]
[bcl] Grab free ports randomly in NetworkHelpers (#5312)

* [bcl] Grab free ports randomly in NetworkHelpers

We're frequently seeing "address already in use" errors on Jenkins.

The theory is that when we're running tests and grab the next free
port via our custom NetworkHelpers we're getting a port which will
also be returned to a simultaneously running test (e.g. another chroot)
because we're closing the TcpListener and thus releasing the port until
we start using it in actual test code. By that time the other test
might've already opened the port, causing our test to fail.

Instead we now try to use a random port in the range 10000-60000
and try if it's available. This doesn't completely fix the inherent
race but should hopefully make it way less likely.

6 years ago[sre] Throw ArgumentOutOfRange exn in MethodBuilder.DefineParameter if called
Aleksey Kliger [Thu, 3 Aug 2017 21:51:47 +0000 (17:51 -0400)]
[sre] Throw ArgumentOutOfRange exn in MethodBuilder.DefineParameter if called
before SetParameters.

Fixes xunit testpoint MethodBuilderDefineParameter:DefineParameter_NoParameters_NonZeroPosition_ThrowsArgumentOutOfRangeException

6 years agoMerge pull request #5306 from lambdageek/corefx-sre-tests
Aleksey Kliger (λgeek) [Fri, 4 Aug 2017 16:40:54 +0000 (12:40 -0400)]
Merge pull request #5306 from lambdageek/corefx-sre-tests

[test] (corlib) Use CoreFX System.Reflection.Emit xunit tests

6 years agoMerge pull request #5303 from lambdageek/cattr-bcheck
Aleksey Kliger (λgeek) [Fri, 4 Aug 2017 16:29:19 +0000 (12:29 -0400)]
Merge pull request #5303 from lambdageek/cattr-bcheck

[custom_attrs] Add bounds checking to custom attribute parsing

6 years ago[btls] Disable BUILD_SHARED_LIBS while building boringssl, so its symbols are not...
Zoltan Varga [Fri, 4 Aug 2017 15:39:28 +0000 (11:39 -0400)]
[btls] Disable BUILD_SHARED_LIBS while building boringssl, so its symbols are not exported from the btls shared lib. (#5307)

6 years ago[mcs] Fixes codegen for type pattern matching in probing expressions over hoisted...
Marek Safar [Fri, 4 Aug 2017 13:15:14 +0000 (15:15 +0200)]
[mcs] Fixes codegen for type pattern matching in probing expressions over hoisted local variables

6 years ago[mcs] Flow analysis on reduced expressions need to run on original expression
Marek Safar [Fri, 4 Aug 2017 11:30:06 +0000 (13:30 +0200)]
[mcs] Flow analysis on reduced expressions need to run on original expression

6 years ago[mcs] Warnings clean up
Marek Safar [Fri, 4 Aug 2017 08:52:23 +0000 (10:52 +0200)]
[mcs] Warnings clean up

6 years ago[mcs] Pending implementation of accessors cannot hide base implementation with differ...
Marek Safar [Thu, 3 Aug 2017 22:24:38 +0000 (00:24 +0200)]
[mcs] Pending implementation of accessors cannot hide base implementation with different member type

6 years ago[ci] (run-test-default) Run the corlib xunit tests
Aleksey Kliger [Thu, 3 Aug 2017 21:31:15 +0000 (17:31 -0400)]
[ci] (run-test-default) Run the corlib xunit tests

6 years ago[test] (corlib) Use CoreFX System.Reflection.Emit xunit tests
Aleksey Kliger [Tue, 1 Aug 2017 16:40:23 +0000 (12:40 -0400)]
[test] (corlib) Use CoreFX System.Reflection.Emit xunit tests

6 years ago[custom_attrs] Add bounds checking to mono_reflection_create_custom_attr_data_args
Aleksey Kliger [Thu, 3 Aug 2017 17:29:48 +0000 (13:29 -0400)]
[custom_attrs] Add bounds checking to mono_reflection_create_custom_attr_data_args

and load_cattr_value_boxed

6 years ago[custom_attrs] Add bounds checking to load_cattr_value
Aleksey Kliger [Thu, 3 Aug 2017 16:21:10 +0000 (12:21 -0400)]
[custom_attrs] Add bounds checking to load_cattr_value

6 years ago[custom_attrs] Add (some) bounds checking to create_custom_attr
Aleksey Kliger [Wed, 2 Aug 2017 21:32:23 +0000 (17:32 -0400)]
[custom_attrs] Add (some) bounds checking to create_custom_attr

In principle, mono_verifier_verify_cattr_content should prevent malformed custom
attribute blobs from being passed in here.

In practice:

1. The verifier is not on by default

2. System.Reflection.Emit allows an arbitrary byte[] to be passed in which
   means that code like this can cause mono to read past the end of the array.

   ```
   // "1 1-byte constructor argument and then 65280 named properties follow"
   assembly.SetCustomAttribute(constructor, new byte[] { 1, 0, 1, 0x00, 0xFF });
   var attributes = assembly.GetCustomAttributes(true);
   ```

6 years agoUpdates codeowners
Marek Safar [Thu, 3 Aug 2017 15:09:32 +0000 (17:09 +0200)]
Updates codeowners

6 years ago[msbuild] Add option to nuget-hash-extractor to generate a list of the
Ankit Jain [Wed, 2 Aug 2017 16:14:36 +0000 (12:14 -0400)]
[msbuild] Add option to nuget-hash-extractor to generate a list of the

.. denied assemblies usable by a msbuild task for filtering them.

6 years agoBump ikdasm.
Zoltan Varga [Thu, 3 Aug 2017 00:37:54 +0000 (20:37 -0400)]
Bump ikdasm.

6 years ago[tests] Disable test on llvm
Vlad Brezae [Wed, 2 Aug 2017 23:22:52 +0000 (02:22 +0300)]
[tests] Disable test on llvm

On llvm aborts can happen during finally blocks. This test was not failing before because the method in question had llvm disabled, which has recently changed.

6 years agoMerge pull request #5299 from cherusker/cherusker-2017-08-01-next-generic-inst-id
monojenkins [Wed, 2 Aug 2017 23:10:32 +0000 (01:10 +0200)]
Merge pull request #5299 from cherusker/cherusker-2017-08-01-next-generic-inst-id

[metadata] Fix racy next_generic_inst_id

Like suggested by @luhenry, I would like to propose this fix which was discussed in https://bugzilla.xamarin.com/show_bug.cgi?id=58423. As `next_generic_inst_id` is `int`, `InterlockedIncrement64 ()` seems to be the right choice.

Also, I cannot add any reviewers or assignees, which is why I would kindly ask @lambdageek to review this as well :)

6 years ago[profiler] Fix MonoProfilerState::context_free_buffer type.
Alex Rønne Petersen [Wed, 2 Aug 2017 21:10:57 +0000 (23:10 +0200)]
[profiler] Fix MonoProfilerState::context_free_buffer type.

6 years ago[mono-api-html] Fix bogus IgnoreParameterNameChanges behavior.
Atsushi Eno [Tue, 1 Aug 2017 06:33:55 +0000 (15:33 +0900)]
[mono-api-html] Fix bogus IgnoreParameterNameChanges behavior.

It never ignored parameter name changes. Make the entire code just simple.

6 years agoFix racy `next_generic_inst_id`
cherusker [Tue, 1 Aug 2017 10:59:34 +0000 (12:59 +0200)]
Fix racy `next_generic_inst_id`
- as discussed in https://bugzilla.xamarin.com/show_bug.cgi?id=58423
- in addition, unify `int` and `guint` into `gint32` which can be used flawlessly with `InterlockedIncrement ()`

6 years ago[bcl] Fix Delegate.GetHashCode () so it takes into account the target too. Fixes...
Zoltan Varga [Wed, 2 Aug 2017 06:58:41 +0000 (02:58 -0400)]
[bcl] Fix Delegate.GetHashCode () so it takes into account the target too. Fixes #58399. (#5296)

6 years ago[runtime] Fix msvc build.
Zoltan Varga [Wed, 2 Aug 2017 06:08:17 +0000 (02:08 -0400)]
[runtime] Fix msvc build.

6 years agoUpdate CODEOWNERS
Vlad Brezae [Tue, 1 Aug 2017 23:37:35 +0000 (02:37 +0300)]
Update CODEOWNERS

6 years agoMerge pull request #5298 from baulig/work-offsets-profiler
Alex Rønne Petersen [Tue, 1 Aug 2017 23:35:41 +0000 (01:35 +0200)]
Merge pull request #5298 from baulig/work-offsets-profiler

[offset-tool]: Add MonoProfilerCallContext to MonoAotOffsetsDumper.

6 years ago[offset-tool]: Add MonoProfilerCallContext to MonoAotOffsetsDumper.
Martin Baulig [Tue, 1 Aug 2017 21:33:19 +0000 (17:33 -0400)]
[offset-tool]: Add MonoProfilerCallContext to MonoAotOffsetsDumper.

6 years ago[mini] Remove the functions that were unexported in b05d4b93226c83489a65934f780beddab...
Alex Rønne Petersen [Tue, 1 Aug 2017 19:53:01 +0000 (21:53 +0200)]
[mini] Remove the functions that were unexported in b05d4b93226c83489a65934f780beddab3c2ef32.

6 years ago[runtime] Declare MonoProfilerCallContext::method offset.
Alex Rønne Petersen [Tue, 1 Aug 2017 19:47:46 +0000 (21:47 +0200)]
[runtime] Declare MonoProfilerCallContext::method offset.

6 years ago[jit] Fix the DISABLE_JIT build.
Zoltan Varga [Tue, 1 Aug 2017 19:13:30 +0000 (15:13 -0400)]
[jit] Fix the DISABLE_JIT build.

6 years agoAdd myself to CODEOWNERS.
Martin Baulig [Tue, 1 Aug 2017 17:54:27 +0000 (13:54 -0400)]
Add myself to CODEOWNERS.

6 years ago[System]: Fix memory leak in BTLS. (#5291)
Martin Baulig [Tue, 1 Aug 2017 16:59:23 +0000 (12:59 -0400)]
[System]: Fix memory leak in BTLS. (#5291)

6 years agoMerge pull request #5288 from lambdageek/bug-58454
Aleksey Kliger (λgeek) [Tue, 1 Aug 2017 16:08:56 +0000 (12:08 -0400)]
Merge pull request #5288 from lambdageek/bug-58454

[sre] Pass declaring type to GetMethodFromHandle in GenericTypeParameterBuilder:InternalResolve (Fixes #58454)

6 years agoMerge pull request #5292 from alexrp/profiler-symbol-fixes
Alex Rønne Petersen [Tue, 1 Aug 2017 15:05:37 +0000 (17:05 +0200)]
Merge pull request #5292 from alexrp/profiler-symbol-fixes

[profiler] Move legacy profiler code to profiler.c.

6 years agoUpdate CODEOWNERS.
Alex Rønne Petersen [Tue, 1 Aug 2017 04:54:14 +0000 (06:54 +0200)]
Update CODEOWNERS.

6 years ago[profiler] Move legacy profiler code to profiler.c.
Alex Rønne Petersen [Tue, 1 Aug 2017 04:50:05 +0000 (06:50 +0200)]
[profiler] Move legacy profiler code to profiler.c.

These symbols weren't being properly exported in the final mono executable on
Mac because no code in the runtime called these functions. As long as they're
defined in an object file that contains used functions, they'll be exported.

6 years agoMerge pull request #5274 from alexrp/profiler-call-contexts
Alex Rønne Petersen [Tue, 1 Aug 2017 04:35:36 +0000 (06:35 +0200)]
Merge pull request #5274 from alexrp/profiler-call-contexts

[profiler] Implement call context introspection for enter/leave events.

6 years ago[mini] Add a mono_jit_aot_compiling () function.
Alex Rønne Petersen [Fri, 28 Jul 2017 21:23:51 +0000 (23:23 +0200)]
[mini] Add a mono_jit_aot_compiling () function.

6 years ago[mini] Remove some unstable exports that are no longer used by the profiler.
Alex Rønne Petersen [Fri, 28 Jul 2017 21:20:23 +0000 (23:20 +0200)]
[mini] Remove some unstable exports that are no longer used by the profiler.

6 years ago[profiler] Implement call context introspection for enter/leave events.
Alex Rønne Petersen [Tue, 25 Jul 2017 22:55:22 +0000 (00:55 +0200)]
[profiler] Implement call context introspection for enter/leave events.

When this feature is enabled for a method, the enter/leave event receives an
additional argument, a so-called 'call context'. This call context contains
enough information about the stack frame of the instrumented method to allow
the enter/leave callback to inspect the 'this' reference, method arguments,
local variables, and the return value (for non-void methods).

This feature enables some interesting scenarios that were not possible with
the regular enter/leave events. For example, a profiler could instrument
well-known methods in the managed thread pool code to get an idea of how an
application is using the thread pool, or it could instrument network-related
methods to gather statistics or even log all network traffic.

This is implemented by storing a MonoProfilerCallContext on the stack, whose
MonoContext field is populated by executing an OP_FILL_PROF_CALL_CTX opcode
which stores the stack pointer, frame pointer, and all callee-saved registers
to it. For the epilogue, a pointer to the return value (for non-void methods)
is also stored in the MonoProfilerCallContext. An address to this context is
then passed to mono_profiler_raise_method_enter/leave. Based on debug info,
all arguments and locals can then be looked up in the instrumented method's
stack frame.

For the interpreter, we just store an InterpFrame pointer on the
MonoProfilerCallContext and look everything up from that. We don't need debug
info in this case.

This feature is currently not supported with LLVM (for regular LLVM mode, it
will fall back to Mono's JIT, while for LLVM-only mode, it's not available).

I also refactored the interpreter code so that enter/leave events are generated
not only when interpreter debugging is enabled. Also, the interpreter will only
call mono_profiler_get_call_instrumentation_flags () once per method now.
Finally, I made the interpreter also generate exception leave events.

6 years ago[sre] Pass declaring type to GetMethodFromHandle in
Aleksey Kliger [Mon, 31 Jul 2017 22:35:16 +0000 (18:35 -0400)]
[sre] Pass declaring type to GetMethodFromHandle in
GenericTypeParameterBuilder:InternalResolve (Fixes #58454)

When the parameter belongs to a method builder, we need to pass the declaring
type (appropriately resolved) to GetMethodFromHandle to avoid an
ArgumentException.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=58454

6 years ago[ci] Compile the class lib tests in a separate step
Alexander Köplinger [Fri, 28 Jul 2017 20:01:13 +0000 (22:01 +0200)]
[ci] Compile the class lib tests in a separate step

Compiling in parallel via -j should also be faster.
We had this on Wrench but it didn't make it over to Jenkins.

6 years ago[mono-symbolicate] Run tests with "run-test" target instead of "test"
Alexander Köplinger [Mon, 31 Jul 2017 16:02:32 +0000 (18:02 +0200)]
[mono-symbolicate] Run tests with "run-test" target instead of "test"

The "test" target is used to precompile the tests but actual running
should happen with the "run-test" target.

6 years ago[test] Check that GenericTypeParamBuilder:InternalResolve passes declaring type
Aleksey Kliger [Mon, 31 Jul 2017 22:33:19 +0000 (18:33 -0400)]
[test] Check that GenericTypeParamBuilder:InternalResolve passes declaring type
to GetMethodFromHandle

Regression test for https://bugzilla.xamarin.com/show_bug.cgi?id=58454

6 years agoMerge pull request #5234 from vkargov/vk-kiokunegi
vkargov [Mon, 31 Jul 2017 20:49:58 +0000 (16:49 -0400)]
Merge pull request #5234 from vkargov/vk-kiokunegi

[jit] Check method cache first in mono_get_method_constrained_checked.

6 years ago[corlib]: Fix race condition in ExceptionDispatchInfo. (#5279)
Martin Baulig [Mon, 31 Jul 2017 17:01:41 +0000 (13:01 -0400)]
[corlib]: Fix race condition in ExceptionDispatchInfo. (#5279)

6 years ago[llvm] Fix the calling of fault clauses in llvm compiled code. Fixes #58446. (#5286)
Zoltan Varga [Mon, 31 Jul 2017 15:20:22 +0000 (11:20 -0400)]
[llvm] Fix the calling of fault clauses in llvm compiled code. Fixes #58446. (#5286)

6 years ago[mcs] Implements C#7 expression bodied members enhancement
Marek Safar [Mon, 31 Jul 2017 14:58:14 +0000 (16:58 +0200)]
[mcs] Implements C#7 expression bodied members enhancement

6 years ago[mcs] Add parser sequence for case type pattern matching
Marek Safar [Mon, 31 Jul 2017 14:13:59 +0000 (16:13 +0200)]
[mcs] Add parser sequence for case type pattern matching

6 years agoMerge pull request #5260 from BrzVlad/fix-handler-block
Vlad Brezae [Fri, 28 Jul 2017 19:14:33 +0000 (22:14 +0300)]
Merge pull request #5260 from BrzVlad/fix-handler-block

[runtime] Fix handler block abort

6 years agoMerge pull request #5272 from lambdageek/bug-58421
Aleksey Kliger (λgeek) [Fri, 28 Jul 2017 16:00:09 +0000 (12:00 -0400)]
Merge pull request #5272 from lambdageek/bug-58421

[sre] Handle typeref tokens in fixup_method (Fixes #58421)

6 years ago[mcs] Implements cloning for yield break. Fixes #57796
Marek Safar [Fri, 28 Jul 2017 09:12:47 +0000 (11:12 +0200)]
[mcs] Implements cloning for yield break. Fixes #57796

6 years agoEglib integrate (#5267)
Zoltan Varga [Fri, 28 Jul 2017 04:16:18 +0000 (00:16 -0400)]
Eglib integrate (#5267)

* [runtime] Integrate eglib's configure into mono's configure to simplify and speed up the configure process.

* [runtime] Delete some duplicate eglib configure code.

6 years agoMerge pull request #5271 from lambdageek/bug-58361
Aleksey Kliger (λgeek) [Thu, 27 Jul 2017 21:55:47 +0000 (17:55 -0400)]
Merge pull request #5271 from lambdageek/bug-58361

[sre] Resolve EnumBuilder tokens in managed (Fixes #58361)

6 years agoBump corlib version
Aleksey Kliger [Thu, 27 Jul 2017 15:47:34 +0000 (11:47 -0400)]
Bump corlib version

Due to changed semantics of ModuleBuilder:RegisterToken icall (it now does not
allow an EnumBuilder argument)

6 years ago[sre] Resolve EnumBuilder tokens in managed. (Fixes #58361)
Aleksey Kliger [Wed, 26 Jul 2017 20:59:22 +0000 (16:59 -0400)]
[sre] Resolve EnumBuilder tokens in managed. (Fixes #58361)

In particular, delegate to the TypeBuilder within the EnumBuilder.

Also do not register the EnumBuilder object with the runtime.  (Fixes
https://bugzilla.xamarin.com/show_bug.cgi?id=58361)

6 years ago[test] EnumBuilder regression tests for #58361
Aleksey Kliger [Wed, 26 Jul 2017 19:27:48 +0000 (15:27 -0400)]
[test] EnumBuilder regression tests for #58361

Cause the creation of a token for an EnumBuilder object.  Test both typedef
tokens (EnumBuilder from same assembly) and typeref token (EnumBuilder in another assembly)