mono.git
7 years agoMerge pull request #4048 from kumpera/iface_casting_cleanup
Rodrigo Kumpera [Thu, 1 Dec 2016 19:16:10 +0000 (11:16 -0800)]
Merge pull request #4048 from kumpera/iface_casting_cleanup

[mini] Reorg casting code + optimize casting of magic array interfaces.

7 years ago[w32handle] Rename `statuscode` parameter to `abandoned`
Ludovic Henry [Mon, 28 Nov 2016 20:50:28 +0000 (15:50 -0500)]
[w32handle] Rename `statuscode` parameter to `abandoned`

This parameter is only used to check if a mutex has been abandonned.

7 years ago[corlib] Use Directory.GetFiles/GetDirectories implementation from referencesource...
Alexander Köplinger [Thu, 1 Dec 2016 16:48:26 +0000 (17:48 +0100)]
[corlib] Use Directory.GetFiles/GetDirectories implementation from referencesource (#4042)

We already had implementations of the Windows APIs like FindFirstFile/FindNextFile
in native code but we wrapped it with some convenience functions for our implementation.

The referencesource code works directly against those APIs so I added new icall functions
that are just used for passing data to/from native code.

Note that we have the same problem in the DirectoryInfo.GetFiles() implementation.
Right now that one still uses the old Mono implementation, switching it over to
the referencesource implementation will be done in a separate commit.

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

7 years agoMerge pull request #4065 from akoeplinger/add-mcs-lane
Alexander Köplinger [Thu, 1 Dec 2016 15:53:37 +0000 (16:53 +0100)]
Merge pull request #4065 from akoeplinger/add-mcs-lane

[ci] Add job configuration for testing Mono with mcs as compiler

7 years ago[io-layer] Remove DuplicateHandle
Ludovic Henry [Tue, 29 Nov 2016 16:51:00 +0000 (11:51 -0500)]
[io-layer] Remove DuplicateHandle

7 years agoFix typo in readme.md
Alexander Köplinger [Thu, 1 Dec 2016 15:41:27 +0000 (16:41 +0100)]
Fix typo in readme.md

Also format the options without braces like in the other examples.

7 years agoMerge pull request #4045 from lambdageek/bug-47867
Aleksey Kliger (λgeek) [Thu, 1 Dec 2016 15:33:25 +0000 (10:33 -0500)]
Merge pull request #4045 from lambdageek/bug-47867

[sre] Ensure generic_context is created before instantiating a TypeBuilder

7 years agoMerge pull request #4051 from Unity-Technologies/registry-bug-fixes
Niklas Therning [Thu, 1 Dec 2016 14:40:40 +0000 (15:40 +0100)]
Merge pull request #4051 from Unity-Technologies/registry-bug-fixes

Fix a bug in registry API implementation where had wrong assumptions about possible registry size.

7 years agoFix code convention on changed code.
Tautvydas Žilys [Thu, 1 Dec 2016 14:02:12 +0000 (16:02 +0200)]
Fix code convention on changed code.

7 years ago[ci] Add job configuration for testing Mono with mcs as compiler
Alexander Köplinger [Thu, 1 Dec 2016 13:49:52 +0000 (14:49 +0100)]
[ci] Add job configuration for testing Mono with mcs as compiler

To ensure it doesn't break now that we're using Roslyn by default.

7 years ago[acceptance-tests] Use portable pdb for csc
Alexander Köplinger [Thu, 1 Dec 2016 11:15:21 +0000 (12:15 +0100)]
[acceptance-tests] Use portable pdb for csc

7 years agoMerge pull request #4033 from ntherning/no-stdcall-for-icalls-on-windows-32-bit
Niklas Therning [Thu, 1 Dec 2016 09:42:25 +0000 (10:42 +0100)]
Merge pull request #4033 from ntherning/no-stdcall-for-icalls-on-windows-32-bit

Use __cdecl rather than __stdcall for icalls on Windows 32-bit

7 years ago[jit] Enable inlining inside gshared methods. (#4059)
Zoltan Varga [Thu, 1 Dec 2016 07:10:07 +0000 (02:10 -0500)]
[jit] Enable inlining inside gshared methods. (#4059)

7 years agoRevert "Only allocate 1 empty string instance per AppDomain " (#4062)
Zoltan Varga [Thu, 1 Dec 2016 03:28:41 +0000 (22:28 -0500)]
Revert "Only allocate 1 empty string instance per AppDomain " (#4062)

7 years ago[build] Don't use runtime flags on basic boostrap (they are too new)
Marek Safar [Wed, 30 Nov 2016 21:58:46 +0000 (22:58 +0100)]
[build] Don't use runtime flags on basic boostrap (they are too new)

7 years agoOnly allocate 1 empty string instance per AppDomain (#4047)
Mike Voorhees [Wed, 30 Nov 2016 21:40:19 +0000 (16:40 -0500)]
Only allocate 1 empty string instance per AppDomain  (#4047)

* Reuse a single empty string instance

* Undo string empty change to mono_string_new_size_checked and add new embedding api for string empty instead

7 years ago[ci] Bump timeout in ms-test-suite
Alexander Köplinger [Wed, 30 Nov 2016 21:10:44 +0000 (22:10 +0100)]
[ci] Bump timeout in ms-test-suite

Compiling the test exe's is taking longer now with roslyn.

7 years ago[configure] Detect endianess and use mcs for big-endian systems.
Miguel de Icaza [Wed, 30 Nov 2016 19:53:43 +0000 (14:53 -0500)]
[configure] Detect endianess and use mcs for big-endian systems.

Renames the flag to be more explicit on the intended purpose.  Also,
document the new configuration flag.

The default will probe the right compiler to use.

7 years agoBump bockbuild
Alexis Christoforides [Wed, 30 Nov 2016 19:23:04 +0000 (14:23 -0500)]
Bump bockbuild

7 years ago[msvc] Update csproj files
monojenkins [Wed, 30 Nov 2016 17:09:51 +0000 (17:09 +0000)]
[msvc] Update csproj files

7 years ago[tests] Use CSC to compile gc-descriptors test (#4052)
Aleksey Kliger (λgeek) [Wed, 30 Nov 2016 18:54:21 +0000 (13:54 -0500)]
[tests] Use CSC to compile gc-descriptors test (#4052)

7 years agoMerge pull request #4050 from akoeplinger/profile-speedup
Alexander Köplinger [Wed, 30 Nov 2016 18:47:47 +0000 (19:47 +0100)]
Merge pull request #4050 from akoeplinger/profile-speedup

[ci] Only build the additional profiles on one arch instead of everywhere

7 years ago[io-layer] Remove wait.h
Ludovic Henry [Mon, 28 Nov 2016 20:47:33 +0000 (15:47 -0500)]
[io-layer] Remove wait.h

7 years ago[io-layer] Remove INFINITE
Ludovic Henry [Mon, 28 Nov 2016 20:11:11 +0000 (15:11 -0500)]
[io-layer] Remove INFINITE

7 years ago[io-layer] Extract WaitForSingleObjectEx, WaitForMultipleObjectsEx and SignalObjectAn...
Ludovic Henry [Mon, 28 Nov 2016 19:55:09 +0000 (14:55 -0500)]
[io-layer] Extract WaitForSingleObjectEx, WaitForMultipleObjectsEx and SignalObjectAndWait

7 years ago[reflection] Use mono_module_get_object_handle everywhere (#4010)
Aleksey Kliger (λgeek) [Wed, 30 Nov 2016 17:20:30 +0000 (12:20 -0500)]
[reflection] Use mono_module_get_object_handle everywhere (#4010)

* [reflection] Refactor managed object caching

Split up all the mono_XXX_get_object_checked functions into a generic
cache check and a specific construction function that's called if
there's a cache miss.

* [reflection] Add mono_assembly_get_object_handle

* [reflection] Add mono_module_get_object_handle

* [reflection] Use mono_module_get_object_handle everywhere

instead of mono_module_get_object_checked.

Also implement mono_module_file_get_object_handle instead of mono_module_file_get_object_checked

7 years agoBump bockbuild
Alexis Christoforides [Wed, 30 Nov 2016 16:47:09 +0000 (11:47 -0500)]
Bump bockbuild

7 years agoBump corert submodule
Alexander Köplinger [Wed, 30 Nov 2016 16:21:00 +0000 (17:21 +0100)]
Bump corert submodule

7 years ago[build] Add --with-mcs-compiler config option
Marek Safar [Wed, 30 Nov 2016 10:08:59 +0000 (11:08 +0100)]
[build] Add --with-mcs-compiler config option

7 years ago[mcs] Fixes runtimemetadataversion option check
Marek Safar [Wed, 30 Nov 2016 10:05:28 +0000 (11:05 +0100)]
[mcs] Fixes runtimemetadataversion option check

7 years agoFix a bug in registry API implementation where had wrong assumptions about possible...
Tautvydas Žilys [Wed, 30 Nov 2016 14:40:21 +0000 (16:40 +0200)]
Fix a bug in registry API implementation where had wrong assumptions about possible registry size.

7 years ago[build] Prepare roslyn 2.0 bootstrap dependencies
Marek Safar [Wed, 30 Nov 2016 14:29:30 +0000 (15:29 +0100)]
[build] Prepare roslyn 2.0 bootstrap dependencies

7 years ago[build] Set monolite path also for Facades
Marek Safar [Wed, 30 Nov 2016 14:21:13 +0000 (15:21 +0100)]
[build] Set monolite path also for Facades

7 years agoMerge pull request #3748 from akoeplinger/fix-rng-monotouch
Alexander Köplinger [Wed, 30 Nov 2016 13:56:51 +0000 (14:56 +0100)]
Merge pull request #3748 from akoeplinger/fix-rng-monotouch

[corlib] Simplify RNGCryptoServiceProvider file name on MT and enable tests

7 years ago[xbuild] Add workaround for pre-2.0 csc and convert full to portable debug mode
Marek Safar [Wed, 30 Nov 2016 13:35:54 +0000 (14:35 +0100)]
[xbuild] Add workaround for pre-2.0 csc and convert full to portable debug mode

7 years ago[ci] Only build the additional profiles on one arch instead of everywhere
Alexander Köplinger [Wed, 30 Nov 2016 13:31:12 +0000 (14:31 +0100)]
[ci] Only build the additional profiles on one arch instead of everywhere

The additional profiles like monotouch, monodroid etc. are normal
managed code anyway and are the same no matter where they're built
so we can save a lot of CI time by not building them e.g. on slower
ARM bots.

7 years ago[build] Use custom nursery size and clean up csc runtime arguments
Marek Safar [Tue, 29 Nov 2016 18:51:14 +0000 (19:51 +0100)]
[build] Use custom nursery size and clean up csc runtime arguments

7 years ago[referencesource] Fix a regression from 47a6f56439c9deab287be770c902d41e91480799
Alexander Köplinger [Wed, 30 Nov 2016 01:20:55 +0000 (02:20 +0100)]
[referencesource] Fix a regression from 47a6f56439c9deab287be770c902d41e91480799

ResourceSets needs to be initialized on Mono.

7 years ago[mini] Use the array fast path with array magic interfaces. Do the expensive check...
Rodrigo Kumpera [Wed, 30 Nov 2016 00:34:33 +0000 (16:34 -0800)]
[mini] Use the array fast path with array magic interfaces. Do the expensive check in the slow path.

7 years ago[mini] Cleanup type casting a bit. Unify cast with with cache setup code.
Rodrigo Kumpera [Tue, 29 Nov 2016 22:02:42 +0000 (14:02 -0800)]
[mini] Cleanup type casting a bit. Unify cast with with cache setup code.

7 years ago[jit] Add counters for number of JITted method discarded as duplicates and the time...
Zoltan Varga [Tue, 29 Nov 2016 21:46:19 +0000 (16:46 -0500)]
[jit] Add counters for number of JITted method discarded as duplicates and the time spent JITting them. Remove opt set from -v output, it just adds noise.

7 years agoMerge pull request #4041 from CyberShadow/pull-20161129-100901
Marek Safar [Tue, 29 Nov 2016 20:07:54 +0000 (21:07 +0100)]
Merge pull request #4041 from CyberShadow/pull-20161129-100901

ilasm: Add stub parsing for .data cil attribute

7 years agoAdd CoreRT submodule
Marek Safar [Tue, 29 Nov 2016 18:20:11 +0000 (19:20 +0100)]
Add CoreRT submodule

7 years ago[bcl] Clean up some warnings
Marek Safar [Tue, 29 Nov 2016 18:16:02 +0000 (19:16 +0100)]
[bcl] Clean up some warnings

7 years ago[sre] Do we ever try to instantiate a generic instance? Assert that we don't.
Aleksey Kliger [Tue, 29 Nov 2016 15:34:39 +0000 (10:34 -0500)]
[sre] Do we ever try to instantiate a generic instance? Assert that we don't.

7 years ago[sre] Throw a TLE if a generic inst is used before the gtd is created.
Aleksey Kliger [Tue, 29 Nov 2016 15:31:08 +0000 (10:31 -0500)]
[sre] Throw a TLE if a generic inst is used before the gtd is created.

This can happen if TypeBuilders are used to construct something like
  class S<T> {
    ...
  }
  class R {
    public S<int> SI;
  }

And then CreateType() is called for R and GetField("SI") is called on
  the result before CreateType() is called on the builder for S.

7 years ago[sre] Make sure a generic definition TypeBuilder has its generic_container setup...
Aleksey Kliger [Mon, 28 Nov 2016 23:21:39 +0000 (18:21 -0500)]
[sre] Make sure a generic definition TypeBuilder has its generic_container setup before we try to instantiate it.

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

7 years ago[test] Generic typebuilder field in another typebuilder should work.
Aleksey Kliger [Tue, 29 Nov 2016 00:40:10 +0000 (19:40 -0500)]
[test] Generic typebuilder field in another typebuilder should work.

Even if the generic typebuilder hasn't had CreateType() called on it
yet.

Regression tests for https://bugzilla.xamarin.com/show_bug.cgi?id=47867

7 years agoRevert "[build] Enable aot for Microsoft.CodeAnalysis.dll/Microsoft.CodeAnalysis...
Marek Safar [Tue, 29 Nov 2016 15:29:08 +0000 (16:29 +0100)]
Revert "[build] Enable aot for Microsoft.CodeAnalysis.dll/Microsoft.CodeAnalysis.CSharp.dll, as the aot compiler generates smaller images now."

This reverts commit e186dcff2c2b6c6f32c72858425ba8b9d8b33efb.

7 years ago[configure.ac] Rename `hybrid` runtime preset to `aot_preferred`
Ludovic Henry [Mon, 28 Nov 2016 18:24:22 +0000 (13:24 -0500)]
[configure.ac] Rename `hybrid` runtime preset to `aot_preferred`

7 years agoMerge pull request #4040 from ntherning/disable-symbolicate-tests-on-windows
Niklas Therning [Tue, 29 Nov 2016 14:40:27 +0000 (15:40 +0100)]
Merge pull request #4040 from ntherning/disable-symbolicate-tests-on-windows

Disable symbolicate tests on Windows

7 years ago[System] Report test failure using Assert
Marek Safar [Tue, 29 Nov 2016 11:01:19 +0000 (12:01 +0100)]
[System] Report test failure using Assert

7 years ago[System] Update ClientWebSocket test to use Setup
Marek Safar [Tue, 29 Nov 2016 10:44:37 +0000 (11:44 +0100)]
[System] Update ClientWebSocket test to use Setup

7 years agoilasm: Add stub parsing for .data cil attribute
Vladimir Panteleev [Tue, 29 Nov 2016 10:28:21 +0000 (10:28 +0000)]
ilasm: Add stub parsing for .data cil attribute

The "cil" attribute seems to indicate that the data should be placed
in the .text section, along with the code.

Like the tls attribute, the cil attribute is only implemented insofar
as to recognize it as a valid keyword that can occur in a .data
declaration.

7 years agoDisable symbolicate tests on Windows
Niklas Therning [Tue, 29 Nov 2016 09:56:08 +0000 (10:56 +0100)]
Disable symbolicate tests on Windows

We will ignore the failing test-with-aot-msym test for now.

7 years ago[bcl] Fix a regression introduced by 91c68de23f5067d000207194466813239cda7866. If...
Zoltan Varga [Tue, 29 Nov 2016 08:06:55 +0000 (03:06 -0500)]
[bcl] Fix a regression introduced by 91c68de23f5067d000207194466813239cda7866. If a thread was added to (#4038)

blocking_threads twice, then removed once, the corresponding entry in threads_stacktraces was removed,
causing an exception in ReleaseHandle () later.

7 years ago[runtime] Add error handling to mono_get_dbnull_object () it can fail due to a TAE...
Zoltan Varga [Tue, 29 Nov 2016 08:01:35 +0000 (03:01 -0500)]
[runtime] Add error handling to mono_get_dbnull_object () it can fail due to a TAE. (#4039)

7 years agoMerge pull request #4023 from lateralusX/jlorenss/test-driver-reporter
Johan Lorensson [Tue, 29 Nov 2016 07:47:12 +0000 (08:47 +0100)]
Merge pull request #4023 from lateralusX/jlorenss/test-driver-reporter

Adding support to get test results back from TestDriver.

7 years ago[build] Enable aot for Microsoft.CodeAnalysis.dll/Microsoft.CodeAnalysis.CSharp.dll...
Zoltan Varga [Tue, 29 Nov 2016 05:29:18 +0000 (00:29 -0500)]
[build] Enable aot for Microsoft.CodeAnalysis.dll/Microsoft.CodeAnalysis.CSharp.dll, as the aot compiler generates smaller images now.

7 years ago[aot] Only emit instances when using full aot.
Zoltan Varga [Tue, 29 Nov 2016 05:22:42 +0000 (00:22 -0500)]
[aot] Only emit instances when using full aot.

7 years ago[runtime] Fix e659982b7b8f11ecf80919646353ad3c16240697, two callbacks were mixed up.
Zoltan Varga [Tue, 29 Nov 2016 02:13:39 +0000 (21:13 -0500)]
[runtime] Fix e659982b7b8f11ecf80919646353ad3c16240697, two callbacks were mixed up.

7 years agoPrevent ThreadAbort from prematurely ending function calls in catch block (#1837)
Alexander Kyte [Tue, 29 Nov 2016 02:01:09 +0000 (21:01 -0500)]
Prevent ThreadAbort from prematurely ending function calls in catch block (#1837)

* [runtime] Fix naming scheme for check if stack grows upward

It was very counter-intutitive to have a file-local preprocessor variable
with a name that sounds like it should have the same truthiness as a given global
preprocessor variable but was defined as the negation of the global variable.

* [runtime] Prevent ThreadAbort from terminating function calls in catch body

ThreadAbortExceptions are special in that if the thread has not
had it's abortion reset, when it reaches the end of a catch block it
must throw.

Consider the situation where a thread has been aborted and the
ThreadAbortException has been caught. If this catch block calls
a method that has a try/catch combination, the current implementation
will throw the ThreadAbortException at the end of the catch in that
function.

Usually you only care that Thread abortions are prompt, but this bug
could result in dramatic program behavior changes when this is combined
with lazy class initialization.

```
Example:
Console.WriteLine inside a thread abort with an uninitialized Console.
```

This fix records the stack pointer when a catch clause is entered, and
only rethrows the abortion if we're exiting a catch clause above or at the
level of the catch clause previously entered.

7 years ago[aot] Bump aot file version after c690636c01df73badb1e24c146da8492dbeabade.
Zoltan Varga [Tue, 29 Nov 2016 01:58:45 +0000 (20:58 -0500)]
[aot] Bump aot file version after c690636c01df73badb1e24c146da8492dbeabade.

7 years ago[jit] Call mono_jit_thread_attach () through a GOT slot instead of directly, so the...
Zoltan Varga [Tue, 29 Nov 2016 01:57:52 +0000 (20:57 -0500)]
[jit] Call mono_jit_thread_attach () through a GOT slot instead of directly, so the call doesn't go through the trampoline code which wouldn't work if the thread was not attached. (#4037)

7 years ago[llvm] Fix a regression introduced by d231b5134decb9f2303be441a119ca552b51d0e1.
Zoltan Varga [Tue, 29 Nov 2016 01:14:11 +0000 (20:14 -0500)]
[llvm] Fix a regression introduced by d231b5134decb9f2303be441a119ca552b51d0e1.

7 years agoadd type-checking.c to the build.
Rodrigo Kumpera [Tue, 29 Nov 2016 00:05:20 +0000 (16:05 -0800)]
add type-checking.c to the build.

7 years ago[runtime] CEE_MONO_CISINST is dead. Removed the type-cast half.
Rodrigo Kumpera [Sun, 27 Nov 2016 09:54:57 +0000 (01:54 -0800)]
[runtime] CEE_MONO_CISINST is dead. Removed the type-cast half.

7 years ago[mini] Remove the need for isinst wrapper for MBRO.
Rodrigo Kumpera [Sun, 27 Nov 2016 09:53:17 +0000 (01:53 -0800)]
[mini] Remove the need for isinst wrapper for MBRO.

7 years ago[mini] Remove the need of the ininst wrapper for interfaces.
Rodrigo Kumpera [Sun, 27 Nov 2016 06:21:38 +0000 (22:21 -0800)]
[mini] Remove the need of the ininst wrapper for interfaces.

7 years ago[mini] Remove CEE_MONO_CCASTCLASS. Could not remove from opcodes.def at it weirdly...
Rodrigo Kumpera [Sun, 27 Nov 2016 02:04:21 +0000 (18:04 -0800)]
[mini] Remove CEE_MONO_CCASTCLASS. Could not remove from opcodes.def at it weirdly breaks mono/mini/arrays.cs.

7 years ago[mini] CEE_MONO_CCASTCLASS is dead. Removed the type-cast half.
Rodrigo Kumpera [Sat, 26 Nov 2016 06:17:47 +0000 (22:17 -0800)]
[mini] CEE_MONO_CCASTCLASS is dead. Removed the type-cast half.

7 years ago[mini] Avoid the cast wrapper for MBRO.
Rodrigo Kumpera [Sat, 26 Nov 2016 06:12:00 +0000 (22:12 -0800)]
[mini] Avoid the cast wrapper for MBRO.

7 years agoRemove dead code.
Rodrigo Kumpera [Sat, 26 Nov 2016 05:34:07 +0000 (21:34 -0800)]
Remove dead code.

7 years ago[mini] Avoid the cast wrapper for ifaces
Rodrigo Kumpera [Fri, 25 Nov 2016 05:48:37 +0000 (21:48 -0800)]
[mini] Avoid the cast wrapper for ifaces

7 years ago[mini] Simplify casting of variant generic interfaces.
Rodrigo Kumpera [Fri, 25 Nov 2016 03:35:38 +0000 (19:35 -0800)]
[mini] Simplify casting of variant generic interfaces.

7 years ago[mini] Extract type checking code into type-checking.c
Rodrigo Kumpera [Thu, 24 Nov 2016 23:15:12 +0000 (15:15 -0800)]
[mini] Extract type checking code into type-checking.c

7 years agoMerge pull request #4009 from kumpera/lazy-array-ifaces
Rodrigo Kumpera [Mon, 28 Nov 2016 23:54:03 +0000 (18:54 -0500)]
Merge pull request #4009 from kumpera/lazy-array-ifaces

[runtime] Implement lazy interface implementation for arrays.

7 years ago[runtime] Remove the eager array interfaces code. Good ridance.
Rodrigo Kumpera [Mon, 28 Nov 2016 22:54:38 +0000 (14:54 -0800)]
[runtime] Remove the eager array interfaces code. Good ridance.

7 years ago[runtime] Clean mono_init_internal hacks. Moved to mono_class_setup_mono_type / mono_...
Rodrigo Kumpera [Mon, 28 Nov 2016 22:54:18 +0000 (14:54 -0800)]
[runtime] Clean mono_init_internal hacks. Moved to mono_class_setup_mono_type / mono_class_create_from_typedef.

7 years ago[runtime] Fix bad packing in MonoClass.
Rodrigo Kumpera [Tue, 22 Nov 2016 23:30:41 +0000 (15:30 -0800)]
[runtime] Fix bad packing in MonoClass.

7 years ago[runtime] Implement lazy interface implementation for arrays.
Rodrigo Kumpera [Mon, 21 Nov 2016 23:22:08 +0000 (15:22 -0800)]
[runtime] Implement lazy interface implementation for arrays.

We have the following set of problems:

Arrays implement interfaces that are invariant but behave like covariant.
Those are IList`1, ICollection`1, IEnumerable`1

Arrays of primitive types are type equivalent based on their underlying type.
This means int[], uint[] and IntEnum[] are all interchangeable. And so is casting among their interfaces.
Meaning this is valid: `(IList<IntEnum>)(object)new int[1]`.

Finally, the way we implement IEnumerator`1 for arrays forces it to behave just like the other 3 interfaces.

Implementation:

Introduce MonoClass::is_array_special_interface, set for all the above interfaces. This allow fast checking of the interfaces in question.

mono_class_is_assignable_from now includes the array casting rules.

Change mono_class_interface_offset_with_variance to take arrays into account when looking for a candidate iface.

The JIT implements casting of those interfaces using the cast with cache wrapper.

Finally, to handle the weird primitive rules, set the cast_class of sbyte, ushort, uint and ulong to their same-size buddies.
This makes it easier for the casting code to resolve this problem.

Problems:

Casting performance is terrible, anywhere from 60% to 1000% slower on a micro-benchmark.
Can be improved by extending our casting wrapper to handle those interfaces (probably would have to give up inlining as they would be huge)

The code in domain.c is icky, but not sure where to put it otherwise.

IEnumerator could be solved in Array.cs by not forcing it to be magic as well. Meaning the folowing

```
object array = new int[1];
var a = array as IList<int>;
var b = array as IList<uint>;

a.GetEnumerator().GetType () != b.GetEnumerator().GetType ();
```

The last line is false today but it's harmless to change it to avoid the casting penalty for such central type.

7 years ago[build] Install also from mcs/packages
Marek Safar [Mon, 28 Nov 2016 22:30:14 +0000 (23:30 +0100)]
[build] Install also from mcs/packages

7 years agoRevert "[CI] Disable winforms tests on all platforms."
Zoltan Varga [Mon, 28 Nov 2016 19:04:46 +0000 (14:04 -0500)]
Revert "[CI] Disable winforms tests on all platforms."

This reverts commit 598183023b74fad649a43fd9fbeec0f962a55a8a.

7 years ago[CI] Disable winforms tests on all platforms.
Zoltan Varga [Mon, 28 Nov 2016 18:56:37 +0000 (13:56 -0500)]
[CI] Disable winforms tests on all platforms.

7 years agoConvert MonoClassExt to class properties (#4022)
Zoltan Varga [Mon, 28 Nov 2016 18:42:16 +0000 (13:42 -0500)]
Convert MonoClassExt to class properties (#4022)

* [runtime] Store the class failure data as a property.

* [runtime] Store the list of nested classes as a class property.

* [runtime] Move the property relation information from MonoClassExt into a class property.

* [runtime] Move the event relation information from MonoClassExt into a class property.

* [runtime] Move the field_def_values field from MonoClassExt into a class property.

* [runtime] Move the declsec_flags field from MonoClassExt into a class property.

* [runtime] Remove unused MonoClassExt infrastructure.

* [runtime] Add some API docs.

7 years agoMerge pull request #4015 from xmcclure/new-threads-collect-fix
Andi McClure [Mon, 28 Nov 2016 15:37:55 +0000 (10:37 -0500)]
Merge pull request #4015 from xmcclure/new-threads-collect-fix

Possibly fix hang in sgen-new-threads-collect.exe

7 years agoUse __cdecl rather than __stdcall for icalls on Windows 32-bit
Niklas Therning [Mon, 28 Nov 2016 14:25:01 +0000 (15:25 +0100)]
Use __cdecl rather than __stdcall for icalls on Windows 32-bit

Mono assumes the same calling convention for icalls as the default P/Invoke
calling convention which is __stdcall on Windows. But none of the icalls are
marked with the required __stdcall attribute on Windows so there will be a
mismatch between the caller and callee.

This is the reason why the System.Web.HttpUtilityTest.JavaScriptStringEncode()
test crashes on Windows 32-bit. It generates a call to an icall
(char.ToString() inlines to new string(char,int)) which is assumed to be
__stdcall while it's actually __cdecl. The caller will decrement ESP as if the
callee was __stdcall resulting in ESP decreasing on each iteration. After a
couple of thousand iterations in the loop in that test the stack guard page is
hit and a stack overflow occurs.

7 years agoMerge pull request #2774 from marek-safar/roslyn
Marek Safar [Mon, 28 Nov 2016 13:38:54 +0000 (14:38 +0100)]
Merge pull request #2774 from marek-safar/roslyn

Roslyn compiler switch

7 years agoMerge pull request #3973 from mono/small-perf
Vlad Brezae [Mon, 28 Nov 2016 12:38:16 +0000 (14:38 +0200)]
Merge pull request #3973 from mono/small-perf

[Perf] Replace some exhaustive O(n^3) or O(n^2) iterations with O(n)

7 years agoSwitch to cecil branch with better pdb handling
Marek Safar [Wed, 19 Oct 2016 19:00:42 +0000 (21:00 +0200)]
Switch to cecil branch with better pdb handling

7 years ago[build] Bump required bootraping mono version and download it automatically
Marek Safar [Tue, 15 Nov 2016 16:32:37 +0000 (17:32 +0100)]
[build] Bump required bootraping mono version and download it automatically

7 years ago[build] Roslyn switch
Marek Safar [Tue, 5 Apr 2016 14:34:53 +0000 (16:34 +0200)]
[build] Roslyn switch

7 years ago[marshal] Fix API documentation comment on mono_string_to_byvalwstr
Miguel de Icaza [Mon, 28 Nov 2016 02:37:47 +0000 (21:37 -0500)]
[marshal] Fix API documentation comment on mono_string_to_byvalwstr

7 years ago[runtime] Fix mono_image_load_module_checked () so it actually stores the loaded...
Zoltan Varga [Mon, 28 Nov 2016 02:36:48 +0000 (21:36 -0500)]
[runtime] Fix mono_image_load_module_checked () so it actually stores the loaded netmodule in image->modules, not the parent image itself. Fixes #47762. (#4029)

7 years ago[aot] Avoid a crash on class loading failures. Fixes #47152.
Zoltan Varga [Sun, 27 Nov 2016 03:45:21 +0000 (22:45 -0500)]
[aot] Avoid a crash on class loading failures. Fixes #47152.

7 years ago[runtime] Fix a warning.
Zoltan Varga [Sat, 26 Nov 2016 22:02:40 +0000 (17:02 -0500)]
[runtime] Fix a warning.

7 years ago[jit] Fix some SIMD problems on x86.
Zoltan Varga [Sat, 26 Nov 2016 21:33:31 +0000 (16:33 -0500)]
[jit] Fix some SIMD problems on x86.

7 years agoMerge pull request #4028 from monojenkins/update-csprojs
Alexander Köplinger [Sat, 26 Nov 2016 18:16:09 +0000 (19:16 +0100)]
Merge pull request #4028 from monojenkins/update-csprojs

[msvc] Update csproj files

7 years ago[msvc] Update csproj files
monojenkins [Sat, 26 Nov 2016 16:45:55 +0000 (16:45 +0000)]
[msvc] Update csproj files

7 years ago[Facades] Don't build System.Drawing.Primitives.dll by default for monotouch_watch...
Alexander Köplinger [Fri, 25 Nov 2016 19:48:36 +0000 (20:48 +0100)]
[Facades] Don't build System.Drawing.Primitives.dll by default for monotouch_watch profile

It needs special logic like the other monotouch profiles in the products
since we don't have a System.Drawing assembly/types for these profiles in Mono
and don't embed the types in the facade anymore after 1074fe91bd9b33a84040cc9d0d5da42079633d2a.