platform/upstream/dotnet/runtime.git
4 years agoMerge branch 'master' of mono
dotnet-bot [Sat, 18 Jan 2020 10:20:09 +0000 (05:20 -0500)]
Merge branch 'master' of mono

4 years agoFixes runtime issue #1739 (#1840)
Brian Sullivan [Fri, 17 Jan 2020 19:59:45 +0000 (11:59 -0800)]
Fixes runtime issue #1739 (#1840)

* Fixes runtime issue 1739
Added additional check for Jit Stress mode STRESS_LCL_FLDS
This stress mode requires that the types exactly match

* Code review feedback

4 years agoMerge pull request #1759 from vitek-karas/NativeSearchDirsFix
Vitek Karas [Fri, 17 Jan 2020 19:22:44 +0000 (11:22 -0800)]
Merge pull request #1759 from vitek-karas/NativeSearchDirsFix

hostfxr_get_native_search_directories must fail when given CLI command

There's no check that when running with a "command" like hostfxr_get_native_search_directories that the code will not try to locate SDK and run CLI commands.
If it happens not only it does wrong things, but the return values are bogus (it doesn't fill the output buffer).

This change adds the necessary check to avoid this completely. It also makes sure that the output buffer size is always correctly set, even on errors.

Moved all the tests for hostfxr_get_native_search_directories to use nativehost and add a test to cover this case.

4 years agoFix Linux_x64_glibc condition to build RPM/Deb (#1861)
Davis Goodin [Fri, 17 Jan 2020 19:15:31 +0000 (13:15 -0600)]
Fix Linux_x64_glibc condition to build RPM/Deb (#1861)

4 years agoAdding area owners for new mono labels (#1865)
Maryam Ariyan [Fri, 17 Jan 2020 18:49:42 +0000 (10:49 -0800)]
Adding area owners for new mono labels (#1865)

4 years agoImplement required HttpClient apis in System.Net.Quic (#1703)
Justin Kotalik [Fri, 17 Jan 2020 18:21:13 +0000 (10:21 -0800)]
Implement required HttpClient apis in System.Net.Quic (#1703)

4 years agoUpdate status badge link (#1855)
Adam Sitnik [Fri, 17 Jan 2020 17:48:49 +0000 (18:48 +0100)]
Update status badge link (#1855)

4 years agoadd benchmarking and profiling workflow docs links (#1856)
Adam Sitnik [Fri, 17 Jan 2020 14:37:34 +0000 (15:37 +0100)]
add benchmarking and profiling workflow docs links (#1856)

4 years agoSpanify and cleanup System.Security.Principal.Windows
Wraith2 [Fri, 17 Jan 2020 14:21:50 +0000 (14:21 +0000)]
Spanify and cleanup System.Security.Principal.Windows

* spanify internal constructor, caller and callees
* rename locals and fields to match current style
* save the SecurityIdentifier objects for WindowsIdentity's Is(Something) properties as statics

4 years agorevert CPU clipping to 3.0, 2.x behavior (#1851)
Vladimir Sadov [Fri, 17 Jan 2020 13:20:10 +0000 (05:20 -0800)]
revert CPU clipping to 3.0, 2.x behavior (#1851)

4 years agoCompilation warnings fixes (mono/mono#18495)
Nikolay Sivov [Fri, 17 Jan 2020 13:16:03 +0000 (16:16 +0300)]
Compilation warnings fixes (mono/mono#18495)

Compilation warnings fixes

Commit migrated from https://github.com/mono/mono/commit/0a96741f9374f27757000a3cfcf100d98bcc3758

4 years agoZipFile.CreateFromDirectory: ensure entryEncoding parameter is being passed (#1825)
Eirik Tsarpalis [Fri, 17 Jan 2020 11:51:34 +0000 (13:51 +0200)]
ZipFile.CreateFromDirectory: ensure entryEncoding parameter is being passed (#1825)

4 years agoCoalesce adjacent loops in concatenation RegexNodes (#1838)
Stephen Toub [Fri, 17 Jan 2020 11:25:04 +0000 (06:25 -0500)]
Coalesce adjacent loops in concatenation RegexNodes (#1838)

* Coalesce adjacent loops in concatenation RegexNodes

This augments the reduction phase of concatenation nodes to combine adjacent one/notone/setloops, e.g. `a*a+a{1,2}b` becomes `a{2,}b` (previously added optimizations will then see that the a loop can be made atomic and replace it with the equivalent of `(?>a{2,})b`).  This has several benefits.  First, it simplifies the node tree, creating less work for IR writer and less work for the interpreter/compiler.  Second, it gives the compiler more opportunity to choose how the loop should be represented, when and how to unroll, etc.  Third, it enables the auto-atomicity step to apply to more loops (as in the previous example).  And most importantly, it can drastically reduce backtracking (especially with the atomicity optimization, but even without that).  An expression like `a*a*a*a*a*a*b` run against an input like `aaaaaaaaaaaaaa` could previously take a very long time; now, it'll be very fast.

* Follow-up from previous PRs this is now rebased on

4 years agoFix tests on linux
vitek-karas [Fri, 17 Jan 2020 11:06:35 +0000 (03:06 -0800)]
Fix tests on linux

Different path normalization behavior

4 years agoImplement SuppressGCTransition attribute in crossgen2 (#1772)
Michal Strehovský [Fri, 17 Jan 2020 10:49:57 +0000 (11:49 +0100)]
Implement SuppressGCTransition attribute in crossgen2 (#1772)

Fixes dotnet/coreclr#27188.

4 years ago[prof] remove wrong cast for format string (mono/mono#18477)
Bernhard Urban-Forster [Fri, 17 Jan 2020 10:05:50 +0000 (11:05 +0100)]
[prof] remove wrong cast for format string (mono/mono#18477)

[prof] remove wrong cast for format string

Fixes this warning:
```
  CC       mprof-report.o
mprof-report.c:408:62: warning: format specifies type 'char *' but the argument has type 'guint64' (aka 'unsigned long long') [-Wformat]
                        snprintf (format, sizeof (format), "%s : %%" PRIu64 "\n", (guint64)key_format);
                                                            ~~                    ^~~~~~~~~~~~~~~~~~~
                                                            %llu
/Applications/Xcode112.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro
      'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                             ^~~~~~~~~~~
```

mistake in refactoring commit https://github.com/mono/mono/commit/mono/mono@07402062541fa9555bef99dbaac84cfb587926cd#diff-c825627ea9ddb3fa753fa3617eaec7c8R408

Commit migrated from https://github.com/mono/mono/commit/73eeda130fceacebec5f1ccbae10478e7fc7c051

4 years agoFix tracing rundown tests with optimizations and large version bubble (#507)
Jan Vorlicek [Fri, 17 Jan 2020 09:52:57 +0000 (10:52 +0100)]
Fix tracing rundown tests with optimizations and large version bubble (#507)

* Fix tracing rundown tests with optimizations

The test is failing when compiled with crossgen2 with optimizations due
to the fact that it didn't find System.Diagnostics.Tracing loaded. The
reason is that due to cross module inlining, the
System.Diagnostics.Tracing was not needed anymore.
I have fixed it by checking for the
Microsoft.Diagnostics.Tracing.TraceEvent assembly.

4 years ago[netcore] Mark InitializeCurrentThread NoInlining (mono/mono#18493)
Aleksey Kliger (λgeek) [Fri, 17 Jan 2020 09:43:05 +0000 (04:43 -0500)]
[netcore] Mark InitializeCurrentThread NoInlining (mono/mono#18493)

Follow-up for https://github.com/mono/mono/pull/18480

We might want to replace calls to this with an intrinsic

Commit migrated from https://github.com/mono/mono/commit/1f0e147cddcc9b900f7e487dfed2a8ca008830b0

4 years ago[runtime] fix warnings on linux (gcc 8.3.0) (mono/mono#18479)
Bernhard Urban-Forster [Fri, 17 Jan 2020 08:36:32 +0000 (09:36 +0100)]
[runtime] fix warnings on linux (gcc 8.3.0) (mono/mono#18479)

* [aot] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
aot-compiler.c: In function ‘emit_trampolines’:
aot-compiler.c:7675:28: warning: ‘_e’ directive writing 2 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
    sprintf (end_symbol, "%s_e", symbol);
                            ^~
aot-compiler.c:7675:4: note: ‘sprintf’ output between 3 and 258 bytes into a destination of size 256
    sprintf (end_symbol, "%s_e", symbol);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At top level:
aot-compiler.c:753:1: warning: ‘link_shared_library’ defined but not used [-Wunused-function]
 link_shared_library (MonoAotCompile *acfg)
 ^~~~~~~~~~~~~~~~~~~
aot-compiler.c:558:1: warning: ‘mangle_symbol_alloc’ defined but not used [-Wunused-function]
 mangle_symbol_alloc (const char * symbol)
 ^~~~~~~~~~~~~~~~~~~
aot-compiler.c:535:1: warning: ‘mangle_symbol’ defined but not used [-Wunused-function]
 mangle_symbol (const char * symbol, char * mangled_symbol, gsize length)
 ^~~~~~~~~~~~~~~~~~~
```

* [amd64] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
tramp-amd64.c: In function ‘mono_arch_create_generic_trampoline’:
tramp-amd64.c:242:65: warning: variable ‘ex_offset’ set but not used [-Wunused-but-set-variable]
  int i, lmf_offset, offset, res_offset, arg_offset, rax_offset, ex_offset, tramp_offset, ctx_offset, saved_regs_offset;
                                                                 ^~~~~~~~~
```

* [lldb] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
lldb.c:243:1: warning: ‘buffer_add_buffer’ defined but not used [-Wunused-function]
 buffer_add_buffer (Buffer *buf, Buffer *data)
 ^~~~~~~~~~~~~~~~~
lldb.c:215:1: warning: ‘buffer_add_id’ defined but not used [-Wunused-function]
 buffer_add_id (Buffer *buf, int id)
 ^~~~~~~~~~~~~
lldb.c:208:1: warning: ‘buffer_add_long’ defined but not used [-Wunused-function]
 buffer_add_long (Buffer *buf, guint64 l)
 ^~~~~~~~~~~~~~~
lldb.c:188:1: warning: ‘buffer_add_short’ defined but not used [-Wunused-function]
 buffer_add_short (Buffer *buf, guint32 val)
 ^~~~~~~~~~~~~~~~

```

* [interp] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
interp/interp.c:3425:1: warning: ‘g_error_xsx’ defined but not used [-Wunused-function]
 g_error_xsx (const char *format, int x1, const char *s, int x2)
 ^~~~~~~~~~~
  CC       interp/libmono_ee_interp_la-mintops.lo
  CC       interp/libmono_ee_interp_la-transform.lo
  CCLD     libmono-ee-interp.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       libmono_dbg_la-debugger-agent.lo
  CC       libmono_dbg_la-debugger-state-machine.lo
  CC       libmono_dbg_la-debugger-engine.lo
  CCLD     libmono-dbg.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CCLD     mono-sgen
  AR       libmain.a
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       interp/libmaintest_a-whitebox.o
In file included from interp/whitebox.c:3:
interp/transform.h:163:12: warning: ‘stack_type’ defined but not used [-Wunused-variable]
 static int stack_type [] = {
            ^~~~~~~~~~
interp/transform.h:155:20: warning: ‘stack_type_string’ defined but not used [-Wunused-variable]
 static const char *stack_type_string [] = { "I4", "I8", "R4", "R8", "O ", "VT", "MP", "F " };
                    ^~~~~~~~~~~~~~~~~

```

* [thread state] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
  CC       libmonoutils_la-mono-threads-state-machine.lo
mono-threads-state-machine.c:33:1: warning: ‘get_thread_no_safepoints’ defined but not used [-Wunused-function]
 get_thread_no_safepoints (int thread_state)
 ^~~~~~~~~~~~~~~~~~~~~~~~
mono-threads-state-machine.c:26:1: warning: ‘get_thread_suspend_count’ defined but not used [-Wunused-function]
 get_thread_suspend_count (int thread_state)
 ^~~~~~~~~~~~~~~~~~~~~~~~
```

* [domain] fix warnings on linux (gcc 8.3.0)

Fixes these warnings:
```
appdomain.c:2415:1: warning: ‘get_app_context_base_directory’ defined but not used [-Wunused-function]
 get_app_context_base_directory (MonoError *error)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       libmonoruntimesgen_la-assembly-load-context.lo
  CC       libmonoruntimesgen_la-domain.lo
domain.c:135:1: warning: ‘mono_domain_alcs_lock’ declared ‘static’ but never defined [-Wunused-function]
 mono_domain_alcs_lock (MonoDomain *domain);
 ^~~~~~~~~~~~~~~~~~~~~
domain.c:138:1: warning: ‘mono_domain_alcs_unlock’ declared ‘static’ but never defined [-Wunused-function]
 mono_domain_alcs_unlock (MonoDomain *domain);
 ^~~~~~~~~~~~~~~~~~~~~~~
domain.c:2129:1: warning: ‘mono_alc_free’ defined but not used [-Wunused-function]
 mono_alc_free (MonoAssemblyLoadContext *alc)
 ^~~~~~~~~~~~~
domain.c:2108:1: warning: ‘mono_domain_create_default_alc’ defined but not used [-Wunused-function]
 mono_domain_create_default_alc (MonoDomain *domain)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
domain.c:2084:1: warning: ‘create_alc’ defined but not used [-Wunused-function]
 create_alc (MonoDomain *domain, gboolean is_default)
 ^~~~~~~~~~

```

* [native library] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
  CC       libmonoruntimesgen_la-native-library.lo
native-library.c:295:1: warning: ‘mono_loader_register_module_locking’ defined but not used [-Wunused-function]
 mono_loader_register_module_locking (const char *name, MonoDl *module)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

* [sample] fix warnings on linux (gcc 8.3.0)

Fixes this warning:
```
  CC       libtestlib_la-test-mono-embed.lo
In file included from test-mono-embed.c:7:
../../samples/embed/teste.c:20:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 gimme () {
 ^~~~~

```

* fix for checked builds

Commit migrated from https://github.com/mono/mono/commit/b4c506c3045516349d03ce8f3fe9fa5b79a7271c

4 years agoDo not look at Size when doing Auto layout (#1805)
Michal Strehovský [Fri, 17 Jan 2020 08:35:33 +0000 (09:35 +0100)]
Do not look at Size when doing Auto layout (#1805)

Seems like the deleted line was copypasted from the Sequential/Explicit case, but it's incorrect.

Fixes #1770.

4 years agoFlush GC log on shutdown (#1721)
Andrew Au [Fri, 17 Jan 2020 05:09:28 +0000 (21:09 -0800)]
Flush GC log on shutdown (#1721)

4 years agoRecording the reason why we change the generation to condemn during joined_generation...
Andrew Au [Fri, 17 Jan 2020 05:08:50 +0000 (21:08 -0800)]
Recording the reason why we change the generation to condemn during joined_generation_to_condemn() to the event stream (#1042)

4 years agoPort CreateDirectory method as a DirectorySecurity extension (#1834)
Carlos Sanchez Lopez [Fri, 17 Jan 2020 04:35:34 +0000 (20:35 -0800)]
Port CreateDirectory method as a DirectorySecurity extension (#1834)

4 years agoAddress PR feedback from old PR (#1837)
Santiago Fernandez Madero [Fri, 17 Jan 2020 03:54:36 +0000 (19:54 -0800)]
Address PR feedback from old PR (#1837)

4 years ago[runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread (mono...
Aleksey Kliger (λgeek) [Fri, 17 Jan 2020 02:57:54 +0000 (21:57 -0500)]
[runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread (mono/mono#18480)

* [runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread

This function (and its call to mono_handle_new) was showing up in the
flamegraph for some async-heavy benchmarks

Commit migrated from https://github.com/mono/mono/commit/c1498b8d4ce83732d1bab794005cc12f8319053d

4 years agoExpand RegexNode atomicity test to loops at the end of alternation branches (#1769)
Stephen Toub [Fri, 17 Jan 2020 02:20:48 +0000 (21:20 -0500)]
Expand RegexNode atomicity test to loops at the end of alternation branches (#1769)

Given an expression like `(abcd*|efgh*)ijk`, we will now see that if the `i` after the alternation doesn't match and we backtrack into the alternation, we won't need to backtrack into the `d*`, as it can't give back anything that would allow the `i` to match.

4 years agoAutomatically anchor regexes beginning with .* (#1706)
Stephen Toub [Fri, 17 Jan 2020 02:19:25 +0000 (21:19 -0500)]
Automatically anchor regexes beginning with .* (#1706)

4 years agoReview large alignment code in GC (#1351)
Anton Lapounov [Fri, 17 Jan 2020 01:39:12 +0000 (17:39 -0800)]
Review large alignment code in GC (#1351)

Improve comments and fix a couple of places where large alignment was not taken into account. Set pad_in_front to zero if SHORT_PLUGS is not defined.

4 years agoPrompt dialog when running GUI app and hostfxr is < 3.* (#1222)
Mateo Torres-Ruiz [Fri, 17 Jan 2020 01:22:58 +0000 (17:22 -0800)]
Prompt dialog when running GUI app and hostfxr is < 3.* (#1222)

* Prompt dialog when trying to run a GUI app and hostfxr < 3.*

* Check for the ability to set custom error writer in hostfxr instead of checking its version.

* Put error writer inside main_fn_v2 scope.
Don't add unnecessary custom prefixed errors.

* Remove unnecessary if.

* Update error message and url.

* Trigger only when running an apphost gui.

* Check if we redirect apphost traces instead of using ifdefs.

* Add tests.

* Address feedback

* Cleanup.

* Remove unnecessary class HostFxrVersion

* Cast StatusError for comparison with rc

4 years ago[interp] Add missing files to tarball (mono/mono#18482)
Aleksey Kliger (λgeek) [Fri, 17 Jan 2020 00:27:23 +0000 (19:27 -0500)]
[interp] Add missing files to tarball (mono/mono#18482)

Commit migrated from https://github.com/mono/mono/commit/2ba25542e3f3c396ab0b3f516d80c968b39acb23

4 years agoFix dumping of GCSlotFlags in R2RDump (#1833)
Jan Vorlicek [Fri, 17 Jan 2020 00:08:15 +0000 (01:08 +0100)]
Fix dumping of GCSlotFlags in R2RDump (#1833)

There were two issues. If a slot was marked as untracked, we were
replacing whatever flags there were set by GC_SLOT_UNTRACKED. After
fixing that, the other problem was that the GCSlotFlags were not marked
as Flags and so we were not printing it as combination of flags.

4 years agoRemove Windows_NT_arm64 from checked libraries rolling tests (#1839)
Santiago Fernandez Madero [Thu, 16 Jan 2020 23:22:54 +0000 (15:22 -0800)]
Remove Windows_NT_arm64 from checked libraries rolling tests (#1839)

4 years agoJIT: ensure we get the right oper when constructing lcl var and lcl fld (#1824)
Andy Ayers [Thu, 16 Jan 2020 23:19:04 +0000 (15:19 -0800)]
JIT: ensure we get the right oper when constructing lcl var and lcl fld (#1824)

Remove the constructors that default in the oper and force callers to
be explicit about which one they want.

Fixes #1668

4 years agoFix Crossgen2 compilation of System.Private.CoreLib (#1762)
Tomáš Rylek [Thu, 16 Jan 2020 22:34:20 +0000 (23:34 +0100)]
Fix Crossgen2 compilation of System.Private.CoreLib (#1762)

With the switch-over from GetRawSzArrayData to GetArrayDataReference
we must now instantiate the method over the array element type.
Also, we shouldn't be harvesting pseudo-tokens generated during
stub emission.

Thanks

Tomas

4 years agoUpdate macOS build requirements to include openssl
Bruce Forstall [Thu, 16 Jan 2020 22:29:02 +0000 (14:29 -0800)]
Update macOS build requirements to include openssl

4 years agoRevert "On android sometimes there is no valid_info but the ctx is valid and the...
Thays Grazia [Thu, 16 Jan 2020 22:23:58 +0000 (19:23 -0300)]
Revert "On android sometimes there is no valid_info but the ctx is valid and the debug can continue. (mono/mono#18463)" (mono/mono#18490)

This reverts commit mono/mono@61894d4a0745783372f3214f3bf4345d620fbc21.

Commit migrated from https://github.com/mono/mono/commit/e2d8f5ee91f171edb3b49a2e59a353b4e819adb4

4 years agoRemove Windows_NT_arm64 run tests (#1827)
Santiago Fernandez Madero [Thu, 16 Jan 2020 21:16:41 +0000 (13:16 -0800)]
Remove Windows_NT_arm64 run tests (#1827)

4 years agomissing check for `readonly` case in x86 array ::Address stub (#1798)
Vladimir Sadov [Thu, 16 Jan 2020 20:48:52 +0000 (12:48 -0800)]
missing check for `readonly` case in x86 array ::Address stub (#1798)

The check was previously done off the flags after masking the lower 2 bits in the typedesc. The whole thing is now gone.

4 years agoOn android sometimes there is no valid_info but the ctx is valid and the debug can...
Thays Grazia [Thu, 16 Jan 2020 20:34:22 +0000 (17:34 -0300)]
On android sometimes there is no valid_info but the ctx is valid and the debug can continue. (mono/mono#18463)

Fixes mono/mono#18106

Commit migrated from https://github.com/mono/mono/commit/61894d4a0745783372f3214f3bf4345d620fbc21

4 years agoDocumentation refinements (#1738)
Bruce Forstall [Thu, 16 Jan 2020 19:13:04 +0000 (11:13 -0800)]
Documentation refinements (#1738)

* Documentation refinements

* Fix a formatting issue

* Code review updates

4 years agoUpdate the CoreCLR testing workflow doc (#1806)
Michal Strehovský [Thu, 16 Jan 2020 18:26:57 +0000 (19:26 +0100)]
Update the CoreCLR testing workflow doc (#1806)

4 years agoNullable annotate System.IO.Compression.ZipFile (#1811)
Eirik Tsarpalis [Thu, 16 Jan 2020 18:21:09 +0000 (20:21 +0200)]
Nullable annotate System.IO.Compression.ZipFile (#1811)

* Nullable annotate System.IO.Compression.ZipFile

* address feedback

4 years agoenable nullable annotations for System.Dynamic.Runtime (#1810)
Eirik Tsarpalis [Thu, 16 Jan 2020 17:48:07 +0000 (19:48 +0200)]
enable nullable annotations for System.Dynamic.Runtime (#1810)

4 years agocopy CoreRun to the testhost directory to make benchmarking and profiling of local...
Adam Sitnik [Thu, 16 Jan 2020 11:13:25 +0000 (12:13 +0100)]
copy CoreRun to the testhost directory to make benchmarking and profiling of local builds easier (#1756)

4 years agoFix crossgen2 handling of sequential layout with explicit size (#1763)
Jan Vorlicek [Thu, 16 Jan 2020 10:36:39 +0000 (11:36 +0100)]
Fix crossgen2 handling of sequential layout with explicit size (#1763)

Crossgen2 is incorrectly not marking types with sequential layout and
explicit size as custom layout, which results in JIT generating incorrect
code for copying such structs. One example is the
Loader/classloader/SequentialLayout/Regress/ExplicitSize/ExplicitSize
test that has a struct with single int element, sequential layout and
explicitly set size to 16. The getClassAttribsInternal was not setting
CorInfoFlag.CORINFO_FLG_CUSTOMLAYOUT for this type and so JIT was
generating code that copied just the int element.

This change fixes it. Runtime uses similar check.

4 years agoJIT: refine handle blocking logic (#1788)
Andy Ayers [Thu, 16 Jan 2020 07:45:17 +0000 (23:45 -0800)]
JIT: refine handle blocking logic (#1788)

Assertion prop uses `O2K_CONST_INT` for handles, even on 64 bit targets. Make
suitable adjustments to the handle propagation blocking logic.

Problem was introduced in #1593 and exposed by #1309.

Fixes #1777

4 years agoFix Linux tests mainv1, mainv2 (#1790)
Bruce Forstall [Thu, 16 Jan 2020 07:31:48 +0000 (23:31 -0800)]
Fix Linux tests mainv1, mainv2 (#1790)

Don't use CR in Unix bash scripts.

This appears to be fallout from #583, which added a
second variable that then created a need to add newlines.

4 years agoDelete duplicated R2R version definition and sync to reality (#1764)
Michal Strehovský [Thu, 16 Jan 2020 04:46:26 +0000 (05:46 +0100)]
Delete duplicated R2R version definition and sync to reality (#1764)

We're not generating R2R version 3.0: we started generating 4.1 when nop padding/jump stamps were removed. (Seems like R2R 4.0 was actually skipped entirely but we ended up with the 4.0 version in one of the copies of the struct because only major version was bumped for jump stamps; minor was untouched - minor went up with cuckoo metadata before that and that didn't involve crossgen2 at that point)

Didn't dig into history to find out why it's duplicated in the first place, but it doesn't look like a good place to be in.

4 years agoChange all ActiveIssues to use Uris instead of numbers (#1768)
Stephen Toub [Thu, 16 Jan 2020 04:21:36 +0000 (23:21 -0500)]
Change all ActiveIssues to use Uris instead of numbers (#1768)

4 years agoUpdate repo link to dotnet/runtime (#1781)
Rich Lander [Thu, 16 Jan 2020 02:16:56 +0000 (18:16 -0800)]
Update repo link to dotnet/runtime (#1781)

4 years agoFix impSIMDMinMax (#1774)
Carol Eidt [Thu, 16 Jan 2020 01:30:43 +0000 (17:30 -0800)]
Fix impSIMDMinMax (#1774)

When taking the no-AVX, no-SSE42 path, ensure that it calls `lvaSetStruct` before `gtNewLclvNode`.

Fix #1667

4 years agoUse a single pipeline with runtime conditioned jobs in PRs (#1473)
Santiago Fernandez Madero [Thu, 16 Jan 2020 01:12:37 +0000 (17:12 -0800)]
Use a single pipeline with runtime conditioned jobs in PRs (#1473)

* Use a single pipeline with runtime conditioned jobs in PRs

* PR Feedback

* Disable long running tests checked runtime

4 years agoDelete checked-in Unicode data files in favor of runtime-assets package (#1743)
Levi Broderick [Thu, 16 Jan 2020 00:43:56 +0000 (16:43 -0800)]
Delete checked-in Unicode data files in favor of runtime-assets package (#1743)

IDNA files (in System.Globalization.Extensions.Tests) not yet deleted; will tackle this later

4 years agoFix Issue 1104 (#1734)
Brian Sullivan [Thu, 16 Jan 2020 00:16:25 +0000 (16:16 -0800)]
Fix Issue 1104 (#1734)

* Fix the incorrect change where 'alreadyPresent' was incorrectly initialized.
The PR that introduced this issue: https://github.com/dotnet/coreclr/pull/23109

* Add test case

4 years agoUpdate ReportGenerator to 4.4.2 (#1778)
Viktor Hofer [Wed, 15 Jan 2020 22:58:18 +0000 (23:58 +0100)]
Update ReportGenerator to 4.4.2 (#1778)

4 years agoJitstress fixes for tailcall tests (#1771)
Andy Ayers [Wed, 15 Jan 2020 21:06:59 +0000 (13:06 -0800)]
Jitstress fixes for tailcall tests (#1771)

Make STRESS_GENERIC_VARN more compatible with methods that make explicit tail
calls. Don't add gc checks for explicit tail calls, and remove the code in
morph that blocks tail calls if gc checks are active.

Update the tailcall test to to disable STRESS_UNSAFE_BUFFER_CHECKS. This can
be reverted when #341 is merged.

Fixes #1752.

4 years agoUpdate dotnet-tools.json (#1773)
Marco Rossignoli [Wed, 15 Jan 2020 20:45:48 +0000 (21:45 +0100)]
Update dotnet-tools.json (#1773)

4 years ago[master] Update dependencies from 4 repositories (#1758)
dotnet-maestro[bot] [Wed, 15 Jan 2020 19:26:36 +0000 (20:26 +0100)]
[master] Update dependencies from 4 repositories (#1758)

* Update dependencies from https://github.com/dotnet/arcade build 20200113.2

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20063.2
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20063.2
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20063.2
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20063.2
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.20063.2
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20063.2
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20063.2
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20063.2
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20063.2
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20063.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20063.2
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20063.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20063.2
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20063.2

* Update dependencies from https://github.com/mono/linker build 20200112.1

- ILLink.Tasks - 0.1.6-prerelease.20062.1

* Update dependencies from https://github.com/microsoft/vstest build 20200113-03

- Microsoft.NET.Test.Sdk - 16.5.0-preview-20200113-03

* Update dependencies from https://github.com/dotnet/runtime-assets build 20191210.1

- System.Windows.Extensions.TestData - 5.0.0-beta.19610.1
- System.Security.Cryptography.X509Certificates.TestData - 5.0.0-beta.19610.1
- System.Net.TestData - 5.0.0-beta.19610.1
- System.IO.Packaging.TestData - 5.0.0-beta.19610.1
- System.IO.Compression.TestData - 5.0.0-beta.19610.1
- System.Drawing.Common.TestData - 5.0.0-beta.19610.1
- System.ComponentModel.TypeConverter.TestData - 5.0.0-beta.19610.1

* Revert "Update dependencies from https://github.com/mono/linker build 20200112.1"

This reverts commit 0855288b45de9c39aacc55864fa42a32a4d80052.

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
4 years agoFix build on Linux
vitek-karas [Wed, 15 Jan 2020 19:22:22 +0000 (11:22 -0800)]
Fix build on Linux

4 years agoJIT: handle some side effects in box pattern match (#1741)
Andy Ayers [Wed, 15 Jan 2020 18:35:42 +0000 (10:35 -0800)]
JIT: handle some side effects in box pattern match (#1741)

Handle simple side effects in the `box; br` pattern based optimization.

Fixes #1713.

4 years ago[arm] account for signed bit when calculating offset to PLT entry (mono/mono#18454)
Bernhard Urban-Forster [Wed, 15 Jan 2020 17:35:53 +0000 (18:35 +0100)]
[arm] account for signed bit when calculating offset to PLT entry (mono/mono#18454)

[arm] account for signed bit when calculating offset to PLT entry

See `bl` documentation (make sure you look at the thumb2 one):
<img width="1003" alt="Screenshot 2020-01-14 at 22 43 33" src="https://user-images.githubusercontent.com/75403/72385601-2bb53b00-3720-11ea-9858-d73bc2d02a7e.png">

Fixes https://github.com/mono/mono/issues/18247

Commit migrated from https://github.com/mono/mono/commit/bdde94b8e2e08761d0f562dcbcc5c4c7fb497ab3

4 years agoCse tuning (#1463)
Brian Sullivan [Wed, 15 Jan 2020 16:38:01 +0000 (08:38 -0800)]
Cse tuning (#1463)

* cse-tuning branch

1. Changed csdLiveAcrossCall to a bool (zero-diff)

* 2.  Added the remaining zero-diff changes from my old coreclr branch (zero-diff)

* 3. Incoming stack arguments don't use any local stack frame slots

x64  5 improvements 0 regressions,  Total PerfScore diff: -10.72
x86 16 improvements 5 regressions,  Total PerfScore diff: -72.95

* 4.  Locals with no references aren't enregistered  (zero-diffs)

* 5. Fix handling of long integer types, they only use one register not two.

    x64 250 improvements 51 regressions,  Total PerfScore diff:   -459.09
  arm64 162 improvements 16 regressions,  Total PerfScore diff:  -1712.52

* 6. Adjust computation of moderateRefCnt and aggressiveRefCnt values

     x64 280 improvements 81 regressions,  Total PerfScore diff:   -274.78
   arm64 264 improvements 61 regressions,  Total PerfScore diff:   -911.00
     x86  87 improvements 42 regressions,  Total PerfScore diff:   -123.46
   arm32 195 improvements 81 regressions,  Total PerfScore diff:   -239.10

* 7.  slotCount refactor (zero-diffs)

* 8.  Enable the use of the live across call information

      x64 125 improvements 136 regressions, Total PerfScore diff:   +427.43
    arm64  83 improvements 153 regressions, Total PerfScore diff:   +260.68
      x86 218 improvements 193 regressions, Total PerfScore diff:   +199.81
    arm32 145 improvements 181 regressions, Total PerfScore diff: -33283.10

arm32 method with improvement:
    -33864.40 (-2.87% of base) : System.Private.CoreLib.dasm - TypeBuilder:CreateTypeNoLock():TypeInfo:this (2 methods)

* 9.  Adjust the cse_use_costs for the LiveAcrossCall case

      x64  61 improvements  61 regressions, Total PerfScore diff:   -189.03
    arm64  90 improvements  49 regressions, Total PerfScore diff:   -463.42
      x86  88 improvements  80 regressions, Total PerfScore diff:   -238.61
    arm32 101 improvements  63 regressions, Total PerfScore diff:   -259.50

* 10.  If this CSE is live across a call then we may need to spill an additional caller save register

          x64  73 improvements  45 regressions, Total PerfScore diff:   -279.88
        arm64  45 improvements  76 regressions, Total PerfScore diff:    -90.94
          x86  13 improvements  14 regressions, Total PerfScore diff:    -21.55
        arm32  45 improvements  33 regressions, Total PerfScore diff:    -78.60

* 11.  (x64 only)  floating point loads/stores encode larger, so adjust the cse def/use cost for SMALL_CODE

   No diffs in System.Private.Corelib

* 12. Remove extra cse de/use costs for methods that have a largeFrame or a hugeFrame

       x64 199 improvements  50 regressions, Total PerfScore diff:   -2061.36
     arm64  11 improvements   3 regressions, Total PerfScore diff:     -46.84
       x86 136 improvements  80 regressions, Total PerfScore diff:   -1795.00
     arm32  50 improvements  35 regressions, Total PerfScore diff:    -132.30

* clang-format

* Code review feedback

Removed increment of enregCount on _TARGET_X86_ when we have compLongUsed:
    Framework diffs
    Total PerfScoreUnits of diff: -654.75 (-0.00% of base)  diff is an improvement.
    79 total methods with Perf Score differences (55 improved, 24 regressed), 146432 unchanged.

Fixed setting of largeFrame/hugeFrame for ARM64
    Zero framework diffs.

:

* run jit-format

* correct some wording in comments

* reword a comment

4 years agoAdd link to shared portion of CoreLib to .gitignore (#1607)
Michal Strehovský [Wed, 15 Jan 2020 15:49:42 +0000 (16:49 +0100)]
Add link to shared portion of CoreLib to .gitignore (#1607)

In the coreclr repo, one could simply findstr in the System.Private.CoreLib directory to find stuff.

Since in the runtime repo the shared portion of the CoreLib moved to src/libraries/, but private portion lives in src/coreclr, the files are split. We can work around it locally by making a symbolic link.

That way runtime devs that just grep/findstr stuff don't have to suffer entering the src/libraries directory where tab completion doesn't work because there's 180 directories prefixed by `System.`.

4 years agoFix PEReader creation and caching (#1742)
Fadi Hanna [Wed, 15 Jan 2020 15:37:01 +0000 (10:37 -0500)]
Fix PEReader creation and caching (#1742)

Can't use a fixed stack-based pointer to initialize something on the heap and expect it to continue working :)

4 years agoFix description of -skipnuget in src/coreclr/build.sh (#534)
Andrey Akinshin [Wed, 15 Jan 2020 15:28:05 +0000 (18:28 +0300)]
Fix description of -skipnuget in src/coreclr/build.sh (#534)

4 years agoRevert Async changes to SNIPacket to fix deadlock issues (#778)
Cheena Malhotra [Wed, 15 Jan 2020 14:21:00 +0000 (06:21 -0800)]
Revert Async changes to SNIPacket to fix deadlock issues (#778)

4 years agohostfxr_get_native_search_directories must fail when given command line for a CLI...
Vitek Karas [Thu, 19 Dec 2019 14:42:15 +0000 (06:42 -0800)]
hostfxr_get_native_search_directories must fail when given command line for a CLI command

There's no check that when running with a "command" like hostfxr_get_native_search_directories that the code will not try to locate SDK and run CLI commands.
If it happens not only it does wrong things, but the return values are bogus (it doesn't fill the output buffer).

This change adds the necessary check to avoid this completely. It also makes sure that the output buffer size is always correctly set, even on errors.

Moved all the tests for hostfxr_get_native_search_directories to use nativehost and add a test to cover this case.

4 years agoRemove two always false properties in UriSyntax (#696)
Marek Safar [Wed, 15 Jan 2020 13:15:34 +0000 (14:15 +0100)]
Remove two always false properties in UriSyntax (#696)

4 years agopal_random: Open /dev/urandom with O_CLOEXEC (#1249)
Leandro A. F. Pereira [Wed, 15 Jan 2020 12:12:19 +0000 (04:12 -0800)]
pal_random: Open /dev/urandom with O_CLOEXEC (#1249)

The third argument to open(2) is ignored by the system call unless
O_CREAT is passed in the second argument.  O_CLOEXEC should be OR-ed
with the second argument.

4 years ago[loader] ReflectionOnlyLoad(byte[]) should not apply binding redirects (mono/mono...
Aleksey Kliger (λgeek) [Wed, 15 Jan 2020 09:47:27 +0000 (04:47 -0500)]
[loader] ReflectionOnlyLoad(byte[]) should not apply binding redirects (mono/mono#18457)

* [loader] ReflectionOnlyLoad(byte[]) should not apply binding redirects

Match .NET Framework behavior.

Addresses https://github.com/mono/mono/issues/18388

* [tests] ReflectionOnlyLoad(byte[]) should not apply binding redirects

Regression test for https://github.com/mono/mono/issues/18388

Commit migrated from https://github.com/mono/mono/commit/e7e81a47c93f8a2e1128a4d0fd515fa235dbcf19

4 years agoMark some Nullable<T> members as readonly (#1727)
Lucas Trzesniewski [Wed, 15 Jan 2020 04:56:56 +0000 (05:56 +0100)]
Mark some Nullable<T> members as readonly (#1727)

Value, HasValue, GetValueOrDefault

4 years agoDisable TestOnExecuteCustomCommand (#1745)
Jared Parsons [Wed, 15 Jan 2020 03:26:21 +0000 (22:26 -0500)]
Disable TestOnExecuteCustomCommand (#1745)

This is failing on the libraries outerloop builds.

Tracked by #1724

4 years agoAdd minimum length optimization to regex (#1624)
Stephen Toub [Wed, 15 Jan 2020 03:25:28 +0000 (22:25 -0500)]
Add minimum length optimization to regex (#1624)

We now do a cursory examination of the RegexNode tree in order to determine the smallest length string that could possibly match.  For example, the regex "(?:123|4567)8" has a minimum length of 4 (if the input were "1238"), and the regex "\d{1-2}-\d{1-2}-\d{2-4}" has a minimum length of 6 (e.g. "1-10-20"). If the input string is shorter than that minimum length, FindFirstChar will now immediately return false, as it can't possibly match, avoiding spending time evaluating a pattern that couldn't possibly match.

4 years agoNullable annotate System.Linq.Queryable (#979)
Eirik Tsarpalis [Wed, 15 Jan 2020 01:56:53 +0000 (03:56 +0200)]
Nullable annotate System.Linq.Queryable (#979)

* Nullable annotate System.Linq.Queryable

* update annotations based on System.Linq.Expressions annotation

* address feedback

* revert System.Linq.Expressions reference source

* make IQueryable LINQ methods compatible with annotated IEnumerable signatures

* remove unnecessary nullable annotation

* address feedback

4 years agoFix token encoding crash when compiling without version bubble (#816)
Fadi Hanna [Wed, 15 Jan 2020 01:05:16 +0000 (20:05 -0500)]
Fix token encoding crash when compiling without version bubble (#816)

* Fix token encoding crash when compiling without version bubble

Implement the ability to get token values for typeRefs that are not part of the version bubble. This fixes the ability to compile the CoreFX set without the --large-bubble switch

4 years agoUpdate Version.Details.xml with new UnicodeData test asset (#1731)
Levi Broderick [Tue, 14 Jan 2020 23:21:34 +0000 (15:21 -0800)]
Update Version.Details.xml with new UnicodeData test asset (#1731)

4 years agoFix linuxnonjit that got accidentally renamed to linuxonjit (#1694)
Jan Vorlicek [Tue, 14 Jan 2020 23:12:06 +0000 (00:12 +0100)]
Fix linuxnonjit that got accidentally renamed to linuxonjit (#1694)

The PR #1292 has accidentally renamed the linuxnonjit to linuxonjit.
This change fixes it.

4 years agoUpdate System.Drawing.Common index to get latest package for harvesting (#1729)
Santiago Fernandez Madero [Tue, 14 Jan 2020 23:07:38 +0000 (15:07 -0800)]
Update System.Drawing.Common index to get latest package for harvesting (#1729)

4 years agoUpdate CharUnicodeInfo to Unicode 12.1; update StringInfo to UAX29 (#328)
Levi Broderick [Tue, 14 Jan 2020 22:07:53 +0000 (14:07 -0800)]
Update CharUnicodeInfo to Unicode 12.1; update StringInfo to UAX29 (#328)

- Updates CharUnicodeInfo.GetCategory from Unicode 11.0 to Unicode 12.1
- Optimizes some methods in Char and CharUnicodeInfo to have better codegen
- Updates StringInfo to use UAX29 extended grapheme cluster segmentation logic

4 years agoContributing: fixing some typos (mono/mono#18453)
Maher Jendoubi [Tue, 14 Jan 2020 21:30:06 +0000 (22:30 +0100)]
Contributing: fixing some typos (mono/mono#18453)

Commit migrated from https://github.com/mono/mono/commit/f4567e83dde9393fe19d4cb7e315c21899c67a3f

4 years agoReduce some stack use and cleanup. (mono/mono#17809)
Jay Krell [Tue, 14 Jan 2020 21:17:00 +0000 (13:17 -0800)]
Reduce some stack use and cleanup. (mono/mono#17809)

Commit migrated from https://github.com/mono/mono/commit/6eea4a18f0b58e9db0aee09b40f328d1b13ced87

4 years ago[utils] Make sure we include WRAP_ATOMIC_INTRINSIC if needed
Vlad Brezae [Tue, 14 Jan 2020 14:13:27 +0000 (16:13 +0200)]
[utils] Make sure we include WRAP_ATOMIC_INTRINSIC if needed

Currently, this doesn't impact any targets, but do it for consistency.

Fixes https://github.com/mono/mono/issues/10651

Commit migrated from https://github.com/mono/mono/commit/fef06df53729a7e0159660494b0ecc1c5b3fe0c7

4 years ago[utils] Include missing define of MONO_GNUC_VERSION
Vlad Brezae [Tue, 14 Jan 2020 14:09:33 +0000 (16:09 +0200)]
[utils] Include missing define of MONO_GNUC_VERSION

We were adding the WRAP_ATOMIC_INTRINSIC all the time on arm64, due to missing MONO_GNUC_VERSION.

Commit migrated from https://github.com/mono/mono/commit/7fb011aa5a5475b59d3b2f16256fc745ed1bda15

4 years agoFix many printf warnings (mono/mono#16484)
Jay Krell [Tue, 14 Jan 2020 21:03:22 +0000 (13:03 -0800)]
Fix many printf warnings (mono/mono#16484)

* Do not `printf` `long long` or `unsigned long long`.

*Do* printf `gint64` or `guint64`.

Do not printf %ll.
Do not printf %z.

 gint64 ==  int64_t, which could be long, or long long, or maybe other
guint64 == uint64_t, ditto

For printing gint64/guint64, use PRId64, PRIx64, etc.
For printing gsize/gssize, use `G_GSIZE_FORMAT` (seems like excess `G`).

%z definitely would warn for every single use, with Mingw.

And %ll might also, since on 64bit platforms, gint64 tends to be
long, not long long, and would merit %l not %ll.
(No matter that %ll is merited on 32bit, and the behavior
would then be correct on both.).

If there becomes a system w/o PRId64 etc., and it is a 64bit system,
then we could use %l under a portable name.
Or %I64. This appears unlikely (unless reach is extended to older Windows runtime).

Note that PRIxPTR for gsize/intptr_t may be a good idea too.

Commit migrated from https://github.com/mono/mono/commit/07402062541fa9555bef99dbaac84cfb587926cd

4 years ago[netcore] Implement Thread.GetCurrentProcessorId (mono/mono#18450)
Ryan Lucia [Tue, 14 Jan 2020 21:01:13 +0000 (16:01 -0500)]
[netcore] Implement Thread.GetCurrentProcessorId (mono/mono#18450)

CoreCLR has a managed cache surrounding this, but for the moment the naive implementation will suffice. We can later move their managed cache to shared on top of this PR with minimal trouble.

We can't guarantee the id will be [0..CpuCount) for a variety of reasons, and a followup PR to the dotnet docs will clarify this. I've chosen not to intentionally add an offset, but no one should be relying on that behavior, and if someone thinks adding an offset would drive the point home the perf cost is irrelevant.

Commit migrated from https://github.com/mono/mono/commit/3b19228a668644e19944258d14124442cabf3003

4 years ago[interp] initial infrastructure for whitebox testing of optimization passes (mono...
Bernhard Urban-Forster [Tue, 14 Jan 2020 20:59:48 +0000 (21:59 +0100)]
[interp] initial infrastructure for whitebox testing of optimization passes (mono/mono#18268)

Commit migrated from https://github.com/mono/mono/commit/05f2651a12ba5eae1de8b488c4026145622b265a

4 years agoFix comments in zapimage.cpp (#1629)
Anton Lapounov [Tue, 14 Jan 2020 20:56:49 +0000 (12:56 -0800)]
Fix comments in zapimage.cpp (#1629)

I noticed that base addresses in the comments were not correct (constants in the switches.h file had been updated without updating the comments in this file), and while at it, fixed spelling and grammar in other comments.

4 years agoimprove cert validation diagnostic on OSX (#1513)
Tomas Weinfurt [Tue, 14 Jan 2020 20:05:05 +0000 (12:05 -0800)]
improve cert validation diagnostic on  OSX (#1513)

* propagate error if cert validation fails on OSX

* feedback from review

* feedback from review

* update style

* using System.Net

4 years agoCleanup remaining rhel/centos 6 conditions (#1659)
Adeel Mujahid [Tue, 14 Jan 2020 19:46:24 +0000 (21:46 +0200)]
Cleanup remaining rhel/centos 6 conditions (#1659)

* Cleanup remaining rhel/centos 6 conditions
Also fixes some errors reported by shellcheck in `init-distro-rid.sh`.

* Update function comments

4 years ago[sgen] Fixes for max-heap-size option (mono/mono#18446)
Vlad Brezae [Tue, 14 Jan 2020 19:42:14 +0000 (11:42 -0800)]
[sgen] Fixes for max-heap-size option (mono/mono#18446)

* [sgen] Don't subtract twice the nursery size from max_heap_size

We were subtracting the nursery size when initializing max_heap_size as well as adding it to the allocated_heap when allocating the nursery (alloc_nursery).

* [sgen] Trigger collection if failing to allocate los section

If the memory governor says we are exceeding the max_heap_size by allocating a los section (1MB) for a new los object, attempt to clear some space by triggering a major collection, before completely bailing out.

Commit migrated from https://github.com/mono/mono/commit/d9db79b4b281afc5064921ff69a4bbbfb2c5f0e1

4 years agoJIT: build basic block pred lists before morph (#1309)
Andy Ayers [Tue, 14 Jan 2020 19:25:22 +0000 (11:25 -0800)]
JIT: build basic block pred lists before morph (#1309)

Build basic block pred lists before morph, instead of after, and add an early
flow optimization pass. Fix up a few places where ref counts or pred lists
were not properly maintained in morph.

The early flow opt pass enhances the local assertion prop run in morph (by
fusing blocks), allows the jit to avoid morphing some unreachable blocks
(thus saving a bit of TP), and lays the groundwork for more aggressive early
branch folding that would be useful (eg dotnet/runtime#27935).

4 years agoFix test property evaluation on netfx vertical (#1715)
Viktor Hofer [Tue, 14 Jan 2020 19:05:57 +0000 (20:05 +0100)]
Fix test property evaluation on netfx vertical (#1715)

When running on netfx vertical there's a chance that the `XunitConsoleNetCore21AppPath` property which is defined in https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.XUnitConsoleRunner/src/build/Microsoft.DotNet.XUnitConsoleRunner.props#L4 isn't available because the packages isn't restored / imported. Guarding against that by checking if the property is set.

4 years agoEnable upgrading loops before alternations to be atomic (#1690)
Stephen Toub [Tue, 14 Jan 2020 18:48:26 +0000 (13:48 -0500)]
Enable upgrading loops before alternations to be atomic (#1690)

Changing loops to be atomic is beneficial because it avoids unnecessary backtracking (and if everything in the expression can be proven to avoid backtracking, we also can generate better code overall).  This change improves upon our detection to now consider the case where the second node is an alternation, e.g. with the expression `\s+(something|anything)`, we can change that to the equivalent of `(?>\s+)(something|anything)` because we can see that for the alternation to succeed, it would never begin with a space, and therefore there's nothing the preceding loop could "give back" that would let the alternation succeed.

4 years ago[cxx] Make the externC of icalls configuration-dependent instead of always. (mono...
Jay Krell [Tue, 14 Jan 2020 18:28:54 +0000 (10:28 -0800)]
[cxx] Make the externC of icalls configuration-dependent instead of always. (mono/mono#17573)

There are pluses and minuses here:

 + Minimize externC.

 + Maximimze typesafe linkage.

 - Minimize configuration-sensitivity.

 - Maximize commonality across all configurations, so that
   success in one configuration maximally but not 100% implies
   success in others (which is why to avoid `#if` in general,
   to contribute toward compilation success).

 + Use higher level macros to explain reason.
   Even if ICALL_EXTERN_C was always externC (presently not),
   using it instead of plain G_EXTERN_C offers a builtin comment.

Commit migrated from https://github.com/mono/mono/commit/5237696f65cda0f079562838990b4effd4d65eee

4 years agoUse platform-matrix for Installer jobs (#1623)
Davis Goodin [Tue, 14 Jan 2020 18:04:27 +0000 (12:04 -0600)]
Use platform-matrix for Installer jobs (#1623)

* Use platform-matrix for Installer jobs

Minimal changes to root pipelines to avoid conflicts

* Fix Linux vs. linux mismatch in musl jobs

4 years agoFix runtest.py test analysis and repro creation (#1702)
Bruce Forstall [Tue, 14 Jan 2020 17:35:43 +0000 (09:35 -0800)]
Fix runtest.py test analysis and repro creation (#1702)

Comment out the code that munges characters in the test output.
This is corrupting the output. Don't delete it until it is
better understood if this is actually needed in some case.

Fixes #1682

Fix arguments to DebugEnv() constructor, which allows repro
scripts to be written for failing tests.

4 years agoRemove unused function in deps parsing (#1683)
Elinor Fung [Tue, 14 Jan 2020 17:21:38 +0000 (09:21 -0800)]
Remove unused function in deps parsing (#1683)

4 years ago[reflection] Add additional TypeInfo.FullName tests (#1613)
Ryan Lucia [Tue, 14 Jan 2020 16:14:17 +0000 (11:14 -0500)]
[reflection] Add additional TypeInfo.FullName tests (#1613)

4 years agoOptimize typeof(T).IsValueType (mono/mono#18307)
Egor Bogatov [Tue, 14 Jan 2020 15:37:16 +0000 (18:37 +0300)]
Optimize typeof(T).IsValueType (mono/mono#18307)

* Optimize Type.IsValueType

* Ignore gsharedvt types

* use mini_is_gsharedvt_variable_klass

* test

* fix build

Commit migrated from https://github.com/mono/mono/commit/08bb5660f6b2cc87ec59fb77c01a1f8cdeda183f

4 years agoMove Assembly.GetEntryAssembly method to shared part (#1670)
Maxim Lipnin [Tue, 14 Jan 2020 15:05:25 +0000 (18:05 +0300)]
Move Assembly.GetEntryAssembly method to shared part (#1670)