platform/upstream/coreclr.git
8 years agoFix dbgshim race conditions
Mike McLaughlin [Wed, 13 Apr 2016 20:42:51 +0000 (13:42 -0700)]
Fix dbgshim race conditions

There are two race conditions in the register runtime startup logic: 1) in
CreateProcess (or CreateProcessForLaunch) between the fork() and the execv()
where for VS and mdbg we "see" the coreclr module loaded because the debugger
process and newly created child have the same modules loaded. 2) in attach
between when the child/debuggee loads the coreclr module and when coreclr
finishes initializes the global dac table. In both causes DebugActiveProcess
returns an error when one of the race conditions is hit.

The fix is to create the "continue" named semaphore on the coreclr/debuggee
process side and dbgshim uses that to determine if the coreclr process is
ready and initialized. Fixes issue #4244.

Open the old continue semaphore name and if it doesn't exists create a the new
continue semaphore name for backwards compatibility (see issue 4410).

Do PAL initalization on entry to the public functions instead of the DLLMain handler
which will only be called if the PAL's LoadLibrary is used to load dbgshim. It will be
a lot easier on the debuggers like mdbg to just use dlopen/dlsym and not have to
also call DLLMain.

8 years agoMerge pull request #4472 from kyulee1/delarm64
Kyungwoo Lee [Thu, 21 Apr 2016 17:01:10 +0000 (10:01 -0700)]
Merge pull request #4472 from kyulee1/delarm64

Delete Non-Windows Arm64 Job

8 years agoDelete Non-Windows Arm64 Job
Kyungwoo Lee [Thu, 21 Apr 2016 16:21:09 +0000 (09:21 -0700)]
Delete Non-Windows Arm64 Job

8 years agoAdding Versioning to Native components in non-Windows builds. (#4393)
Jose Perez Rodriguez [Thu, 21 Apr 2016 15:45:23 +0000 (08:45 -0700)]
Adding Versioning to Native components in non-Windows builds. (#4393)

Adding Versioning to Native components in non-Windows builds.

8 years agoMerge pull request #4470 from kyulee1/ryutoclr
Kyungwoo Lee [Thu, 21 Apr 2016 14:47:32 +0000 (07:47 -0700)]
Merge pull request #4470 from kyulee1/ryutoclr

Package Name Update from RyuJit to ClrJit

8 years agoMerge pull request #4459 from brianrob/nativeimage_perfmap
Jan Kotas [Thu, 21 Apr 2016 14:40:57 +0000 (07:40 -0700)]
Merge pull request #4459 from brianrob/nativeimage_perfmap

Fix empty perf map files generated by crossgen

8 years agoName Update from RyuJit to ClrJit for or package
Kyungwoo Lee [Thu, 21 Apr 2016 14:40:05 +0000 (07:40 -0700)]
Name Update from RyuJit to ClrJit for or package

8 years agoMerge pull request #4469 from kyulee1/ryujit8
Kyungwoo Lee [Thu, 21 Apr 2016 13:49:35 +0000 (06:49 -0700)]
Merge pull request #4469 from kyulee1/ryujit8

RyuJit Version Update

8 years agoRyuJit Version Update
Kyungwoo Lee [Thu, 21 Apr 2016 13:42:45 +0000 (06:42 -0700)]
RyuJit Version Update

8 years agoMerge pull request #4464 from Maoni0/docfix
Jan Kotas [Thu, 21 Apr 2016 06:05:24 +0000 (23:05 -0700)]
Merge pull request #4464 from Maoni0/docfix

added missing step in vs install

8 years agoadded missing step in vs install
Maoni Stephens [Thu, 21 Apr 2016 04:57:57 +0000 (21:57 -0700)]
added missing step in vs install

8 years agoFix empty perf map files generated by crossgen.
Brian Robbins [Thu, 21 Apr 2016 04:10:16 +0000 (21:10 -0700)]
Fix empty perf map files generated by crossgen.

8 years agoMerge pull request #4434 from briansull/struct16-abi
Brian Sullivan [Thu, 21 Apr 2016 01:28:04 +0000 (18:28 -0700)]
Merge pull request #4434 from briansull/struct16-abi

ARM64 Work Item 3817, 3524 - Struct16 decomposition

8 years agoMerge pull request #4449 from pgavlin/JitBuildName
Pat Gavlin [Thu, 21 Apr 2016 00:34:45 +0000 (17:34 -0700)]
Merge pull request #4449 from pgavlin/JitBuildName

Change the names of the JIT products to `clrjit`.

8 years agoMerge pull request #4427 from AndyAyersMS/InlineSizeAccumulation
Andy Ayers [Wed, 20 Apr 2016 23:04:18 +0000 (16:04 -0700)]
Merge pull request #4427 from AndyAyersMS/InlineSizeAccumulation

Inliner: estimate overall code size impact

8 years agoChange the names of the JIT products to `clrjit`.
Pat Gavlin [Wed, 20 Apr 2016 22:31:53 +0000 (15:31 -0700)]
Change the names of the JIT products to `clrjit`.

- The static library to be linked into the CLR is now
  `clrjit_static`
- The static library to be linked into crossgen is now
  `clrjit_crossgen`
- The dynamic library is now `clrjit`

8 years agoMerge pull request #4443 from jkotas/gitignore
Jan Kotas [Wed, 20 Apr 2016 18:25:33 +0000 (11:25 -0700)]
Merge pull request #4443 from jkotas/gitignore

Add *.VC.db to .gitignore

8 years ago ARM64 Work Item 3817, 3524 - Struct16 decomposition
Brian Sullivan [Tue, 19 Apr 2016 18:02:32 +0000 (11:02 -0700)]
ARM64 Work Item 3817, 3524 - Struct16 decomposition

    Changes to support passing of MultiReg structs using GT_LISTs
    Optional support for  struct promotion for multireg structs:
    To enable set  FEATURE_MULTIREG_STRUCT_PROMOTE to 1
    Morphs the 16-byte structs at the end of fgMorphArgs
    Careful refactoring to avoid changes to UNIX_AMD64 code
    Covers all of the 16-byte struct expansion cases in fgMorph
    Added function header comments
    Passing the tests for Arm64
    No AsmDiffs for non-Arm64 targets.
    Codegen uses Contained nodes for PUTARG_STK 16-byte stack args
    Created a genPutArgStk method for Arm64
    Updated Tests.lst with 16 additional passing tests

8 years agoMerge pull request #4425 from kyulee1/cleantest2
Kyungwoo Lee [Wed, 20 Apr 2016 18:04:39 +0000 (11:04 -0700)]
Merge pull request #4425 from kyulee1/cleantest2

ARM64: Another round of clean-up Tests.lst

8 years agoInliner: estimate overall code size impact
Andy Ayers [Tue, 19 Apr 2016 18:34:06 +0000 (11:34 -0700)]
Inliner: estimate overall code size impact

Accumulate the per-inline size impact estimates into an overall inline
size impact estimate. No size budgeting (yet); this just provides data
for further study.

8 years agoMerge pull request #4396 from pgavlin/AMD64UnwindHeader
Pat Gavlin [Wed, 20 Apr 2016 17:21:01 +0000 (10:21 -0700)]
Merge pull request #4396 from pgavlin/AMD64UnwindHeader

Define the AMD64 unwind codes in their own header.

8 years agoMerge pull request #4439 from kyulee1/winonly
Kyungwoo Lee [Wed, 20 Apr 2016 16:58:17 +0000 (09:58 -0700)]
Merge pull request #4439 from kyulee1/winonly

ARM64: CI triggered by Push for Windows only

8 years agoAdd *.VC.db to .gitignore
Jan Kotas [Wed, 20 Apr 2016 16:42:05 +0000 (09:42 -0700)]
Add *.VC.db to .gitignore

8 years agoMerge pull request #4397 from RussKeldorph/reenable
Russ Keldorph [Wed, 20 Apr 2016 16:18:51 +0000 (09:18 -0700)]
Merge pull request #4397 from RussKeldorph/reenable

Reenable tests per #3664

8 years agoMerge pull request #4416 from RussKeldorph/cs8002
Russ Keldorph [Wed, 20 Apr 2016 16:17:45 +0000 (09:17 -0700)]
Merge pull request #4416 from RussKeldorph/cs8002

Suppress CS8002 for JIT test projects

8 years agoMerge pull request #4377 from swaroop-sridhar/aagc1
Swaroop Sridhar [Wed, 20 Apr 2016 15:55:06 +0000 (08:55 -0700)]
Merge pull request #4377 from swaroop-sridhar/aagc1

ARM64: Fix GC encoding settings

8 years agoMerge pull request #4433 from krytarowski/netbsd-support-69
Jan Vorlicek [Wed, 20 Apr 2016 14:44:45 +0000 (07:44 -0700)]
Merge pull request #4433 from krytarowski/netbsd-support-69

Fix issue building mscorlib.dll

8 years agoARM64: CI triggered by Push for Windows only
Kyungwoo Lee [Wed, 20 Apr 2016 13:09:31 +0000 (06:09 -0700)]
ARM64: CI triggered by Push for Windows only

8 years agoMerge pull request #4418 from rahku/arm64EnableCrossgen
Rahul Kumar [Wed, 20 Apr 2016 05:40:03 +0000 (22:40 -0700)]
Merge pull request #4418 from rahku/arm64EnableCrossgen

Enable running crossgen as part of arm64 build

8 years agoMerge pull request #3879 from manu-silicon/xplat
Jan Kotas [Wed, 20 Apr 2016 04:58:26 +0000 (21:58 -0700)]
Merge pull request #3879 from manu-silicon/xplat

Enable XplatEventLogger on all non-Windows platforms

8 years agoMerge pull request #4405 from yizhang82/delegate_fix
Jan Kotas [Wed, 20 Apr 2016 03:20:32 +0000 (20:20 -0700)]
Merge pull request #4405 from yizhang82/delegate_fix

Fix SysV calling convention bug in interop. We need to treat delegate…

8 years agoMerge pull request #4387 from brianrob/ngenrundown
Brian Robbins [Wed, 20 Apr 2016 02:39:12 +0000 (19:39 -0700)]
Merge pull request #4387 from brianrob/ngenrundown

Add support for ready to run to NGEN rundown

8 years agoCast function pointer to void*
Kamil Rytarowski [Wed, 20 Apr 2016 01:57:28 +0000 (03:57 +0200)]
Cast function pointer to void*

Fix issue building mscorlib.dll

/home/kamil/tmp/coreclr/src/vm/win32threadpool.cpp:2672:13: error: no matching function for call to 'FireEtwThreadPoolIOEnqueue'
            FireEtwThreadPoolIOEnqueue((LPOVERLAPPED)waitInfo, Callback, (dwFlag & WAIT_SINGLE_EXECUTION) == 0, reinterpret_cast<void*>(GetClrInstanceId()));
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kamil/tmp/coreclr/bin/obj/Linux.x64.Debug/src/inc/clretwallmain.h:972:14: note: candidate function not viable: no known conversion from
      'WAITORTIMERCALLBACK' (aka 'void (*)(void *, unsigned char)') to 'const void *' for 2nd argument; take the address of the argument with &
inline ULONG FireEtwThreadPoolIOEnqueue(
             ^
/home/kamil/tmp/coreclr/src/vm/win32threadpool.cpp:3236:13: error: no matching function for call to 'FireEtwThreadPoolIODequeue'
            FireEtwThreadPoolIODequeue(waitInfo, waitInfo->Callback, reinterpret_cast<void*>(GetClrInstanceId()));
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kamil/tmp/coreclr/bin/obj/Linux.x64.Debug/src/inc/clretwallmain.h:985:14: note: candidate function not viable: no known conversion from
      'WAITORTIMERCALLBACK' (aka 'void (*)(void *, unsigned char)') to 'const void *' for 2nd argument; take the address of the argument with &
inline ULONG FireEtwThreadPoolIODequeue(
             ^

Reported on Ubuntu-14.04.2 LTS with clang 3.8.0

8 years agoMerge pull request #4423 from Priya91/osxcorefx
Lakshmi Priya [Wed, 20 Apr 2016 01:47:05 +0000 (18:47 -0700)]
Merge pull request #4423 from Priya91/osxcorefx

Reflect osx innerloop changes from corefx.

8 years agoARM64: Another round of clean-up Tests.lst
Kyungwoo Lee [Tue, 19 Apr 2016 22:38:45 +0000 (15:38 -0700)]
ARM64: Another round of clean-up Tests.lst

- Removed UNREACHED category completely
- Tag more issues to failure cases

8 years agoReflect osx innerloop changes from corefx.
Lakshmi Priya Sekar [Tue, 19 Apr 2016 22:32:22 +0000 (15:32 -0700)]
Reflect osx innerloop changes from corefx.

8 years agoMerge pull request #4414 from kyulee1/cleantest
Kyungwoo Lee [Tue, 19 Apr 2016 22:12:04 +0000 (15:12 -0700)]
Merge pull request #4414 from kyulee1/cleantest

ARM64: Clean Up Tests.lst

8 years agoEnable running crossgen as part of arm64 build
Rahul Kumar [Tue, 19 Apr 2016 14:52:22 +0000 (07:52 -0700)]
Enable running crossgen as part of arm64 build

8 years agoARM64: Fix GC encoding settings
Swaroop Sridhar [Fri, 15 Apr 2016 22:04:40 +0000 (15:04 -0700)]
ARM64: Fix GC encoding settings

This change fixes certain settings in the GCInfo encoder/decoders.
It also fixes the debug info for the stack pointer.

8 years agoARM64: Clean Up Tests.lst
Kyungwoo Lee [Tue, 19 Apr 2016 18:11:03 +0000 (11:11 -0700)]
ARM64: Clean Up Tests.lst

- Remove all the issue tags that are resolved, or correct the issue number.
- Try to move UNSTABLE to either EXPECTED_PASS or EXPECTED_FAIL.
- Delete security transparency tests unavailable in .NET Core -- NonVirtualCall/OverwriterArray

8 years agoMerge pull request #4415 from mmitche/update-ubuntu-deps
Matt Mitchell [Tue, 19 Apr 2016 19:55:50 +0000 (12:55 -0700)]
Merge pull request #4415 from mmitche/update-ubuntu-deps

Update coreclr dependencies

8 years agoSuppress CS8002 for JIT test projects
Russ Keldorph [Tue, 19 Apr 2016 18:27:19 +0000 (11:27 -0700)]
Suppress CS8002 for JIT test projects

"Referenced assembly 'Foo, ...' does not have a strong name."

Happens when a .csproj has a ProjectReference for a .ilproj.  It's not
particularly interesting to give these test assemblies strong names, so
I'm just suppressing the warning.

Fixes #4232
Fixes #4233
Fixes #4234
Fixes #4235
Fixes #4236
Fixes #4237

8 years agoUpdate coreclr dependencies
Matt Mitchell [Tue, 19 Apr 2016 18:26:47 +0000 (11:26 -0700)]
Update coreclr dependencies

8 years agoFix SysV calling convention bug in interop. We need to treat delegate field (NFT_DELE...
Yi Zhang (CLR) [Tue, 19 Apr 2016 07:32:10 +0000 (00:32 -0700)]
Fix SysV calling convention bug in interop. We need to treat delegate field (NFT_DELEGATE) as INTEGER (as per SysV spec) since it is marshaled as a function pointer, otherwise we would end up passing it via stack which would cause all sorts of badness. Same for SAFEHANDLE/CRITICALHANDLE. It's not clear to me what the right semantics for DATE/CURRENCY is but they are Windows-only types, so we probably don't care yet.
This fixes MarshalStructAsLayoutSeq test on mac/linux.

8 years agoMerge pull request #4374 from AndyAyersMS/CheckToolRestore
Andy Ayers [Tue, 19 Apr 2016 06:21:02 +0000 (23:21 -0700)]
Merge pull request #4374 from AndyAyersMS/CheckToolRestore

Detect if powershell version is suitable for restoring build tools

8 years agoEnable XplatEventLogger on all non-Windows platforms
Manu [Mon, 28 Mar 2016 01:47:28 +0000 (10:47 +0900)]
Enable XplatEventLogger on all non-Windows platforms

Because on non-Windows platform, we assume event tracing, we also requires
it to compile native code for non-Windows platform.
Event tracing is only enabled on AMD64 devices for now on Unix platforms.

8 years agoAdd support for ready to run to NGEN rundown.
Brian Robbins [Sun, 17 Apr 2016 21:56:12 +0000 (14:56 -0700)]
Add support for ready to run to NGEN rundown.

8 years agoMerge pull request #4349 from rahku/master
Rahul Kumar [Tue, 19 Apr 2016 05:18:43 +0000 (22:18 -0700)]
Merge pull request #4349 from rahku/master

enable build of cross target components.
This enables the build of following cross target components:
 1. crossgen
 2. mscordacore.dll
 3. sos.dll
 4. mscordbi.dll
 This is currently only enabled for arm64 and generates x64 binaries. For cross builds it uses the same hierarchy of cmake files from source root folder. At the end of build, build calls cmake again to generate solution for cross build specifying both host & target arch. This PR adds host & target arch configuration in cmake. I decided to reuse CLR_CMAKE_PLATFORM_ARCH_* to be as the host arch and CLR_CMAKE_TARGET_ARCH_* to be as target arch. For non-cross builds they are one and same and differ in cross builds. I have also refactored root CMakeLists.txt into smaller files. Binaries for cross builds are placed at bin\product<OS.Arch.Type><hostArch> (eg for arm64 they will be at bin\product\OS.arm64.debug\x64)

8 years agoenable build of cross target components.
Rahul Kumar [Tue, 12 Apr 2016 21:40:23 +0000 (14:40 -0700)]
enable build of cross target components.
Currently only enabled for arm64

8 years agoMerge pull request #3915 from hughbe/region-info-params
Jan Kotas [Tue, 19 Apr 2016 04:54:30 +0000 (21:54 -0700)]
Merge pull request #3915 from hughbe/region-info-params

Add parameter names to RegionInfo constructor

8 years agoMerge pull request #3535 from hughbe/patch-3
Jan Kotas [Tue, 19 Apr 2016 04:53:06 +0000 (21:53 -0700)]
Merge pull request #3535 from hughbe/patch-3

Add parameter names to ArgumentExceptions in Guid

8 years agoMerge pull request #4247 from leemgs/upstream-cross-toolchain-unify2
Jan Kotas [Tue, 19 Apr 2016 04:50:56 +0000 (21:50 -0700)]
Merge pull request #4247 from leemgs/upstream-cross-toolchain-unify2

Linux/ARM: Unifying the redundant usages of objcopy

8 years agoMerge pull request #4283 from krytarowski/netbsd-support-61
Jan Kotas [Tue, 19 Apr 2016 04:41:33 +0000 (21:41 -0700)]
Merge pull request #4283 from krytarowski/netbsd-support-61

Implement GetEntrypointExecutableAbsolutePath() on NetBSD

8 years agoMerge pull request #4371 from krytarowski/netbsd-support-65
Jan Kotas [Tue, 19 Apr 2016 04:38:47 +0000 (21:38 -0700)]
Merge pull request #4371 from krytarowski/netbsd-support-65

Add NetBSD support in dir.props

8 years agoMerge pull request #4348 from AndyAyersMS/FixPerfMapAV
Jan Kotas [Tue, 19 Apr 2016 04:38:14 +0000 (21:38 -0700)]
Merge pull request #4348 from AndyAyersMS/FixPerfMapAV

Fix a segfault in perf map generation

8 years agoMerge pull request #4373 from krytarowski/netbsd-support-67
Jan Kotas [Tue, 19 Apr 2016 04:37:40 +0000 (21:37 -0700)]
Merge pull request #4373 from krytarowski/netbsd-support-67

NetBSD: Assume GNU GCC compatible va_list in Clang/LLVM

8 years agoMerge pull request #4401 from dotnet-bot/from-tfs
Jan Kotas [Tue, 19 Apr 2016 04:33:44 +0000 (21:33 -0700)]
Merge pull request #4401 from dotnet-bot/from-tfs

Merge changes from TFS

8 years agoMerge pull request #4312 from mjsabby/muks/enable_rejit_xplat
noahfalk [Tue, 19 Apr 2016 01:40:33 +0000 (18:40 -0700)]
Merge pull request #4312 from mjsabby/muks/enable_rejit_xplat

Enable ReJIT on all platforms

8 years agoMerge pull request #4392 from kyulee1/fixround
Kyungwoo Lee [Tue, 19 Apr 2016 01:37:52 +0000 (18:37 -0700)]
Merge pull request #4392 from kyulee1/fixround

ARM64: Fix Round Operation

8 years agoARM64: Fix Round Operation
Kyungwoo Lee [Mon, 18 Apr 2016 17:42:51 +0000 (10:42 -0700)]
ARM64: Fix Round Operation

Math.Round is implemented as a target intrinsic for Arm64.
JIT emitted `frinta` which rounds the ties to away.
As described in MSDN
https://msdn.microsoft.com/en-us/library/system.math.round(v=vs.110).aspx#Round2_Example,
we should round the ties to even.
So, I corrected `frintn` instruction instead for such intrinsic expansion.

I've also identified that `EvalMathFuncUnary` incorrectly folds the round
operation when the argument is constant at the compile time.
The logic itself is not the right semantic as described above in MSDN.
I made a separate helper function which is essentially a duplicate of
classlib. This is not Arm64 specific fix but applies to all other targets.
So, I just fixed it while I'm here.

8 years agoFix nidump to avoid crashing while working with Ready to Run images
John Chen [Mon, 18 Apr 2016 23:38:39 +0000 (16:38 -0700)]
Fix nidump to avoid crashing while working with Ready to Run images

[tfs-changeset: 1597064]

8 years agoMerge pull request #4394 from gkhanna79/VCRTArm64Fix
Rahul Kumar [Mon, 18 Apr 2016 22:58:44 +0000 (15:58 -0700)]
Merge pull request #4394 from gkhanna79/VCRTArm64Fix

Fix Arm64 break

8 years agoMerge pull request #4391 from RussKeldorph/buildarch
Russ Keldorph [Mon, 18 Apr 2016 22:24:14 +0000 (15:24 -0700)]
Merge pull request #4391 from RussKeldorph/buildarch

Build break: Replace $(Platform) with $(BuildArch) in arch-specific IL projects

8 years agoDefine the AMD64 unwind codes in their own header.
Pat Gavlin [Thu, 31 Mar 2016 20:08:37 +0000 (13:08 -0700)]
Define the AMD64 unwind codes in their own header.

This matches the CFI unwind codes and allows the JIT to be more
precise about its includes.

8 years agoReenable tests
Russ Keldorph [Mon, 18 Apr 2016 20:43:54 +0000 (13:43 -0700)]
Reenable tests

8 years agoMerge pull request #4390 from pgavlin/JitCleanup
Pat Gavlin [Mon, 18 Apr 2016 20:06:30 +0000 (13:06 -0700)]
Merge pull request #4390 from pgavlin/JitCleanup

Cleanup some minor JIT issues.

8 years agoFix Arm64 break
Gaurav Khanna [Mon, 18 Apr 2016 19:49:49 +0000 (12:49 -0700)]
Fix Arm64 break

8 years agoMerge pull request #4370 from krytarowski/netbsd-support-64
Aditya Mandaleeka [Mon, 18 Apr 2016 19:36:53 +0000 (12:36 -0700)]
Merge pull request #4370 from krytarowski/netbsd-support-64

Print message about detected NetBSD

8 years agoMerge pull request #4378 from krytarowski/netbsd-support-68
Aditya Mandaleeka [Mon, 18 Apr 2016 19:36:27 +0000 (12:36 -0700)]
Merge pull request #4378 from krytarowski/netbsd-support-68

Implement GetProcessIdDisambiguationKey() for NetBSD

8 years agoMerge pull request #4323 from BruceForstall/CLRABI
Bruce Forstall [Mon, 18 Apr 2016 18:07:38 +0000 (11:07 -0700)]
Merge pull request #4323 from BruceForstall/CLRABI

Add CLR ABI document to Book of the Runtime

8 years agoAdd CLR ABI document to Book of the Runtime
Bruce Forstall [Wed, 13 Apr 2016 23:07:06 +0000 (16:07 -0700)]
Add CLR ABI document to Book of the Runtime

8 years agoReplace $(Platform) with $(BuildArch) in arch-specific IL projects
Russ Keldorph [Sat, 16 Apr 2016 15:03:50 +0000 (08:03 -0700)]
Replace $(Platform) with $(BuildArch) in arch-specific IL projects

I recently fixed some IL projects for non-x64 architectures, but I tested
the wrong property.  It appears that $(Platform) is set to AnyCpu, and
$(BuildArch) is what I want.

8 years agoStandardize on `assert` in the JIT.
Pat Gavlin [Mon, 11 Apr 2016 21:12:21 +0000 (14:12 -0700)]
Standardize on `assert` in the JIT.

A small amount of JIT code was using `_ASSERTE` instead of `assert`.
Change that code to use `assert` instead, which operates correctly
w.r.t. the JIT host.

8 years agoStanardize on `DEBUGARG` in the JIT.
Pat Gavlin [Mon, 11 Apr 2016 21:04:54 +0000 (14:04 -0700)]
Stanardize on `DEBUGARG` in the JIT.

The JIT uses both `DEBUGARG` (defined in jit.h) and `DEBUG_ARG`
(defined in /src/inc/check.h) for debug-only arguments. This
change replaces all uses of `DEBUG_ARG` with `DEBUGARG`.

8 years agoRemove uses of LP{,C}UTF8 in the JIT.
Pat Gavlin [Thu, 31 Mar 2016 19:44:53 +0000 (12:44 -0700)]
Remove uses of LP{,C}UTF8 in the JIT.

Replace these with the corresponding `char*` type.

8 years agoMerge pull request #4381 from gkhanna79/VCRTFix
Gaurav Khanna [Mon, 18 Apr 2016 17:27:55 +0000 (10:27 -0700)]
Merge pull request #4381 from gkhanna79/VCRTFix

Cleanup VCRuntime140.dll dependency from native components

8 years agoMerge pull request #3807 from CarolEidt/FirstClassStructsDoc
Carol Eidt [Mon, 18 Apr 2016 17:09:44 +0000 (10:09 -0700)]
Merge pull request #3807 from CarolEidt/FirstClassStructsDoc

Design document for first-class structs

8 years agoMerge pull request #4375 from AndyAyersMS/UseBudget
Andy Ayers [Mon, 18 Apr 2016 16:29:59 +0000 (09:29 -0700)]
Merge pull request #4375 from AndyAyersMS/UseBudget

Inliner: use time budget to avoid excessive inlining

8 years agoMerge pull request #4376 from pgavlin/GcInfoRemoveUtilcode
Pat Gavlin [Mon, 18 Apr 2016 16:02:17 +0000 (09:02 -0700)]
Merge pull request #4376 from pgavlin/GcInfoRemoveUtilcode

Stop including utilcode.h in the GC info encoder.

8 years agoImplement GetProcessIdDisambiguationKey() for NetBSD
Kamil Rytarowski [Sat, 16 Apr 2016 00:22:23 +0000 (02:22 +0200)]
Implement GetProcessIdDisambiguationKey() for NetBSD

Make use of the kvm(3) interface to get "struct kinfo_proc2" of the given
process.

struct kinfo_proc2 {
///....
        uint32_t p_ustart_sec;          /* STRUCT TIMEVAL: starting time. */
        uint32_t p_ustart_usec;         /* STRUCT TIMEVAL: starting time. */
///...
};

  --- /usr/include/sys/sysctl.h

8 years agoCleanup VCRuntime140.dll dependency from native components
Gaurav Khanna [Sat, 16 Apr 2016 17:15:08 +0000 (10:15 -0700)]
Cleanup VCRuntime140.dll dependency from native components

8 years agoMerge pull request #4360 from kyulee1/fixpsp
Kyungwoo Lee [Sat, 16 Apr 2016 17:05:36 +0000 (10:05 -0700)]
Merge pull request #4360 from kyulee1/fixpsp

ARM64: Fix Storing PSPSym for localloc

8 years agoARM64: Fix Storing PSPSym for localloc
Kyungwoo Lee [Fri, 15 Apr 2016 15:45:34 +0000 (08:45 -0700)]
ARM64: Fix Storing PSPSym for localloc

JIT incorrectly saves/restores PSPSym causing AVs in EH tests that have localloc with filter.
The fix is to use a right opcode (Load instead of Store) when saving PSPSym.

8 years agoMerge pull request #4357 from krytarowski/netbsd-support-63
Jan Vorlicek [Sat, 16 Apr 2016 01:05:14 +0000 (03:05 +0200)]
Merge pull request #4357 from krytarowski/netbsd-support-63

NetBSD: Add support for PAL_IsDebuggerPresent()

8 years agoDetect if powershell version is suitable for restoring build tools
Andy Ayers [Fri, 15 Apr 2016 21:03:46 +0000 (14:03 -0700)]
Detect if powershell version is suitable for restoring build tools

Powershell v3 or higher is required to decompress the build tools
bundle. Windows 7 typically has v2 installed.

Detect earlier versions and fail with a pointer to the
build prerequisites and a download link for an updated version.

Also propagate failures out of init-tools.cmd. The last step
of this is unchecked since the build tool init script can return
nonzero status even on success.

See #3510.

8 years agoMerge pull request #4346 from LLITCHEV/Issue4276
Lubomir Litchev [Sat, 16 Apr 2016 00:01:40 +0000 (17:01 -0700)]
Merge pull request #4346 from LLITCHEV/Issue4276

Set the lvIsMultiRegArgOrRet for a variable containing the result of in-lined multi-register return call.

8 years agoMerge pull request #4369 from mikedn/msgbox
Jan Kotas [Fri, 15 Apr 2016 23:58:36 +0000 (16:58 -0700)]
Merge pull request #4369 from mikedn/msgbox

Always try to load user32 instead of ntuser api set

8 years agoFix a segfault in perf map generation
Andy Ayers [Fri, 15 Apr 2016 01:49:25 +0000 (18:49 -0700)]
Fix a segfault in perf map generation

Make sure instance vars get initialized to nullptr.

8 years agoNetBSD: Assume GNU GCC compatible va_list in Clang/LLVM
Kamil Rytarowski [Fri, 15 Apr 2016 21:40:59 +0000 (23:40 +0200)]
NetBSD: Assume GNU GCC compatible va_list in Clang/LLVM

Retire unneeded __GNUC_VA_LIST as currently all platforms build with Clang.

8 years agoMerge pull request #4342 from ZhichengZhu/clrstackr
Jan Vorlicek [Fri, 15 Apr 2016 23:20:33 +0000 (01:20 +0200)]
Merge pull request #4342 from ZhichengZhu/clrstackr

add sos clrstack -r option

8 years agoMerge pull request #4368 from swgillespie/long-running-gc-fixes
Sean Gillespie [Fri, 15 Apr 2016 23:19:52 +0000 (16:19 -0700)]
Merge pull request #4368 from swgillespie/long-running-gc-fixes

Fix a difference in passing the sequential parameter between Bash and…

8 years agoStop including utilcode.h in the GC info encoder.
Pat Gavlin [Fri, 15 Apr 2016 22:35:33 +0000 (15:35 -0700)]
Stop including utilcode.h in the GC info encoder.

This required two other minor changes:
- A prototype for `ThrowOutOfMemory` is now defined in gcinfoencoder.h
- `BitArray` now defines an overload of `operator new` that accepts an
  `IAllocator`.

8 years agoMerge pull request #4372 from krytarowski/netbsd-support-66
Aditya Mandaleeka [Fri, 15 Apr 2016 22:45:07 +0000 (15:45 -0700)]
Merge pull request #4372 from krytarowski/netbsd-support-66

NetBSD has RAND_MAX = 0x7fffffff

8 years agoThe RAND_MAX value can vary by platform
Kamil Rytarowski [Fri, 15 Apr 2016 21:17:38 +0000 (23:17 +0200)]
The RAND_MAX value can vary by platform

Noted on NetBSD where it is 0x7FFFFFFF.

8 years agoInliner: use time budget to avoid excessive inlining
Andy Ayers [Fri, 15 Apr 2016 18:24:25 +0000 (11:24 -0700)]
Inliner: use time budget to avoid excessive inlining

Use the time budget and time estimates to stop inlining once the
overall jit time increase estimate for the method is 10x the initial
jit time estimate.

This is implemented as part of `LegacyPolicy` and so can impact
the current inline behavior.

The budget is intentionally set quite high so that it only kicks in
for very rare cases where the call tree below the root is deep and wide
with many small methods. In extended testing on desktop this limit
fires in exactly two cases, both HFA tests.

In CoreCLR tests 12 of the HFA tests hit this limit. I've added
a directed test case here that came from the original bug report.

Closes #2472.

8 years agoNetBSD: Add support for PAL_IsDebuggerPresent()
Kamil Rytarowski [Fri, 15 Apr 2016 11:23:31 +0000 (13:23 +0200)]
NetBSD: Add support for PAL_IsDebuggerPresent()

Reuse the kvm(3) interface to grab "struct kinfo_proc".

NAME
     kvm - kernel memory interface

LIBRARY
     Kernel Data Access Library (libkvm, -lkvm)

DESCRIPTION
     The kvm library provides a uniform interface for accessing kernel virtual
     memory images, including live systems and crash dumps.  Access to live
     systems is via /dev/mem while crash dumps can be examined via the core
     file generated by savecore(8).  The interface behaves identically in both
     cases.  Memory can be read and written, kernel symbol addresses can be
     looked up efficiently, and information about user processes can be
     gathered.

     kvm_open() is first called to obtain a descriptor for all subsequent
     calls

8 years agoMerge pull request #4347 from ramarag/zapnyi
Rama krishnan Raghupathy [Fri, 15 Apr 2016 21:52:11 +0000 (14:52 -0700)]
Merge pull request #4347 from ramarag/zapnyi

Removing NYI for ZapUnwindData

8 years agoAlways try to load user32 instead of ntuser api set
Mike Danes [Fri, 15 Apr 2016 20:53:31 +0000 (23:53 +0300)]
Always try to load user32 instead of ntuser api set

8 years agoMerge pull request #4140 from myungjoo/implement/4040
Jan Vorlicek [Fri, 15 Apr 2016 21:33:39 +0000 (23:33 +0200)]
Merge pull request #4140 from myungjoo/implement/4040

Implement StartUnwindingNativeFrames Linux/ARM

8 years agoMerge pull request #3240 from krytarowski/netbsd-support-50
Jan Kotas [Fri, 15 Apr 2016 21:18:17 +0000 (14:18 -0700)]
Merge pull request #3240 from krytarowski/netbsd-support-50

Fix issue unveiled on NetBSD: Add PAL__vsnprintf shadow in PAL