platform/upstream/coreclr.git
9 years agoMerge pull request #1285 from benpye/linux-arm-stack-unwinding
Jan Vorlicek [Fri, 31 Jul 2015 19:48:05 +0000 (21:48 +0200)]
Merge pull request #1285 from benpye/linux-arm-stack-unwinding

Add unwinding for the ARM Linux platform

9 years agoModify unwinder to provide RtlVirtualUnwind.
Ben Pye [Tue, 14 Jul 2015 20:52:13 +0000 (21:52 +0100)]
Modify unwinder to provide RtlVirtualUnwind.

Use PAL_VirtualUnwind on Linux ARM

Add assembler annotation for unwinding

9 years agoMerge pull request #1319 from kangaroo/aarch64-hfa-fix
Jan Kotas [Fri, 31 Jul 2015 05:44:18 +0000 (22:44 -0700)]
Merge pull request #1319 from kangaroo/aarch64-hfa-fix

[aarch64] Correct the checking of return class type to check against CORINFO_TYPE_FLOAT

9 years ago[aarch64] Correct the checking of return class type to check against CORINFO_TYPE_FLOAT
Geoff Norton [Fri, 31 Jul 2015 05:13:10 +0000 (05:13 +0000)]
[aarch64] Correct the checking of return class type to check against CORINFO_TYPE_FLOAT

9 years agoMerge pull request #1317 from nguerrera/corefx-native-docs
Nick Guerrera [Thu, 30 Jul 2015 21:50:52 +0000 (14:50 -0700)]
Merge pull request #1317 from nguerrera/corefx-native-docs

Add instructions for building corefx native components

9 years agoAdd instructions for building corefx native components
Nick Guerrera [Thu, 30 Jul 2015 21:11:11 +0000 (14:11 -0700)]
Add instructions for building corefx native components

Fix #1313

9 years agoMerge pull request #1292 from kangaroo/aarch64
Jan Kotas [Thu, 30 Jul 2015 20:16:34 +0000 (13:16 -0700)]
Merge pull request #1292 from kangaroo/aarch64

Initial aarch64/linux support

9 years agoMerge pull request #1314 from dotnet-bot/from-tfs
Jan Kotas [Thu, 30 Jul 2015 20:15:22 +0000 (13:15 -0700)]
Merge pull request #1314 from dotnet-bot/from-tfs

Merge changes from TFS

9 years ago[aarch64] Address code review feedback and disable EmitGetThreadInlined on PAL for now
Geoff Norton [Thu, 30 Jul 2015 17:20:55 +0000 (17:20 +0000)]
[aarch64] Address code review feedback and disable EmitGetThreadInlined on PAL for now

9 years agoMerge pull request #1309 from schellap/copyprop
Matt Mitchell [Thu, 30 Jul 2015 04:44:22 +0000 (21:44 -0700)]
Merge pull request #1309 from schellap/copyprop

Conservatively mark variable as killed if there is an embedded comma …

9 years agoFix prefast warnings in CLR code
Eugene Zemtsov [Wed, 29 Jul 2015 23:38:07 +0000 (16:38 -0700)]
Fix prefast warnings in CLR code

[tfs-changeset: 1507366]

9 years agoConservatively mark variable as killed if there is an embedded comma assignment
schellap [Wed, 29 Jul 2015 20:08:16 +0000 (13:08 -0700)]
Conservatively mark variable as killed if there is an embedded comma assignment

GitHub Issue: Another RyuJIT optimization bug #1299
https://github.com/dotnet/coreclr/issues/1299

The underlying problem is there are two loops:

The first loop does copy prop
The second loop updates the stack of live definitions in the currently
traversed CFG path.

This approach works fine only if assignments are atomic statements, but
when there is an assignment embedded using a comma in a statement:
The first loop does nothing about this and continues to propagate
copies, i.e., without updating the liveness stack. This leads to using a
stale VN for comparison rather than using an updated VN due to this
definition.

Only when the second loop runs, this live definition is added to the
stack.

The right fix is to merge the two loops into a single loop that does
copy prop on the tree and at the same time updates the liveness on the
stack right after the call. But this is causing a lot of ASM diffs which
would affect stability.

I am making a conservative fix of temporarily marking the variables that
have embedded intervening defs as "killed", until the second loop runs
to update liveness.

There are no SuperASM diffs with this change.

9 years agoMerge pull request #1298 from mmitche/tail-call-fix
Matt Mitchell [Wed, 29 Jul 2015 15:10:13 +0000 (08:10 -0700)]
Merge pull request #1298 from mmitche/tail-call-fix

Fix for potential bad tailcall code generation

9 years agoFix for potential bad tailcall code generation
Matt Mitchell [Mon, 27 Jul 2015 19:02:28 +0000 (12:02 -0700)]
Fix for potential bad tailcall code generation

The JIT can potentially pass an incorrect parameter to a callee when optimizing a tail call.  While updating a GT_LCL* node with lcl var num of temp passed to the tail call, we also need to change its opererand to GT_LCL_VAR.

9 years ago[aarch64] lsra wa not properly setting the killMask for initBlk, copyBlk or copyObj
Geoff Norton [Tue, 28 Jul 2015 23:03:51 +0000 (23:03 +0000)]
[aarch64] lsra wa not properly setting the killMask for initBlk, copyBlk or copyObj

9 years ago[pal] PAL_printf_arg_remover was not properly handling formats like %*s
Geoff Norton [Tue, 28 Jul 2015 20:17:52 +0000 (20:17 +0000)]
[pal] PAL_printf_arg_remover was not properly handling formats like %*s

9 years agoMerge pull request #1269 from Sridhar-MS/osx-tickcount
Sridhar Periyasamy [Tue, 28 Jul 2015 16:43:37 +0000 (09:43 -0700)]
Merge pull request #1269 from Sridhar-MS/osx-tickcount

Fix to get the correct value for Environment.TickCount in OSX

9 years ago[aarch64] Enable the interpreter on linux as well
Geoff Norton [Tue, 28 Jul 2015 15:40:23 +0000 (15:40 +0000)]
[aarch64] Enable the interpreter on linux as well

9 years agoMerge pull request #1302 from dotnet-bot/from-tfs
Jan Kotas [Tue, 28 Jul 2015 11:52:29 +0000 (04:52 -0700)]
Merge pull request #1302 from dotnet-bot/from-tfs

Merge changes from TFS

9 years ago[aarch64] Initial aarch64/linux bring up
Geoff Norton [Sat, 25 Jul 2015 05:48:20 +0000 (14:48 +0900)]
[aarch64] Initial aarch64/linux bring up

9 years agoFix to bad codegen issue while tail calling virtual stub dispatched call that require...
Venkata Sivaramakrishna Ramadugu [Tue, 28 Jul 2015 00:09:33 +0000 (17:09 -0700)]
Fix to bad codegen issue while tail calling virtual stub dispatched call that requires runtime lookup.

This is a case of Virtual Stub Dispatch (VSD) call that requires runtime lookup.  For such a call JIT needs to pass the address of the indirection cell in R11 (which is a callee trash register).  For the F# repro, VSD call is marked with ".tail" prefix and a result RyuJIT attempted to dispatch through a tail call helper.  But CLR tail call helper implementation doesn't preserve R11 nor make any such guarantees and a result indirection cell address passed in R11 gets trashed leading to an AV in VM during call dispatch.  In fact all of the calls that have non-standard args passed in callee trash registers cannot be tail called via helper for the same reason.  Note that it is fine to fast tail call though.

     Fix: During call morphing reject tail calls with non-stand args to be dispatched via tail-call helper.

[tfs-changeset: 1506345]

9 years agoMerge pull request #1301 from dotnet-bot/from-tfs
Jan Kotas [Mon, 27 Jul 2015 21:41:44 +0000 (14:41 -0700)]
Merge pull request #1301 from dotnet-bot/from-tfs

Merge changes from TFS

9 years agoAdd new file to the old msbuild makefiles
Jan Kotas [Mon, 27 Jul 2015 20:44:33 +0000 (13:44 -0700)]
Add new file to the old msbuild makefiles

[tfs-changeset: 1506251]

9 years agoFix to return the right frequency (in ticks per second) and counter (in terms of...
Sridhar Periyasamy [Mon, 27 Jul 2015 20:01:56 +0000 (13:01 -0700)]
Fix to return the right frequency (in ticks per second) and counter (in terms of ticks) in OSX.

Reference: https://developer.apple.com/library/ios/qa/qa1643/_index.html

9 years agoMerge pull request #1295 from benpye/windows-unix-hosting-api
Jan Kotas [Mon, 27 Jul 2015 16:23:28 +0000 (09:23 -0700)]
Merge pull request #1295 from benpye/windows-unix-hosting-api

Expose Unix hosting API on Windows

9 years agoExpose Unix hosting API on Windows
Ben Pye [Mon, 27 Jul 2015 12:48:31 +0000 (13:48 +0100)]
Expose Unix hosting API on Windows

9 years agoMerge pull request #1293 from dotnet-bot/from-tfs
Jan Kotas [Mon, 27 Jul 2015 05:31:44 +0000 (22:31 -0700)]
Merge pull request #1293 from dotnet-bot/from-tfs

Merge changes from TFS

9 years agoFix 1203471: Incorrect rationalization of unused SIMD localVar
Carol Eidt [Mon, 27 Jul 2015 03:14:03 +0000 (20:14 -0700)]
Fix 1203471: Incorrect rationalization of unused SIMD localVar

The Rationalizer was not correctly handling a case of an unused SIMD expression involving a localVar or temporary value, where the SIMD expression is returning a non-SIMD value, and the expression is sufficiently complex (e.g. a call to vector * scalar which is inlined but not an intrinsic).
The ldobj of the localVar is not eliminated, because it involves an indirection, and therefore appears potentially unsafe to eliminate. However, when we transform the ldobj into a plain localVar during the Rationalizer, we need to correctly handle the case where it has no parent.

[tfs-changeset: 1505976]

9 years agoMerge pull request #1239 from sergey-raevskiy/proftoeeinterfaceimpl-doc-update
Jan Kotas [Mon, 27 Jul 2015 03:49:21 +0000 (20:49 -0700)]
Merge pull request #1239 from sergey-raevskiy/proftoeeinterfaceimpl-doc-update

Update link to documentation

9 years agoMerge pull request #1262 from apanda/master
Jan Kotas [Sat, 25 Jul 2015 04:24:46 +0000 (21:24 -0700)]
Merge pull request #1262 from apanda/master

Fix build to work with binutils v2.25.0 on Linux

9 years agoBuild fails when using binutils version 2.25.0
Aurojit Panda [Sun, 19 Jul 2015 07:27:23 +0000 (00:27 -0700)]
Build fails when using binutils version 2.25.0

On Linux, when using binutils version 2.25.0, XMM instructions (e.g., movdqa) requires specifying the size of the
operand (e.g., specifying xmmword ptr). With the current code it gives an error: invalid operand for instruction.

This commit changes movdqa occurances to fix the problem.

9 years agoMove 's_TimebaseInfo' intialization to PAL intialization and nanosecond resolution...
Sridhar Periyasamy [Sat, 25 Jul 2015 01:04:24 +0000 (18:04 -0700)]
Move 's_TimebaseInfo' intialization to PAL intialization and nanosecond resolution support for StopWatch in OSX.

OSX provides nanosecond timer capabilities. But the PAL was not using it and falling back to microsecond-level resolution.

9 years agoMerge pull request #1278 from eerhardt/master
Eric Erhardt [Fri, 24 Jul 2015 22:52:25 +0000 (17:52 -0500)]
Merge pull request #1278 from eerhardt/master

Adding TimeZoneInfo.Local and FindSystemTimeZoneById support on Linux.

9 years agoAdding TimeZoneInfo.Local and FindSystemTimeZoneById support on Linux.
Eric Erhardt [Thu, 23 Jul 2015 03:43:29 +0000 (22:43 -0500)]
Adding TimeZoneInfo.Local and FindSystemTimeZoneById support on Linux.

The local time zone is found by using the TZ environment variable or the "localtime" files on the system.  I needed to add some code that searched through the zoneinfo directory to get the correct Id of the local time zone, since this information is only stored in the file name, and not in the file itself.

FindSystemTimeZoneById uses the id as a file path to find the correct tzfile on the system.

Also added a few #ifs of dead code on Linux.

9 years agoReplace the usage of MACH monotonic function 'clock_get_time' with 'mach_absolute_tim...
Sridhar Periyasamy [Fri, 24 Jul 2015 21:20:46 +0000 (14:20 -0700)]
Replace the usage of MACH monotonic function 'clock_get_time' with 'mach_absolute_time' in GetTickCount64.

Monotonic clock function 'clock_get_time' was causing perf regression in 'Environment.TickCount'. So replacing it with 'mach_absolute_time' which gives considerable performance gains. Here are the perf numbers
Using 'clock_get_time' (without caching host ports) - Average time 2.86 microseconds.
Using 'clock_get_time' (with caching host ports) - Average time 0.82 microseconds.
Using 'gettimeofday' (original implementation) - Average time 0.05 microseconds.
Using 'mach_absolute_time' - Average time 0.04 microseconds.

9 years agoMerge pull request #1277 from erozenfeld/RODataAlignment
Jan Kotas [Fri, 24 Jul 2015 20:59:04 +0000 (13:59 -0700)]
Merge pull request #1277 from erozenfeld/RODataAlignment

Add an option to request 16 bytes alignment for read-only data.

9 years agoMerge pull request #1283 from dotnet-bot/from-tfs
Jan Kotas [Fri, 24 Jul 2015 20:58:53 +0000 (13:58 -0700)]
Merge pull request #1283 from dotnet-bot/from-tfs

Merge changes from TFS

9 years agoAdd an option to request 16 bytes alignment for read-only data.
Eugene Rozenfeld [Thu, 23 Jul 2015 00:14:42 +0000 (17:14 -0700)]
Add an option to request 16 bytes alignment for read-only data.

llilc jit needs this to support LLVM floating-point constant pools.

9 years agoMerge pull request #1210 from benpye/linux-arm
Jan Kotas [Fri, 24 Jul 2015 17:02:44 +0000 (10:02 -0700)]
Merge pull request #1210 from benpye/linux-arm

CoreCLR building on ARM

9 years agoFix FILECanonicalizePath test.
Ben Pye [Sat, 11 Jul 2015 22:09:40 +0000 (23:09 +0100)]
Fix FILECanonicalizePath test.

The string buffer in the test did not allow for the null terminating
byte.

9 years agoAfter calls to vprintf (and similar) call va_end
Ben Pye [Wed, 22 Jul 2015 21:15:07 +0000 (22:15 +0100)]
After calls to vprintf (and similar) call va_end

Add the arg remover so that the arguments handled by the native vprintf
functions are removed from the arg list.

9 years agoAdd ARM target for CoreCLR on Linux.
Ben Pye [Wed, 1 Jul 2015 14:10:09 +0000 (15:10 +0100)]
Add ARM target for CoreCLR on Linux.

c_runtime/vprintf/test1 is disabled as casting NULL to va_list is
against the C specification.

Fix SetFilePointer tests on 32 bit platforms.

Define _FILE_OFFSET_BITS=64 so that we have long file support on 32 bit
platforms.

Implement context capture/restore for ARM.

Link libgcc_s before libunwind on ARM so C++ exceptions work.

Translate armasm to gas syntax.

Specify Thumb, VFPv3, ARMv7 for the ARM target.

Add ARM configuration to mscorlib build

Implement GetLogicalProcessorCacheSizeFromOS in PAL.

Set UNWIND_CONTEXT_IS_UCONTEXT_T from configure check.

9 years agoMerge pull request #1280 from nguerrera/remove-corefx-crypto
Nick Guerrera [Thu, 23 Jul 2015 23:07:53 +0000 (16:07 -0700)]
Merge pull request #1280 from nguerrera/remove-corefx-crypto

Remove System.Security.Cryptography.Native from coreclr build

9 years agoUpdate ETW allocation sampling shutdown method contract.
Brian Robbins [Wed, 22 Jul 2015 22:55:10 +0000 (15:55 -0700)]
Update ETW allocation sampling shutdown method contract.

[tfs-changeset: 1504772]

9 years agoMerge pull request #1274 from dotnet-bot/from-tfs
Jan Kotas [Wed, 22 Jul 2015 21:08:47 +0000 (14:08 -0700)]
Merge pull request #1274 from dotnet-bot/from-tfs

Merge changes from TFS

9 years agoFix recursive assert in utilcode/debug.cpp when VM code, etc. hits an assert.
Mike McLaughlin [Wed, 22 Jul 2015 21:01:57 +0000 (14:01 -0700)]
Fix recursive assert in utilcode/debug.cpp when VM code, etc. hits an assert.

The fix was to rearrange the code so the assert isn't necessary and removed it. Fixes TFS bug 1199569.

[tfs-changeset: 1504713]

9 years agoMerge pull request #1242 from david-mitchell/update-osx-instructions
Aditya Mandaleeka [Wed, 22 Jul 2015 20:37:50 +0000 (13:37 -0700)]
Merge pull request #1242 from david-mitchell/update-osx-instructions

Update OS X build instructions.

9 years agoFix Mach host port leaks in OSX
Sridhar Periyasamy [Wed, 22 Jul 2015 19:49:25 +0000 (12:49 -0700)]
Fix Mach host port leaks in OSX

- Add return value check for "host_get_clock_service".
- Fix host port leaks in GetTickCount64 and GlobalMemoryStatusEx.

9 years agoRemove System.Security.Cryptography.Native from coreclr build
Nick Guerrera [Wed, 22 Jul 2015 19:20:54 +0000 (12:20 -0700)]
Remove System.Security.Cryptography.Native from coreclr build

This library now builds in corefx. The coreclr/src/corefx folder
is left behind with an empty project list to leave room for
Sytem.Globalization.Native which will need to stay in coreclr
due to being depended upon by mscorlib.

9 years agoRemove the SecuritySafeCritical from the ParseTargetFrameworkName.
Alex Ghiondea [Wed, 22 Jul 2015 17:19:57 +0000 (10:19 -0700)]
Remove the SecuritySafeCritical from the ParseTargetFrameworkName.

This attribute was added as part of the initial implementation and is no longer needed in the current version. What this attribute does it allows us to call SecurityCritical methods from our code. However, we no longer have the need to do that. Additionally, having this attribute prevents libraries that are explicity SecurityTransparent from compiling this code in their assembly (SecAnnotate would complain).

[tfs-changeset: 1504639]

9 years agoFix to get the correct value for Environment.TickCount in OSX
Sridhar Periyasamy [Wed, 22 Jul 2015 01:48:36 +0000 (18:48 -0700)]
Fix to get the correct value for Environment.TickCount in OSX

On linux monotonic clock API clock_gettime is available. But on OSX the PAL implementation falls back to gettimeofday. This always retured the time elapsed since Unix Epoch (1970/01/01). I fixed it by using the mach API clock_get_time on OSX to get the time elapsed since system start.

Fixes #2441
https://github.com/dotnet/corefx/issues/2441

9 years agoMerge pull request #1263 from adityamandaleeka/contextAlignment
Aditya Mandaleeka [Tue, 21 Jul 2015 17:59:08 +0000 (10:59 -0700)]
Merge pull request #1263 from adityamandaleeka/contextAlignment

Fix alignment issue when converting to/from native context.

9 years agoMerge pull request #1266 from mikem8361/debugdoc
Mike McLaughlin [Tue, 21 Jul 2015 07:24:57 +0000 (00:24 -0700)]
Merge pull request #1266 from mikem8361/debugdoc

Add directions for debugging CoreClr on Linux

9 years agoAdd directions for debugging CoreClr on Linux.
Mike McLaughlin [Mon, 20 Jul 2015 22:57:23 +0000 (15:57 -0700)]
Add directions for debugging CoreClr on Linux.

9 years agoFix alignment issue when converting to/from native context.
Aditya Mandaleeka [Mon, 20 Jul 2015 00:24:17 +0000 (17:24 -0700)]
Fix alignment issue when converting to/from native context.

When building in release mode, the code in CONTEXTFromNativeContext and
CONTEXTToNativeContext was using the movaps instruction to move the float
and XMM register values to/from the native context. This is because the
macros FPREG_St and FPREG_Xmm were casting unaligned pointers to an
aligned struct type (M128A). This change adds a type M128U which is the
same as M128A but without the alignment guarantee. Using this type in
those macros prevents the compiler from trying to use movaps on
potentially unaligned memory. This bug manifested when trying to call
these functions with native contexts that were passed into a real-time
signal handler.

9 years agoMerge pull request #1247 from mmitche/skip-tests-option
Matt Mitchell [Mon, 20 Jul 2015 16:21:58 +0000 (09:21 -0700)]
Merge pull request #1247 from mmitche/skip-tests-option

Add option to skip test build in build.cmd

9 years agoAdd option to skip test build in build.cmd
Matt Mitchell [Thu, 16 Jul 2015 14:59:05 +0000 (07:59 -0700)]
Add option to skip test build in build.cmd

Add help information regarding skiptestbuild option

9 years agoMerge pull request #1255 from benpye/coreconsole-crash-fix
Jan Kotas [Mon, 20 Jul 2015 13:54:29 +0000 (06:54 -0700)]
Merge pull request #1255 from benpye/coreconsole-crash-fix

Allow coreconsole to be called without extension

9 years agoAllow coreconsole to be called without extension.
Ben Pye [Fri, 17 Jul 2015 07:48:14 +0000 (08:48 +0100)]
Allow coreconsole to be called without extension.

9 years agoMerge pull request #1199 from judemelancon/patch-1
Jan Kotas [Sun, 19 Jul 2015 14:46:25 +0000 (07:46 -0700)]
Merge pull request #1199 from judemelancon/patch-1

Remove incorrectly duplicated comment

9 years agoMerge pull request #1227 from mikedn/shrdis
Jan Kotas [Sun, 19 Jul 2015 14:30:49 +0000 (07:30 -0700)]
Merge pull request #1227 from mikedn/shrdis

Fix SHR operand diassembly in RyuJIT

9 years agoMerge pull request #1250 from david-mitchell/fix-locals
Sergiy Kuryata [Sun, 19 Jul 2015 06:26:16 +0000 (23:26 -0700)]
Merge pull request #1250 from david-mitchell/fix-locals

Declare locals in correct order.

9 years agoMerge pull request #1245 from janvorli/hosting-api-extension
Jan Vorlicek [Fri, 17 Jul 2015 10:07:58 +0000 (12:07 +0200)]
Merge pull request #1245 from janvorli/hosting-api-extension

Extend the Unix hosting API

9 years agoMerge pull request #1251 from dotnet-bot/from-tfs
Jan Kotas [Fri, 17 Jul 2015 06:11:30 +0000 (23:11 -0700)]
Merge pull request #1251 from dotnet-bot/from-tfs

Merge changes from TFS

9 years agoMerge pull request #1252 from ViIvanov/fix/assert-in-lazy-value/issue-1186
Jan Kotas [Fri, 17 Jul 2015 06:10:57 +0000 (23:10 -0700)]
Merge pull request #1252 from ViIvanov/fix/assert-in-lazy-value/issue-1186

Fix #1186: wrong Contract.Assert in Lazy<>::Value getter.

9 years agoMerge pull request #1248 from stephentoub/dllimport_prefix_suffix
Stephen Toub [Fri, 17 Jul 2015 01:26:01 +0000 (21:26 -0400)]
Merge pull request #1248 from stephentoub/dllimport_prefix_suffix

Update DllImport name logic to support lack of "lib" prefix

9 years agoUpdate DllImport logic to support lack of "lib" prefix
stephentoub [Thu, 16 Jul 2015 13:10:56 +0000 (09:10 -0400)]
Update DllImport logic to support lack of "lib" prefix

Today the runtime supports automatically appending an appropriate
suffix (e.g. ".so", ".dylib", etc.) for the library name provided
to DllImport.  This commit adds support for also prepending the
standard library prefix "lib".

9 years agoFix #1186: incorrect Contract.Assert in Lazy<>::Value getter.
Viacheslav Ivanov [Thu, 16 Jul 2015 22:18:02 +0000 (01:18 +0300)]
Fix #1186: incorrect Contract.Assert in Lazy<>::Value getter.

9 years agoExtend the Unix hosting API
Jan Vorlicek [Wed, 15 Jul 2015 21:08:09 +0000 (23:08 +0200)]
Extend the Unix hosting API

This change modifies the Unix hosting API so that the hosting app can create
as many managed delegates as it needs and execute them as many times it wants.
The new API contains separate functions to initialize and shutdown CoreCLR
and a function to create a delegate.
The current ExecuteAssembly function behavior stays unmodified for now to
ensure that dnx that uses that API and that pulls the binary libcoreclr
is not broken.
After the dnx is updated to use the new coreclr_create_delegate API, I'll remove
the ExecuteAssembly.

Also done:
1) Added support for comments and skipping empty lines in the mscorwks_unixexports.src.
2) Restructured the mscorwks_unixexports.src
3) Added coreclr_execute_assembly to the unixinterface.cpp / exports
4) Modified coreruncommon.cpp to use the new hosting API

9 years agoPort CS#1495515 to ProjectK branch: Add a JIT-EE interface method for use by the...
Bruce Forstall [Thu, 16 Jul 2015 16:36:40 +0000 (09:36 -0700)]
Port CS#1495515 to ProjectK branch: Add a JIT-EE interface method for use by the System V struct passing ABI change

NOTE: This is a breaking JIT-EE interface change, and requires a matching rebuild of JIT and VM.

[tfs-changeset: 1502218]

9 years agoDeclare locals in correct order.
David Mitchell [Thu, 16 Jul 2015 15:46:48 +0000 (08:46 -0700)]
Declare locals in correct order.

The order of declaration doesn't matter when the call to CreateInstance
succeeds because the call to unload the DLL is suppressed. However, if
CreateInstance fails, we do unload the DLL, and this needs to happen after the
call to Release on the class factory.

9 years agoMerge pull request #1246 from stephentoub/fix_unix_etw
Stephen Toub [Thu, 16 Jul 2015 02:50:22 +0000 (22:50 -0400)]
Merge pull request #1246 from stephentoub/fix_unix_etw

Ensure FEATURE_MANAGED_ETW isn't set for TargetsUnix

9 years agoEnsure FEATURE_MANAGED_ETW isn't set for TargetsUnix
stephentoub [Thu, 16 Jul 2015 02:14:57 +0000 (22:14 -0400)]
Ensure FEATURE_MANAGED_ETW isn't set for TargetsUnix

Updated buildtools were brought in to coreclr, and the props file was
still using the $(OS) variable to control whether FEATURE_MANAGED_ETW was
set, but whereas that used to be used to mean what platform we were
targeting, updated buildtools use it to mean what platform we're building
on, with $(OSGroup) meaning what is the target platform.

9 years agoMerge pull request #1243 from dotnet-bot/from-tfs
Matt Ellis [Wed, 15 Jul 2015 23:27:53 +0000 (16:27 -0700)]
Merge pull request #1243 from dotnet-bot/from-tfs

Merge changes from TFS

9 years agoFix cross platform build break
Matt Ellis [Wed, 15 Jul 2015 22:56:36 +0000 (15:56 -0700)]
Fix cross platform build break

impAssignTempGen is used outside the translation unit and should not
be marked as inline.  Doing so causes link errors in release cross
platform builds.

9 years agoMerge pull request #1238 from dotnet-bot/from-tfs
Matt Ellis [Wed, 15 Jul 2015 18:37:38 +0000 (11:37 -0700)]
Merge pull request #1238 from dotnet-bot/from-tfs

Merge changes from TFS

9 years agoUpdate OS X build instructions.
David Mitchell [Wed, 15 Jul 2015 17:16:59 +0000 (10:16 -0700)]
Update OS X build instructions.

CoreFX can now be built without Windows.

9 years agoFix definition/initalization order build break
Matt Ellis [Wed, 15 Jul 2015 03:25:02 +0000 (20:25 -0700)]
Fix definition/initalization order build break

Clang is more strict about definition and intialization orders
matching than MSVC.

9 years agoUpdate documentation links
sergey-raevskiy [Tue, 14 Jul 2015 21:52:55 +0000 (00:52 +0300)]
Update documentation links

9 years agoFix to Unnecessary use of JIT_Stelem_Ref helper call when storing null in arrays.
Venkata Sivaramakrishna Ramadugu [Tue, 14 Jul 2015 23:15:18 +0000 (16:15 -0700)]
Fix to Unnecessary use of JIT_Stelem_Ref helper call when storing null in arrays.

Repro program:
     static T Dequeue<T>(T[] array, int index)
     {
         var head = array[index];
         array[index] = default(T);
         return head;
     }

     When Dequeue is instantiated over a ref type, the second line logically expands to

     object temp;
     initobj(&temp, null, 8)
     array[index] = temp

     The array store results in call to CORINFO_HELP_ARRADDR_ST helper call even though we are storing a null and a write barrier is not needed.

Fix:
     After the args of helper call are morphed, (i.e. after constant propagation is done), we can check to see whether the 3rd arg (value being assigned) is null and if so morph that into an array-indexed assignment so that a proper null and bounds check still take place.

Fix #1160

[tfs-changeset: 1501294]

9 years agoFix to bug#1173115 and Issue#1 listed in bug#1177388.
Venkata Sivaramakrishna Ramadugu [Tue, 14 Jul 2015 23:13:42 +0000 (16:13 -0700)]
Fix to bug#1173115 and Issue#1 listed in bug#1177388.

On xarch, bin-ops like add/mul/div that write to its LHS operand (i.e. target of result) and hence lower indicates to LSRA to preference the result of such bin-ops to its target operand to avoid additional moves.  The issue is that when we have nested bin-op expression like GT_MUL(GT_ADD(a,b), c), LSRA will preference GT_MUL to its LHS operand only if there are further references of it.  Since there will no further references of LHS operand GT_ADD, GT_MUL is not preferenced to GT_ADD.  This results in an additional move.  Fix in lines 4289-4307 is meant to fix this by letting to use relatedInterval even if there are no further references of it.

     With the above fix alone, there were major CQ losses since GT_STORE_LCL_VAR(GT_ADD(a,b)) would require a mov if GT_ADD is not preferenced to its parent lcl var but to its target operand ('a' in this case).  To fix this lines 2977-2981 allow a non-lclvar source of a STORE_LCL_VAR to use its parent interval as related interval for preferencing.

     With the combination so the above two fixes, there is a overall 0.32% improvement in size of the methods that got impacted.  The regressions are all smaller and a result of register preferencing got changed due to the above two fixes.

Fix #1163
CQ persuite run indicates Fractals benchmark improved by 15%.

[tfs-changeset: 1501293]

9 years agoMerge pull request #1219 from mmitche/package-json-2
Matt Mitchell [Tue, 14 Jul 2015 22:38:36 +0000 (15:38 -0700)]
Merge pull request #1219 from mmitche/package-json-2

Move CoreCLR to the modern build tools and dnx

9 years agoFix to issue- .Net 4.6 RC x64 is twice as slow as Legacy Jit64 and x86.
Venkata Sivaramakrishna Ramadugu [Tue, 14 Jul 2015 21:46:01 +0000 (14:46 -0700)]
Fix to issue- .Net 4.6 RC x64 is twice as slow as Legacy Jit64 and x86.

Perf regression is due to a stall caused by "cvtsi2sd xmm1, rax" that partially writes lower 8-bytes of xmm1 but keeps other bytes unmodified. Since there are further uses of xmm1, it will introduce a false dependency and cause stalls.

Fix is to emit "xorps targetReg, targetReg" before a cvtsi2ss/sd instruction.

Fix #993

[tfs-changeset: 1501252]

9 years agoMerge pull request #1222 from dotnet-bot/from-tfs
Jan Kotas [Tue, 14 Jul 2015 20:01:20 +0000 (13:01 -0700)]
Merge pull request #1222 from dotnet-bot/from-tfs

Merge changes from TFS

9 years agoMerge pull request #1231 from justinvp/array_reverse
Stephen Toub [Tue, 14 Jul 2015 19:47:58 +0000 (15:47 -0400)]
Merge pull request #1231 from justinvp/array_reverse

Perf: List<T>.Reverse changed to not use non-generic Array.Reverse

9 years agoImprove the performance of List<T>.Reverse
Justin Van Patten [Sun, 12 Jul 2015 00:44:53 +0000 (17:44 -0700)]
Improve the performance of List<T>.Reverse

List<T>.Reverse is currently implemented in terms of the non-generic
Array.Reverse. Array.Reverse includes a fast path for a known set
of primitive types via a call into the runtime (see TrySZReverse).
Otherwise, it falls back to slower code paths that involve boxing
for non-primitive value types.

This commit changes List<T>.Reverse to use a generic implementation
of reverse that does not have the performance issue for
non-primitive value types.

9 years agoDon't reorder operands for Vector constructor
Carol Eidt [Tue, 14 Jul 2015 04:31:46 +0000 (21:31 -0700)]
Don't reorder operands for Vector constructor

The code in simd.cpp that recognizes the constructor for fixed-size vectors (the InitN intrinsic) was incorrectly reordering the operands. Constructing the vector in reverse order is more efficient, but that can be done in codegen without change execution order.

This change results in numerous diffs, with more regressions than improvements. The diffs are due to somewhat different register pressure, due to the ordering change, and different cases of constant reuse.

Fix #1212

[tfs-changeset: 1500923]

9 years agoMerge pull request #1216 from janvorli/fix-destructor-contracts
Jan Vorlicek [Fri, 10 Jul 2015 19:22:05 +0000 (21:22 +0200)]
Merge pull request #1216 from janvorli/fix-destructor-contracts

Add missing contracts to some destructors

9 years agoFix SHR operand diassembly
mike [Fri, 10 Jul 2015 16:17:33 +0000 (19:17 +0300)]
Fix SHR operand diassembly

9 years agoSupport for SIMD Exceptions
Carol Eidt [Thu, 9 Jul 2015 23:28:23 +0000 (16:28 -0700)]
Support for SIMD Exceptions

For the CopyTo methods, we need to throw ArgumentOutOfRangeException instead of IndexOutOfRangeException for the initial index value, and then ArgumentException if the number of elements exceeds the remaining elements in the array. To support this, the GenTreeBoundsChk node now has a gtThrowKind field which indicates the kind of throw block it will branch to if the check failes.

This requires new helper calls, which I added to the end of corinfo.h.

[tfs-changeset: 1499475]

9 years agoAdd missing contracts to some constructors
Jan Vorlicek [Thu, 9 Jul 2015 23:24:02 +0000 (01:24 +0200)]
Add missing contracts to some constructors

After adding virtual destructors to some classes, the contract scanning
tool started to complain about missing contracts in some of the
constructors that were not touched.
This change adds contracts to those.

9 years agoMove CoreCLR to the modern build tools and dnx
Matt Mitchell [Mon, 6 Jul 2015 23:12:43 +0000 (16:12 -0700)]
Move CoreCLR to the modern build tools and dnx

This changes moves coreclr onto DNX (same version as corefx).  Theoretically, this should allow these tests to target the desktop CLR.  All of the old package.config files are gone and replaced with corresponding project.json files.  The up front restore behavior is retained.  Tests are now buildable individually, though not runnable in a similar fashion.

9 years agoSIMD Exceptions Fix (TFS 1189814)
Carol Eidt [Thu, 9 Jul 2015 21:55:24 +0000 (14:55 -0700)]
SIMD Exceptions Fix (TFS 1189814)

For the intrinsics that take arrays, we need to check the initial index (if given) to ensure that it is non-null.

[tfs-changeset: 1499422]

9 years agoFixing Databinding scenario for KeyValuePair. Refactoring the databinding code for...
Rama Krishnan Raghupathy [Thu, 9 Jul 2015 19:14:33 +0000 (12:14 -0700)]
Fixing Databinding scenario  for KeyValuePair. Refactoring the databinding code for CLRIReferenceImpl/CLRIReferenceArrayImpl/ICustomPropertyProviderProxy

[tfs-changeset: 1499363]

9 years agoMerge pull request #1215 from richardlford/rosfix
Jan Kotas [Thu, 9 Jul 2015 06:15:02 +0000 (23:15 -0700)]
Merge pull request #1215 from richardlford/rosfix

Modify conservative GC code for unaligned InlinedCallFrames

9 years agoModify conservative GC code for unaligned InlinedCallFrames
Richard L Ford [Wed, 8 Jul 2015 07:17:53 +0000 (00:17 -0700)]
Modify conservative GC code for unaligned InlinedCallFrames

When making pinvoke calls the JITs allocate InlinedCallFrames
within their stack frames to record the location
of the managed stack frame. These InlinedCallFrames are
not necessarily 8-byte aligned. These were being used
as the topStack in src/vm/gcenv.cpp, in the method
GCToEEInterface::ScanStackRoots.

This change checks to see if a frame is an InlinedCallFrame.
If so then its GetCallSiteSP method is used to
get the real top of stack. This will always be aligned.

There were two problem before this change wwhen the
frame was misaligned (e.g. ending with 4 or c):

1. GCToEEInterface::ScanStackRoots starts at the
topStack and look at every 8-byte chunk as if it were a
pointer. But if topStack is unaligned it is not really
finding the pointers on the stack.

2. When it gets to the bottom the 8-byte access
read the first 4 bytes ok, but the last 4 bytes
go beyond mapped addresses and an access violation
results.

9 years agoMerge pull request #1211 from mmitche/improve-build-tp
Matt Mitchell [Wed, 8 Jul 2015 22:16:26 +0000 (15:16 -0700)]
Merge pull request #1211 from mmitche/improve-build-tp

Improve the build throughput

9 years agoMerge pull request #1217 from mikem8361/fixassert
Mike McLaughlin [Wed, 8 Jul 2015 21:47:08 +0000 (14:47 -0700)]
Merge pull request #1217 from mikem8361/fixassert

Fix recursive asserts in coreclr.

9 years agoCR feedback.
Mike McLaughlin [Wed, 8 Jul 2015 18:22:09 +0000 (11:22 -0700)]
CR feedback.

9 years agoFix recursive asserts in coreclr.
Mike McLaughlin [Tue, 7 Jul 2015 22:14:15 +0000 (15:14 -0700)]
Fix recursive asserts in coreclr.

Remove assert in VM break handler to prevent recursive asserts. Fixed problem where the DebugBreak wasn't terminating the app on an assert causing double assert messages.  Restoring the SIGTRAP handler and returning was continuing the DebugBreak not terminating. Replaced this with an abort().

Cleanup the assert message formatting.