platform/upstream/coreclr.git
8 years agoMerge pull request #2883 from stephentoub/cts_size
Stephen Toub [Wed, 27 Jan 2016 22:55:29 +0000 (14:55 -0800)]
Merge pull request #2883 from stephentoub/cts_size

Reduce size of CancellationCallbackInfo

8 years agoReduce size of CancellationCallbackInfo
stephentoub [Wed, 27 Jan 2016 18:41:27 +0000 (10:41 -0800)]
Reduce size of CancellationCallbackInfo

Each registration with a cancelable CancellationToken results in allocating a CancellationCallbackInfo instance to store the relevant state, e.g. the action to invoke, the associated CTS, etc.  CancellationToken.Register has a little-known and very-little-used feature that enables the callback to be automatically sent to a captured SynchronizationContext, and as such the CancellationCallbackInfo has a field to store the SynchronizationContext, too.  But this field is almost always null.

This change reduces the size of CancellationCallbackInfo from 56 to 48 bytes on 64-bit by moving the TargetSynchronizationContext field to a derived type.  The derived instance with the extra field is only allocated when there is a SynchronizationContext captured.

8 years agoMerge pull request #2879 from janvorli/fix-exception-in-prestub-using-holder-pass1
Jan Vorlicek [Wed, 27 Jan 2016 15:11:19 +0000 (16:11 +0100)]
Merge pull request #2879 from janvorli/fix-exception-in-prestub-using-holder-pass1

Fix exception in PreStubWorker call chain - update

8 years agoFix exception in PreStubWorker call chain - update
Jan Vorlicek [Wed, 27 Jan 2016 11:20:38 +0000 (12:20 +0100)]
Fix exception in PreStubWorker call chain - update

This change fixes one case that the previous fix was missing. This is a case when
the exception in the PreStubWorker call chain is thrown by native code, for example
during jitting the target managed method. In this case, the DispatchManagedException
is called in the first pass, so we need to do the same change as in the previous
fix for the first pass as well.
Since we now have the first managed frame context available in the
DispatchManagedException for the first pass too, I have modified the
UnwindManagedExceptionPass1 to get it as a parameter so that it doesn't
need to do the unwinding to that frame again.

8 years agoMerge pull request #2866 from LLITCHEV/x86-assert-fix
Lubomir Litchev [Wed, 27 Jan 2016 08:13:23 +0000 (00:13 -0800)]
Merge pull request #2866 from LLITCHEV/x86-assert-fix

Disable initialization of _lvArgReg and _lvOtherArgReg on x86.

8 years agoMerge pull request #2864 from richlander/rich-header
Jan Kotas [Wed, 27 Jan 2016 04:21:18 +0000 (20:21 -0800)]
Merge pull request #2864 from richlander/rich-header

Update copyright and file header guidance for .NET Core

8 years agoUpdate copyright for .NET Core and update file header guidance
Richard Lander [Sun, 24 Jan 2016 00:44:25 +0000 (16:44 -0800)]
Update copyright for .NET Core and update file header guidance

8 years agoFix a bug in fgExtendDbgLifetimes for testing lvArgReg instead of
Lubomir Litchev [Wed, 27 Jan 2016 01:42:40 +0000 (17:42 -0800)]
Fix a bug in fgExtendDbgLifetimes for testing lvArgReg instead of
lvIsRegArg.

The code for extending lifetime of lclvar was looking at lvArgReg instead
of lvIsRegArg member of LclVarDesc.

8 years agoMerge pull request #2871 from gkhanna79/FixBadAssert
Gaurav Khanna [Wed, 27 Jan 2016 00:34:17 +0000 (16:34 -0800)]
Merge pull request #2871 from gkhanna79/FixBadAssert

Remove Invalid assert

8 years agoMerge pull request #2869 from wtgodbe/pathName
William Godbe [Wed, 27 Jan 2016 00:30:54 +0000 (16:30 -0800)]
Merge pull request #2869 from wtgodbe/pathName

Shorten path names of test binaries in the CI to avoid file names longer than 260 chars

8 years agoRemove Invalid assert
Gaurav Khanna [Tue, 26 Jan 2016 23:57:47 +0000 (15:57 -0800)]
Remove Invalid assert

8 years agoShorten path names of test binaries in the CI to avoid file names longer than 260...
William Godbe [Tue, 26 Jan 2016 23:05:07 +0000 (15:05 -0800)]
Shorten path names of test binaries in the CI to avoid file names longer than 260 chars

8 years agoMerge pull request #2857 from briansull/fix_issue_2823
Brian Sullivan [Tue, 26 Jan 2016 21:49:28 +0000 (13:49 -0800)]
Merge pull request #2857 from briansull/fix_issue_2823

Change to disallow the generation of "locked" instructions for non-x86/x64 targets

8 years agoMerge pull request #2851 from AndyAyersMS/FixDeltaBlue
Andy Ayers [Tue, 26 Jan 2016 21:26:20 +0000 (13:26 -0800)]
Merge pull request #2851 from AndyAyersMS/FixDeltaBlue

Modify deltablue to avoid gratuitous exception at runtime

8 years agoChange to disallow the generation of "locked" instruction for non-x86/x64 targets
Brian Sullivan [Tue, 26 Jan 2016 00:29:21 +0000 (16:29 -0800)]
Change to disallow the generation of "locked" instruction for non-x86/x64 targets

Updated Tests.lst with 79 tests that now pass after this fix
Newly passing tests are also marked with the ISSUE_2823 tag
Updated Test.lst with additional REL_PASS tests

8 years agoMerge pull request #2821 from mikem8361/osxbpfix
Mike McLaughlin [Tue, 26 Jan 2016 19:19:28 +0000 (11:19 -0800)]
Merge pull request #2821 from mikem8361/osxbpfix

Fix OSX bps for PC-relative instructions.

8 years agoModify deltablue to avoid gratuitous exception at runtime
Andy Ayers [Mon, 25 Jan 2016 22:25:17 +0000 (14:25 -0800)]
Modify deltablue to avoid gratuitous exception at runtime

8 years agoMerge pull request #2815 from steveharter/FixSanitizerClrStartup
Steve Harter [Tue, 26 Jan 2016 17:27:36 +0000 (11:27 -0600)]
Merge pull request #2815 from steveharter/FixSanitizerClrStartup

Clang sanitizer fixes to remove incorrect function type 'void *(*)()'

8 years agoMerge pull request #2863 from janvorli/fix-exception-in-prestub-using-holder
Jan Kotas [Tue, 26 Jan 2016 17:09:48 +0000 (09:09 -0800)]
Merge pull request #2863 from janvorli/fix-exception-in-prestub-using-holder

Fix exception exiting the PreStubWorker

8 years agoMerge pull request #2859 from jkotas/gc-update
Jan Kotas [Tue, 26 Jan 2016 16:55:09 +0000 (08:55 -0800)]
Merge pull request #2859 from jkotas/gc-update

Update GC from CoreRT

8 years agoMerge pull request #2846 from eerhardt/Fix5469
Eric Erhardt [Tue, 26 Jan 2016 16:41:02 +0000 (10:41 -0600)]
Merge pull request #2846 from eerhardt/Fix5469

TimeZoneInfo behaves differently before and after calling GetSystemTimeZones on Unix

8 years agoFix exception in PreStubWorker
Jan Vorlicek [Tue, 26 Jan 2016 01:48:37 +0000 (02:48 +0100)]
Fix exception in PreStubWorker

This change fixes a problem when exception happens in managed code called from
the PreStubWorker and the PreStubWorker (resp. its caller, ThePreStub) was called
from native code.
The issue was that the INSTALL_MANAGED_EXCEPTION_DISPATCHER calls DispatchManagedException
and that function expected that the INSTALL_MANAGED_EXCEPTION_DISPATCHER was always
at the boundary between managed and native frames and so it skipped the native frames
upto the first managed frame.
The PreStubWorker is the only case where this is not always true and so the native frames
need to be unwound by rethrowing the C++ exception when the PreStubWorker was called from
native code.

8 years agoFix OSX bps for PC-relative instructions.
Mike McLaughlin [Fri, 15 Jan 2016 21:57:47 +0000 (13:57 -0800)]
Fix OSX bps for PC-relative instructions.

Changed the mach exception handling to always hijack/send the exception back to the faulting
thread. Once running back in the faulting thread in PAL_DispatchException if the VM/debugger
code/hardware exception catching doesn't want this exception the exception message is forwarded
to the next exception port if one. Otherwise the process is aborted.

If the exception is forwarded, the faulting thread just busy waits until it gets hijacked
again by the next PAL exception thread in the system.

The exception message is always sent success as a reply after after the faulting thread is
hijacked. All the reply forwarding logic has been removed. This means we assume that OSX
default action for the unhandled exception is to abort the process. We don't reply with
KERN_FAILURE like before when the exception is unhandled. This also means that any third
party code hooking exception ports at the task or host level are not sent the exception
message.

The exception message is now also passed to PAL_DispatchException along with the ExceptionRecord
and Context so it can be used to forward the message if the VM doesn't want it (via a new function
called ForwardMachException).

Removed creating the reply port MachMessage::ForwardNotification and handle/ignore replies
in worker thread.

The original hijack logic queried the faulting thread's current state to build the thread CONTEXT
and the ExceptionRecord. Because the faulting thread runs now and forwards the exception notification
in its context, the hijack logic needs to use the thread state from the message to build the thread
CONTEXT. Refactored CONTEXT_GetThreadContextFromThreadState out of CONTEXT_GetThreadContextFromPort
as a part of this. Also needed to deal with x86_THREAD_STATE thread state flavor (which can be either
32 or 64 bit) instead of the x86_THREAD_STATE32/x86_THREAD_STATE64 explicitly used to get the thread
state in the original code.

Removed the code in ExceptionRecordFromMessage (formerly known as exception_from_trap_code) to
explicitly get the fault address from the thread instead of using the extra "code" in the exception
message to fill in the ExceptionInformation[1] field for access violations. Getting the faulting
address from the thread port doesn't work if the exception was forwarded and the "code" in the
exception message is accurate.

Since ICLRRuntimeHost2::RegisterMacEHPort() isn't implemented or used anymore and to simplify
the MAC exception code, removed s_TopExceptionPort and the top/bottom exception port logic.

Removed the s_ExceptionPortSet and just use s_ExceptionPort directly because we no longer
wait to receive messages from the reply port when forwarding the exception.

General cleanup. Renaming functions not to have underscores and locals not have the first letter
capitalized.

renamed:
        catch_exception_raise -> HijackFaultingThread
        exception_from_trap_code -> ExceptionRecordFromMessage

removed:
        malloc_zone_t *s_pExecutableHeap
        struct ForwardedNotification
        PROCThreadFromMachPort(mach_port_t hTargetThread)
        IsWithinCoreCLR(void *pAddr)
        all the malloc_zone utilities in machexception.cpp
        IsHandledException(MachMessage *pNotification, CorUnix::CPalThread *pThread)

8 years agoUpdate GC from CoreRT
Jan Kotas [Tue, 26 Jan 2016 02:55:32 +0000 (18:55 -0800)]
Update GC from CoreRT

https://github.com/dotnet/corert/tree/master/src/Native/gc 0dcc350dae128b6fcca6b1ed74b580ed3240460a

8 years agoMerge pull request #2825 from bbowyersmyth/StringStartsWithPt2
Jan Kotas [Tue, 26 Jan 2016 08:07:20 +0000 (00:07 -0800)]
Merge pull request #2825 from bbowyersmyth/StringStartsWithPt2

String.StartsWith performance - OrdinalCompareSubstring

8 years agoMerge pull request #2853 from gkhanna79/Fix2850
Jan Kotas [Tue, 26 Jan 2016 07:18:46 +0000 (23:18 -0800)]
Merge pull request #2853 from gkhanna79/Fix2850

Ensure TPA Binder initialized Managed ALC field to NULL.

8 years agoString.StartsWith performance - StartsWithOrdinalHelper
Bruce Bowyer-Smyth [Tue, 26 Jan 2016 05:26:38 +0000 (15:26 +1000)]
String.StartsWith performance - StartsWithOrdinalHelper

8 years agoMerge pull request #2855 from adityamandaleeka/fixDasmAssert
Aditya Mandaleeka [Tue, 26 Jan 2016 01:03:30 +0000 (17:03 -0800)]
Merge pull request #2855 from adityamandaleeka/fixDasmAssert

Move assert under COREDISTOOLS ifdef.

8 years agoMerge pull request #2852 from adiaaida/updateContract
Jan Kotas [Mon, 25 Jan 2016 23:31:20 +0000 (15:31 -0800)]
Merge pull request #2852 from adiaaida/updateContract

Change isDelegateCall to be LIMITED_METHOD_CONTRACT

8 years agoMove assert under COREDISTOOLS ifdef.
Aditya Mandaleeka [Mon, 25 Jan 2016 23:24:47 +0000 (15:24 -0800)]
Move assert under COREDISTOOLS ifdef.

8 years agoLabeled the ARM64 dbg test failures due to issue 2849
Brian Sullivan [Mon, 25 Jan 2016 23:17:09 +0000 (15:17 -0800)]
Labeled the ARM64 dbg test failures due to issue 2849

8 years agoEnsure TPA Binder initialized Managed ALC field to NULL
Gaurav Khanna (CLR) [Mon, 25 Jan 2016 22:31:55 +0000 (14:31 -0800)]
Ensure TPA Binder initialized Managed ALC field to NULL

8 years agoChange isDelegateCall to be LIMITED_METHOD_CONTRACT
Michelle McDaniel [Mon, 25 Jan 2016 22:27:04 +0000 (14:27 -0800)]
Change isDelegateCall to be LIMITED_METHOD_CONTRACT

WRAPPER_NO_CONTRACT on isDelegateCall causes static contract analyzer to fail.  Change to LIMITED_METHOD_CONTRACT to fix this issue.

8 years agoMerge pull request #2845 from AndyAyersMS/DisableCscBenchOffWindows
Andy Ayers [Mon, 25 Jan 2016 21:44:04 +0000 (13:44 -0800)]
Merge pull request #2845 from AndyAyersMS/DisableCscBenchOffWindows

Disable running CscBench off windows

8 years agoMerge pull request #2819 from briansull/lvOtherArgReg
Brian Sullivan [Mon, 25 Jan 2016 21:32:28 +0000 (13:32 -0800)]
Merge pull request #2819 from briansull/lvOtherArgReg

Fix issues on ARM64 with lvOtherArgReg being initialized to REG_STK

8 years agoTimeZoneInfo behaves differently before and after calling GetSystemTimeZones on Unix
Eric Erhardt [Mon, 25 Jan 2016 20:45:16 +0000 (14:45 -0600)]
TimeZoneInfo behaves differently before and after calling GetSystemTimeZones on Unix

Once GetSystemTimeZones() is called, TimeZoneInfo assumes it has all of the time zones from the local machine, and doesn't try going back to the local machine in FindSystemTimeZoneById.  On Unix, we get all system time zones from the zones.tab file and each individual time zone comes from a tzfile with the "ID" as the file name. There are some tzfiles that aren't in the zones.tab file. This means if you call FindSystemTimeZoneById before calling GetSystemTimeZones(), it will be successful since we check the file system. But after you call GetSystemTimeZones(), a TimeZoneNotFoundException is thrown.

In order to solve this, on Unix we always check the local machine for FindSystemTimeZoneById before throwing a TimeZoneNotFoundException, no matter if GetSystemTimeZones() was called already or not.

Fix https://github.com/dotnet/corefx/issues/5469

8 years agoMerge pull request #2807 from kangaroo/seh-unwind-context-fix
Jan Vorlicek [Mon, 25 Jan 2016 20:31:48 +0000 (21:31 +0100)]
Merge pull request #2807 from kangaroo/seh-unwind-context-fix

Fix PAL_VirtualUnwindOutOfProc for the case where unw_context is not …

8 years agoClang sanitizer fixes to remove incorrect function type 'void *(*)()'
Steve Harter [Fri, 22 Jan 2016 22:57:00 +0000 (16:57 -0600)]
Clang sanitizer fixes to remove incorrect function type 'void *(*)()'

8 years agoMerge pull request #2832 from Priya91/includefiles
Jan Kotas [Mon, 25 Jan 2016 19:35:54 +0000 (11:35 -0800)]
Merge pull request #2832 from Priya91/includefiles

Add identity.cpp to build.

8 years agoMerge pull request #2811 from wtgodbe/groovy
William Godbe [Mon, 25 Jan 2016 18:52:33 +0000 (10:52 -0800)]
Merge pull request #2811 from wtgodbe/groovy

Fixed build and test of rc2 branch in CI

8 years agoDisable running CscBench off windows
Andy Ayers [Mon, 25 Jan 2016 18:39:15 +0000 (10:39 -0800)]
Disable running CscBench off windows

Disable this test when running off Windows for now, while we're getting to the root cause of #2728.

8 years agoFixed build and test of rc2 branch in CI
William Godbe [Fri, 22 Jan 2016 20:04:34 +0000 (12:04 -0800)]
Fixed build and test of rc2 branch in CI

8 years agoMerge pull request #2814 from sejongoh/add_jit_stress_modes
Sejong Oh [Mon, 25 Jan 2016 17:15:15 +0000 (09:15 -0800)]
Merge pull request #2814 from sejongoh/add_jit_stress_modes

Add jit stress modes to netci.groovy

8 years agoMerge pull request #2843 from hughbe/bitconverter-comments
Jan Kotas [Mon, 25 Jan 2016 17:06:42 +0000 (09:06 -0800)]
Merge pull request #2843 from hughbe/bitconverter-comments

Remove irrelevant endianness comment, fix #834

8 years agoRemove irrelevant endianness comment, fix #834
Hugh Bellamy [Mon, 25 Jan 2016 16:27:13 +0000 (16:27 +0000)]
Remove irrelevant endianness comment, fix #834

Fixes #834 (see the issue for the rationale)

8 years agoMerge pull request #2828 from juergenhoetzel/python3_fixes
Rama krishnan Raghupathy [Mon, 25 Jan 2016 11:00:17 +0000 (03:00 -0800)]
Merge pull request #2828 from juergenhoetzel/python3_fixes

Fix Python 3 issue in LTTNG generating code script

8 years agoFix Python 3 issue in LTTNG generating code script
Juergen Hoetzel [Sat, 23 Jan 2016 17:30:00 +0000 (18:30 +0100)]
Fix Python 3 issue in LTTNG generating code script

In Python 3 the print statement has become a function.
Enforce Python 3 style by by using __future__ module.

8 years agoFix build breaks and ensure GetComputerNameW is included in mscorlib.
Lakshmi Priya Sekar [Sun, 24 Jan 2016 22:50:28 +0000 (14:50 -0800)]
Fix build breaks and ensure GetComputerNameW is included in mscorlib.

8 years agoMerge pull request #2838 from dotnet/revert-2817-CoreRTPInvoke
Jan Kotas [Mon, 25 Jan 2016 05:43:55 +0000 (21:43 -0800)]
Merge pull request #2838 from dotnet/revert-2817-CoreRTPInvoke

Revert "Generate P/Invoke transitions for CoreRT."

8 years agoRevert "Generate P/Invoke transitions for CoreRT."
Jan Kotas [Mon, 25 Jan 2016 05:43:42 +0000 (21:43 -0800)]
Revert "Generate P/Invoke transitions for CoreRT."

8 years agoAdd JIT stress modes to netci.groovy
Sejong Oh [Fri, 22 Jan 2016 21:09:00 +0000 (13:09 -0800)]
Add JIT stress modes to netci.groovy

Fixed the environment variable names for JIT stress modes

8 years agoMerge pull request #2817 from pgavlin/CoreRTPInvoke
Kyungwoo Lee [Mon, 25 Jan 2016 03:19:55 +0000 (19:19 -0800)]
Merge pull request #2817 from pgavlin/CoreRTPInvoke

8 years agoMerge pull request #2837 from akarpov89/fix-typo
Jan Kotas [Sun, 24 Jan 2016 23:39:49 +0000 (15:39 -0800)]
Merge pull request #2837 from akarpov89/fix-typo

Fix typo

8 years agoFix typo
Andrew Karpov [Sun, 24 Jan 2016 22:55:33 +0000 (01:55 +0300)]
Fix typo

Replace "childre" with "children"

8 years agoMerge pull request #2833 from stephentoub/convertto
Jan Kotas [Sun, 24 Jan 2016 16:51:07 +0000 (08:51 -0800)]
Merge pull request #2833 from stephentoub/convertto

Improve inlining of Convert.To* methods

8 years agoAdd identity.cpp to build.
Lakshmi Priya Sekar [Sun, 24 Jan 2016 09:15:18 +0000 (01:15 -0800)]
Add identity.cpp to build.

8 years agoMerge pull request #2829 from krytarowski/netbsd-support-11
Jan Kotas [Sun, 24 Jan 2016 02:50:48 +0000 (18:50 -0800)]
Merge pull request #2829 from krytarowski/netbsd-support-11

Add new IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE type for NetBSD

8 years agoAddress code review feedback.
Pat Gavlin [Sun, 24 Jan 2016 01:17:47 +0000 (17:17 -0800)]
Address code review feedback.

8 years agoMerge pull request #2745 from ellismg/disable-finalizer-test
Matt Ellis [Sat, 23 Jan 2016 22:48:03 +0000 (14:48 -0800)]
Merge pull request #2745 from ellismg/disable-finalizer-test

Disable flaky test against 2744

8 years agoAdd new IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE type for NetBSD
Kamil Rytarowski [Sat, 23 Jan 2016 22:30:40 +0000 (23:30 +0100)]
Add new IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE type for NetBSD

Random number selected for NetBSD is 0x1993.
1993 is the year of founding the project.

Closes #2805 "What's the Platform ID for NetBSD?" by myself.

8 years agoSort IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE by OS
Kamil Rytarowski [Sat, 23 Jan 2016 22:26:11 +0000 (23:26 +0100)]
Sort IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE by OS

8 years agoMerge pull request #2614 from AndyAyersMS/Bytemark
Andy Ayers [Sat, 23 Jan 2016 21:56:25 +0000 (13:56 -0800)]
Merge pull request #2614 from AndyAyersMS/Bytemark

Add the bytemark benchmarks

8 years agoDisable flaky test against #2744
Matt Ellis [Wed, 20 Jan 2016 07:18:42 +0000 (23:18 -0800)]
Disable flaky test against #2744

8 years agoImprove perf of Convert.To* methods
stephentoub [Sat, 23 Jan 2016 14:55:01 +0000 (09:55 -0500)]
Improve perf of Convert.To* methods

Many of these methods are just casts with an up-front out-of-bounds check to throw an exception it an overflow occurs.  Those checks, and specifically the throw statement that follows is causing many of these methods to be non-inlineable.  A microbenchmark shows that factoring out these statements increases throughput by as much as 6x.  Some of these were previously showing up as measurable contributions to CPU time in a real-world app being profiled.

8 years agoMerge pull request #2797 from krytarowski/netbsd-support-6
Jan Kotas [Sat, 23 Jan 2016 15:19:21 +0000 (07:19 -0800)]
Merge pull request #2797 from krytarowski/netbsd-support-6

NetBSD: Define PAL_CS_NATIVE_DATA_SIZE for few NetBSD platforms

8 years agoMerge pull request #2800 from krytarowski/netbsd-support-8
Jan Kotas [Sat, 23 Jan 2016 15:10:48 +0000 (07:10 -0800)]
Merge pull request #2800 from krytarowski/netbsd-support-8

NetBSD: CHAR_BIT as defined by POSIX in limits.h

8 years agoMerge pull request #2795 from Dmitry-Me/fixInterlockedDecrementRace
Jan Kotas [Sat, 23 Jan 2016 14:45:41 +0000 (06:45 -0800)]
Merge pull request #2795 from Dmitry-Me/fixInterlockedDecrementRace

Non-interlocked read of variable after InterlockedDecrement() causes a race

8 years agoMerge pull request #2802 from krytarowski/netbsd-support-9
Jan Kotas [Sat, 23 Jan 2016 14:43:21 +0000 (06:43 -0800)]
Merge pull request #2802 from krytarowski/netbsd-support-9

NetBSD: Don't link with -ldl for dlopen(3) on NetBSD

8 years agoMerge pull request #2799 from krytarowski/netbsd-support-7
Jan Kotas [Sat, 23 Jan 2016 06:23:01 +0000 (22:23 -0800)]
Merge pull request #2799 from krytarowski/netbsd-support-7

NetBSD: Detect copysign(3) properly on NetBSD inside the math library

8 years agoMerge pull request #2804 from krytarowski/netbsd-support-10
Jan Kotas [Sat, 23 Jan 2016 06:22:09 +0000 (22:22 -0800)]
Merge pull request #2804 from krytarowski/netbsd-support-10

NetBSD: Add a kludge to disable unimplemented SEHEnable()/Disable()

8 years agoMerge pull request #2826 from kangaroo/uname-fix
Jan Kotas [Sat, 23 Jan 2016 05:26:47 +0000 (21:26 -0800)]
Merge pull request #2826 from kangaroo/uname-fix

[xplat] uname -p reports unknown on some arch -- fall back to uname -m

8 years ago[xplat] uname -p reports unknown on some arch -- fall back to uname -m
Geoff Norton [Sat, 23 Jan 2016 04:21:50 +0000 (04:21 +0000)]
[xplat] uname -p reports unknown on some arch -- fall back to uname -m

8 years agoFix PAL_VirtualUnwindOutOfProc for the case where unw_context is not a ucontext_t
Geoff Norton [Fri, 22 Jan 2016 18:44:37 +0000 (10:44 -0800)]
Fix PAL_VirtualUnwindOutOfProc for the case where unw_context is not a ucontext_t

8 years agoMerge pull request #2808 from erozenfeld/ValueNumberingFix
Eugene Rozenfeld [Sat, 23 Jan 2016 01:55:53 +0000 (17:55 -0800)]
Merge pull request #2808 from erozenfeld/ValueNumberingFix

Fix a bug in JIT value numbering.

8 years agoMerge pull request #2779 from swgillespie/event_tracing
Sean Gillespie [Sat, 23 Jan 2016 01:21:04 +0000 (17:21 -0800)]
Merge pull request #2779 from swgillespie/event_tracing

Untangle FEATURE_EVENT_TRACE and GC_PROFILING for coreclr

8 years agoFix issues on ARM64 with lvOtherArgReg being initialized to REG_STK
Brian Sullivan [Sat, 23 Jan 2016 01:04:38 +0000 (17:04 -0800)]
Fix issues on ARM64 with lvOtherArgReg being initialized to REG_STK

8 years agoMerge pull request #2818 from briansull/arm64-tests
Brian Sullivan [Sat, 23 Jan 2016 00:53:07 +0000 (16:53 -0800)]
Merge pull request #2818 from briansull/arm64-tests

Arm64 Smarty List file use for testing on Windows systems

8 years agoArm64 Smarty List file use for testing on Windows systems
Brian Sullivan [Thu, 21 Jan 2016 22:24:55 +0000 (14:24 -0800)]
Arm64 Smarty List file use for testing on Windows systems

8 years agoGenerate P/Invoke transitions for CoreRT.
Pat Gavlin [Wed, 20 Jan 2016 21:44:43 +0000 (13:44 -0800)]
Generate P/Invoke transitions for CoreRT.

This change adds support for CoreRT-style P/Invoke transitions
to RyuJIT. Instead of the usual inlined transition code, these
transitions are made up of calls to two new JIT helpers:

    PInvokeTransitionFrame frame; // opaque local
    CORINFO_HELP_INIT_PINVOKE_FRAME(&frame);
    ...
    CORINFO_HELP_JIT_PINVOKE_BEGIN(&frame);
    target(...);
    CORINFO_HELP_JIT_PINVOKE_END(&frame);
    ...

The preemptive mode constraints apply between calls to
JIT_PINVOKE_BEGIN and JIT_PINVOKE_END: no managed references
may be live only in registers and managed references may not
be manipulated.

8 years agoMerge pull request #2791 from rahku/master
Rahul Kumar [Sat, 23 Jan 2016 00:17:30 +0000 (16:17 -0800)]
Merge pull request #2791 from rahku/master

Use coreclr buildtools nuget package instead of compiling the tools u…

8 years agoUse coreclr buildtools nuget package instead of compiling the tools used during build.
Rahul Kumar [Wed, 13 Jan 2016 22:14:46 +0000 (14:14 -0800)]
Use coreclr buildtools nuget package instead of compiling the tools used during build.
This only applies to windows build.

8 years agoMerge pull request #2806 from janvorli/fix-stack-limit-check
Jan Vorlicek [Sat, 23 Jan 2016 00:10:19 +0000 (01:10 +0100)]
Merge pull request #2806 from janvorli/fix-stack-limit-check

Fix missing setting of ScanContext::stack_limit

8 years agoFix a bug in JIT value numbering.
Eugene Rozenfeld [Fri, 22 Jan 2016 01:54:10 +0000 (17:54 -0800)]
Fix a bug in JIT value numbering.

This is a fix for a silent bad codegen bug in value numbering.
The value numbering algorithm tries to check whether heap PHI arguments
evaluate to the same value for the given query. In doing so, it may encounter
PHIs that recursively depend on each other (this corresponds to cycles in
control flow graph). A special value RecursiveVN is returned in such cases.
The algorithm uses the following rule:
if some PHI arguments evaluate to RecursiveVN but all others evaluate to the
same value that's not RecursiveVN, then that value can be used as the result.
Furthermore, in order to avoid exponential searches in case of many PHI's the
results of all PHI evaluations are memoized.

The bug was that if RecursiveVN was used to get the result, it can't always
be memoized. In particular, if the loop causing recursive PHIs is a multi-entry
loop, intermediate PHI results shouldn't be memoized. The fix is conservative in
that it always disables memoization if RecursiveVN was involved. Note that we
also have another mechanism (budget) to mitigate expensive PHI evaluations.

There were no diffs in SuperPMI and no measurable throughput impact.

I added a test with a simplified repro.
The original bug had code with yield return.

I also fixed some formatting and added several function headers.

8 years agoNetBSD: Add a kludge to disable unimplemented SEHEnable()/Disable()
Kamil Rytarowski [Fri, 22 Jan 2016 16:07:49 +0000 (17:07 +0100)]
NetBSD: Add a kludge to disable unimplemented SEHEnable()/Disable()

8 years agoFix missing setting of ScanContext::stack_limit
Jan Vorlicek [Fri, 22 Jan 2016 16:07:26 +0000 (17:07 +0100)]
Fix missing setting of ScanContext::stack_limit

There is a code path executed when the GCStress is on and that was missing setting the stack_limit
value that the PromoteCarefully uses to detect objects on the stack.

8 years agoNetBSD: Don't link with -ldl for dlopen(3) on NetBSD
Kamil Rytarowski [Fri, 22 Jan 2016 15:16:21 +0000 (16:16 +0100)]
NetBSD: Don't link with -ldl for dlopen(3) on NetBSD

NAME
     dlopen, dlclose, dlsym, dlvsym, dladdr, dlctl, dlerror - dynamic link
     interface

LIBRARY
     (These functions are not in a library.  They are included in every
     dynamically linked program automatically.)

SYNOPSIS
     #include <dlfcn.h>

     void *
     dlopen(const char *path, int mode);

8 years agoNetBSD: CHAR_BIT as defined by POSIX in limits.h
Kamil Rytarowski [Fri, 22 Jan 2016 14:45:52 +0000 (15:45 +0100)]
NetBSD: CHAR_BIT as defined by POSIX in limits.h

Reference:

    limits.h - implementation-defined constants

    Numerical Limits
        {CHAR_BIT} Number of bits in a type char.

--- http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html

There is no such file as sys/limits.h in NetBSD.

8 years agoNetBSD: Detect copysign(3) properly on NetBSD inside the math library
Kamil Rytarowski [Fri, 22 Jan 2016 13:41:40 +0000 (14:41 +0100)]
NetBSD: Detect copysign(3) properly on NetBSD inside the math library

The copysing(3) function is a part of the libm library on NetBSD.
This is also true for other POSIX platforms.

NAME
     copysign, copysignf, copysignl - functions to manipulate signs

LIBRARY
     Math Library (libm, -lm)

SYNOPSIS
     #include <math.h>

     double
     copysign(double x, double y);

     float
     copysignf(float x, float y);

     long double
     copysignl(long double x, long double y);

STANDARDS
     The described functions conform to ISO/IEC 9899:1999 (``ISO C99'').

8 years agoAdd a comment from where comes the PAL_CS_NATIVE_DATA_SIZE value
Kamil Rytarowski [Fri, 22 Jan 2016 11:29:28 +0000 (12:29 +0100)]
Add a comment from where comes the PAL_CS_NATIVE_DATA_SIZE value

8 years agoNetBSD: Define PAL_CS_NATIVE_DATA_SIZE for few NetBSD platforms
Kamil Rytarowski [Fri, 22 Jan 2016 11:25:39 +0000 (12:25 +0100)]
NetBSD: Define PAL_CS_NATIVE_DATA_SIZE for few NetBSD platforms

Set PAL_CS_NATIVE_DATA_SIZE for:
- amd64 (x86_64),
- earm,
- hppa,
- i386,
- mips,
- sparc (32bit),
- sparc64.

8 years agoSort the definitions of PAL_CS_NATIVE_DATA_SIZE by platforms and archs
Kamil Rytarowski [Fri, 22 Jan 2016 11:18:30 +0000 (12:18 +0100)]
Sort the definitions of PAL_CS_NATIVE_DATA_SIZE by platforms and archs

8 years agoNon-interlocked read of variable after InterlockedDecrement() causes a race
Dmitry-Me [Fri, 22 Jan 2016 08:43:35 +0000 (11:43 +0300)]
Non-interlocked read of variable after InterlockedDecrement() causes a race

8 years agoMerge pull request #2794 from dotnet-bot/from-tfs
Jan Kotas [Fri, 22 Jan 2016 08:26:20 +0000 (00:26 -0800)]
Merge pull request #2794 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoMerge pull request #2786 from wtgodbe/groovy
Sergiy Kuryata [Fri, 22 Jan 2016 07:55:00 +0000 (23:55 -0800)]
Merge pull request #2786 from wtgodbe/groovy

Set longer timeout for pri 1 tests, and add testing for rc2 branch

8 years agoMerge pull request #2772 from ramarag/fixincrementabuild
Jan Kotas [Fri, 22 Jan 2016 05:52:16 +0000 (21:52 -0800)]
Merge pull request #2772 from ramarag/fixincrementabuild

Fix incremental build

8 years agoUntangle FEATURE_EVENT_TRACE and GC_PROFILING to enable one to be enabled
Sean Gillespie [Wed, 20 Jan 2016 18:52:11 +0000 (10:52 -0800)]
Untangle FEATURE_EVENT_TRACE and GC_PROFILING to enable one to be enabled
without the other

Fix the Ubuntu build by ensuring that HeapWalkHelper is defined when the rest of the heap walking mechanisms are defined

+feedback from jkotas and address missing symbols on Ubuntu

8 years agoFix x86chk coresys build
Aditya Mandaleeka [Fri, 22 Jan 2016 04:46:39 +0000 (20:46 -0800)]
Fix x86chk coresys build

[tfs-changeset: 1567626]

8 years agoFix ProjectK build breaks related to GC Stress change.
Aditya Mandaleeka [Fri, 22 Jan 2016 02:57:35 +0000 (18:57 -0800)]
Fix ProjectK build breaks related to GC Stress change.

[tfs-changeset: 1567550]

8 years agoMerge pull request #2784 from krytarowski/netbsd-support-5
Jan Kotas [Fri, 22 Jan 2016 02:47:07 +0000 (18:47 -0800)]
Merge pull request #2784 from krytarowski/netbsd-support-5

NetBSD: Add new target in src/pal/src/configure.cmake for NetBSD

8 years agoAdd the bytemark benchmarks
Andy Ayers [Sat, 9 Jan 2016 01:20:59 +0000 (17:20 -0800)]
Add the bytemark benchmarks

These are C# versions of benchmarks that originally appeared in BYTE magazine in 1995.
See file headers for attribution.

I've added [Benchmark] entry points for xunit-performance, and tuned each portion to run for
about 1 second per xunit-performance iteration. Note a couple of the tests have variant
implementations in C# -- either jagged vs MD arrays, or class vs struct, so there are more
numbers reported than in the original benchmark. When run under xunit the work per test is fixed.

When run as a command line app this will auto-tune (adjust iterations to try and hit some
running time threshold).  We may want to reduce the running time here some; I'll see what
it ends up being in the lab.

I've also tried to enable validation code where possible, both to ensure that the compiler
gets the right answers, and also so it can't cheat and remove computation.

The two assign benchmarks seem to report varying times in xunit mode, and may need to be
investigated further.