platform/upstream/coreclr.git
7 years agoMerge pull request #6486 from stephentoub/expose_updatevalue
Stephen Toub [Wed, 27 Jul 2016 16:05:15 +0000 (12:05 -0400)]
Merge pull request #6486 from stephentoub/expose_updatevalue

Expose SerializationInfo.UpdateValue for corefx

7 years agoExpose SerializationInfo.UpdateValue for corefx
Stephen Toub [Wed, 27 Jul 2016 14:24:06 +0000 (10:24 -0400)]
Expose SerializationInfo.UpdateValue for corefx

ObjectManager in corefx needs to access to SerializationInfo.UpdateValue, which is currently internal.  We don't need to expose UpdateValue in a public contract (which would necessitate adding it to desktop), but by making it public we can give corefx the functionality it needs without needing to move a whole bunch more down from corefx into the runtime.

7 years agoMerge pull request #6485 from stephentoub/iobjref_model
Stephen Toub [Wed, 27 Jul 2016 13:05:17 +0000 (09:05 -0400)]
Merge pull request #6485 from stephentoub/iobjref_model

Add IObjectReference to model.xml

7 years agoAdd IObjectReference to model.xml
Stephen Toub [Wed, 27 Jul 2016 11:12:47 +0000 (07:12 -0400)]
Add IObjectReference to model.xml

And expose a couple of missing properties on SerializationInfo in the mscorlib facade.

7 years agoMerge pull request #6467 from briansull/multireg-return2
Brian Sullivan [Wed, 27 Jul 2016 00:54:04 +0000 (17:54 -0700)]
Merge pull request #6467 from briansull/multireg-return2

Enable multireg returns on Arm64

7 years agoMerge pull request #6401 from AndyAyersMS/PropagateOptMethodFlags
Andy Ayers [Wed, 27 Jul 2016 00:42:37 +0000 (17:42 -0700)]
Merge pull request #6401 from AndyAyersMS/PropagateOptMethodFlags

Jit: fix issues with optMethodFlags

7 years agoMerge pull request #6418 from rahku/crossgen
Rahul Kumar [Tue, 26 Jul 2016 23:49:30 +0000 (16:49 -0700)]
Merge pull request #6418 from rahku/crossgen

Do not insert gcstress interrupt instruction at call to JIT_RareDisab…

7 years agoEnable multireg returns on Arm64
Brian Sullivan [Tue, 12 Jul 2016 20:52:20 +0000 (13:52 -0700)]
Enable multireg returns on Arm64

Added method IsMultiRegPassedType and updated IsMultiRegReturnType
Switched these methods to using getArgTypeForStruct and getReturnTypeForStruct
Removed IsRegisterPassable and used IsMultiRegReturned instead.
Converted lvIsMultiregStruct to use getArgTypeForStruct
Renamed varDsc->lvIsMultiregStruct() to compiler->lvaIsMultiregStruct(varDsc)
Skip calling getPrimitiveTypeForStruct when we have a struct larger than 8 bytes
Refactored ReturnTypeDesc::InitializeReturnType
Fixed missing SPK_ByReference case in InitializeReturnType
Fixes for RyiJIt x86 TYP_LONG return types and additional ARM64 work for full multireg support
Added ARM64 guard the uses of MAX_RET_MULTIREG_BYTES with FEATURE_MULTIREG_RET
Fixes for multireg returns in Arm64 Codegen
Added dumping of lvIsMultiRegArg and lvIsMultiRegRet in the assembly output
Added check and set of compFloatingPointUsed to InitializeStructReturnType
Fixes to handle JIT helper calls that say they return a TYP_STRUCT with no class handle available
Placed all of the second GC return reg under MULTIREG_HAS_SECOND_GC_RET ifdefs
Added the Arm64 VM changes from Rahul's PR 5175
Update getArgTypeForStruct for x86/arm32 so that it returns TYP_STRUCT for all pass by value cases
Fixes for the passing of 3,5,6 or 7 byte sized structs
Fix issue on ARM64 where we would back fill into x7 after passing a 16-byte struct on the stack
Implemented register shuffling for multi reg Call returns on Arm64
Fixed regression on Arm32 for struct args that are not multi regs
Updated Tests.Lst with 23 additional passing tests

Changes from codereview feedback

7 years agoMerge pull request #6481 from stephentoub/add_serialization_facade
Stephen Toub [Tue, 26 Jul 2016 22:58:03 +0000 (18:58 -0400)]
Merge pull request #6481 from stephentoub/add_serialization_facade

Add serialization primitives to mscorlib facade

7 years agoRewrite gtIsVtableAccess to avoid assert
Andy Ayers [Tue, 26 Jul 2016 21:19:20 +0000 (14:19 -0700)]
Rewrite gtIsVtableAccess to avoid assert

Calling `HasIndex` from `gtIsVtableAccess` can leads to asserts as the
underly code checks to see if the addressing sub-expressions are
contained. But earlyProp runs early enough that it is not concerned with
containment. The code just needs to verify that there is a ref type base
and no index. Rework the code to do the checks directly.

7 years agoAdd serialization primitives to mscorlib facade
Stephen Toub [Tue, 26 Jul 2016 21:11:39 +0000 (17:11 -0400)]
Add serialization primitives to mscorlib facade

7 years agoMerge pull request #6464 from russellhadley/HardenJitStartup
Russell C Hadley [Tue, 26 Jul 2016 19:38:40 +0000 (12:38 -0700)]
Merge pull request #6464 from russellhadley/HardenJitStartup

Harden stdout at startup

7 years agoHarden stdout at startup
rhadley [Mon, 25 Jul 2016 17:40:27 +0000 (10:40 -0700)]
Harden stdout at startup

Check the results of the dup call to ensure that we're working with
a valid file handle.  In the case where we aren't we leave the jitstdout
set to nullptr.

7 years agoMerge pull request #6473 from dotnet-bot/from-tfs
Jan Kotas [Tue, 26 Jul 2016 13:16:04 +0000 (06:16 -0700)]
Merge pull request #6473 from dotnet-bot/from-tfs

Merge changes from TFS

7 years agoMerge pull request #6472 from dotnet-bot/UpdateDependencies20160726051912
Gaurav Khanna [Tue, 26 Jul 2016 13:08:58 +0000 (06:08 -0700)]
Merge pull request #6472 from dotnet-bot/UpdateDependencies20160726051912

Updating External dependencies to beta-24326-00

7 years agoAddressing arm64 build break due to old compiler
Rama Krishnan Raghupathy [Tue, 26 Jul 2016 06:30:07 +0000 (23:30 -0700)]
Addressing arm64 build break due to old compiler

[tfs-changeset: 1619335]

7 years agoUpdating External dependencies to beta-24326-00
dotnet-bot [Tue, 26 Jul 2016 05:19:12 +0000 (05:19 +0000)]
Updating External dependencies to beta-24326-00

7 years agoFix copy check condition for native interop test library. (#6468)
Sung-Jae Lee [Tue, 26 Jul 2016 04:09:36 +0000 (13:09 +0900)]
Fix copy check condition for native interop test library. (#6468)

7 years agoLinux/ARM: Fix +3000 bus errors of unit-test in case of O2/O3 levels (#6379)
Geunsik Lim [Tue, 26 Jul 2016 03:59:47 +0000 (12:59 +0900)]
Linux/ARM: Fix +3000 bus errors of unit-test in case of O2/O3 levels (#6379)

**PROBLEM**
This patch is to resolve +3000 bus errors that are generated whenever we use
the aggressive optimization levels of clang (issue #5844 ).

When we enable the -O3 optimization level of the clang version(from clang 3.5
to clang 3.9(snapshot)), we have always got the lots of bus errors from the
coreCLR's unit tests. Actually, we can easily monitor SIGBUS signals (e.g.,
"misaligned memory access") with /proc/cpu/alignment facility in kernel space.
Using "echo 2 > /proc/cpu/alignment" makes Linux kernel fixes the problems
but the performance of the application will be degraded.
.source: http://lxr.free-electrons.com/source/Documentation/arm/mem_alignment

**VERSION 4**
. Use 'GET_UNALIGNED_VALXXX' macros in the CoreClr infra-structure without
  any need for ifdefs.

**VERSION 3**
.Apply this PR on only Linux/ARM for different system environment (Windows).

Here is .NET CI Report on Windows: Compile Error
error C2146: syntax error: missing ';' before identifier '__unaligned_int32'
(compiling source file D:\j\workspace\checked_windo---f6dc6fe4\src\jit\alloc.cpp)
[D:\j\workspace\checked_windo---f6dc6fe4\bin\obj\Windows_NT.x64.Checked\src\jit\
crossgen\clrjit_crossgen.vcxproj] Indication 1

**VERSION 2**
.Add UNALIGNED_ARM macro for handling ARM core specific optimization levels.
.Add RISC-based ARM core handling into the existing infra-structure of the
platform adaptation layer (PAL) for aggressive optimization cases on Linux/ARM.

**VERSION 1**
Basically, RISC-based ARM architecture requires aligned access with 4byte reads.
In order to support aggressive optimization levels such as O2/O3, let's use
attribute keyword of aligned(1) instead of using memcpy(2) in into
a properly aligned buffer or the packing attribute.

**BACKGROUND**
According to ARM information center(infocenter.arm.com), By default,
the ARM compiler expects normal C and C++ pointers to point
to an aligned word in memory. A type qualifier __packed is provided to
enable unaligned pointer access. If you want to define a pointer to a word
that can be at any address (that is, that can be at a non-natural alignment),
you must specify this using the __packed qualifier when defining the pointer:
__packed int *pi; // pointer to unaligned int

However, clang/llvm does not support the __packed qualifier such as
__attribute__((packed)) or __attribute__((packed, aligned(4)))

In -O0 (debug build) the innermost block is emitted as the following assembly,
which works properly:
 ldr r1, [r0, #24]
 ldr r2, [r0, #20]

In -O3 (release build) however the compiler realizes these fields are adjacent
and generates this assembly:
 ldrdeq  r2, r3, [r0, #20]
Unfortunately, vldr/ldrdb instructions always generate an alignment fault
(in practice). It seems that clang uses ldrb instruction although GCC uses
ldr instruction because armv7 supports unaligned ldr instruction.

Note: If some arm architectures (e.g., Linux/ARM Emulator) does not support
unaligned ldr, this issue is not generated with aggressive optimization
levels (e.g., -O2 and -O3).

* Case study: How does the ARM Compiler support unaligned accesses?
  http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15414.html

* Case study: Indicating unaligned access to Clang for ARM compatibility
  http://stackoverflow.com/questions/9185811/indicating-unaligned-access-to-clang-for-arm-compatibility

* Case study: Chromium source for UnalignedLoad32() on ARM
  https://github.com/nwjs/chromium.src/blob/nw15/third_party/cld/base/basictypes.h#L302

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
7 years agoMerge pull request #6328 from ramarag/arm64debugger
Rama krishnan Raghupathy [Tue, 26 Jul 2016 03:36:53 +0000 (20:36 -0700)]
Merge pull request #6328 from ramarag/arm64debugger

Implementing Arm64 Debugger Requirements

7 years agoDo not insert gcstress interrupt instruction at call to JIT_RareDisableHelper
Rahul Kumar [Fri, 22 Jul 2016 19:48:55 +0000 (12:48 -0700)]
Do not insert gcstress interrupt instruction at call to JIT_RareDisableHelper

7 years agoArm64: Debugger
Rama Krishnan Raghupathy [Tue, 19 Jul 2016 02:40:05 +0000 (19:40 -0700)]
Arm64: Debugger

    Instruction emulation for Break Points
    Debugger::FuncEvalSetup
    NativeWalker
    ExceptionHijack
    Exception intercept
    Managed Return Value

7 years agoMerge pull request #6156 from justinvp/activitytracker_tostring
Vance Morrison [Mon, 25 Jul 2016 22:06:45 +0000 (15:06 -0700)]
Merge pull request #6156 from justinvp/activitytracker_tostring

Avoid string concat array allocation in ActivityTracker

7 years agoMerge pull request #6158 from justinvp/tracing_stringcomparison
Vance Morrison [Mon, 25 Jul 2016 22:00:29 +0000 (15:00 -0700)]
Merge pull request #6158 from justinvp/tracing_stringcomparison

Specify StringComparison.Ordinal in System.Diagnostics.Tracing

7 years agoMerge pull request #6461 from stephentoub/update_buildtools
Stephen Toub [Mon, 25 Jul 2016 19:49:17 +0000 (15:49 -0400)]
Merge pull request #6461 from stephentoub/update_buildtools

Update BuildTools to 1.0.26-prerelease-00625-01

7 years agoUpdate BuildTools to 1.0.26-prerelease-00625-01
Stephen Toub [Mon, 25 Jul 2016 16:16:01 +0000 (12:16 -0400)]
Update BuildTools to 1.0.26-prerelease-00625-01

7 years agoMerge pull request #6456 from dotnet-bot/UpdateDependencies20160725083514
Gaurav Khanna [Mon, 25 Jul 2016 13:23:59 +0000 (06:23 -0700)]
Merge pull request #6456 from dotnet-bot/UpdateDependencies20160725083514

Updating CoreClr dependencies to beta-24325-02

7 years agoMerge pull request #6453 from dotnet-bot/UpdateDependencies20160725061810
Gaurav Khanna [Mon, 25 Jul 2016 13:23:29 +0000 (06:23 -0700)]
Merge pull request #6453 from dotnet-bot/UpdateDependencies20160725061810

Updating External dependencies to beta-24325-00

7 years ago[Documentation] Projects Use licences (#6442)
Shahid Khan [Mon, 25 Jul 2016 13:07:15 +0000 (18:07 +0500)]
[Documentation] Projects Use licences (#6442)

address feedback

7 years agoUpdating CoreClr dependencies to beta-24325-02
dotnet-bot [Mon, 25 Jul 2016 08:35:13 +0000 (08:35 +0000)]
Updating CoreClr dependencies to beta-24325-02

7 years agoUpdating External dependencies to beta-24325-00
dotnet-bot [Mon, 25 Jul 2016 06:18:10 +0000 (06:18 +0000)]
Updating External dependencies to beta-24325-00

7 years agoMerge pull request #6449 from dotnet-bot/UpdateDependencies20160725123214
Gaurav Khanna [Mon, 25 Jul 2016 04:19:33 +0000 (21:19 -0700)]
Merge pull request #6449 from dotnet-bot/UpdateDependencies20160725123214

Updating CoreClr dependencies to beta-24325-01

7 years agoMerge pull request #6342 from BruceForstall/tailcall
Bruce Forstall [Mon, 25 Jul 2016 04:13:19 +0000 (21:13 -0700)]
Merge pull request #6342 from BruceForstall/tailcall

RyuJIT/x86: implement tailcall via helper

7 years agoUpdating CoreClr dependencies to beta-24325-01
dotnet-bot [Mon, 25 Jul 2016 00:32:14 +0000 (00:32 +0000)]
Updating CoreClr dependencies to beta-24325-01

7 years agoMerge pull request #6445 from dotnet-bot/UpdateDependencies20160724042519
Gaurav Khanna [Sun, 24 Jul 2016 21:39:06 +0000 (14:39 -0700)]
Merge pull request #6445 from dotnet-bot/UpdateDependencies20160724042519

Updating CoreClr dependencies to beta-24324-03

7 years agoUpdating CoreClr dependencies to beta-24324-03
dotnet-bot [Sun, 24 Jul 2016 16:25:19 +0000 (16:25 +0000)]
Updating CoreClr dependencies to beta-24324-03

7 years agoMerge pull request #6443 from dotnet-bot/UpdateDependencies20160724082829
Gaurav Khanna [Sun, 24 Jul 2016 13:49:17 +0000 (06:49 -0700)]
Merge pull request #6443 from dotnet-bot/UpdateDependencies20160724082829

Updating CoreClr dependencies to beta-24324-02

7 years agoFix up for grabs issues link in contributing workflow doc (#6437)
Oleg Demchenko [Sun, 24 Jul 2016 12:08:51 +0000 (09:08 -0300)]
Fix up for grabs issues link in contributing workflow doc (#6437)

Current link to up for grabs issues for CoreCLR repository leads
to the empty list because there's not such label as "up for grabs"
(existing label name is "up-for-grabs"). Ideally both CoreCLR
and CoreFX repos should use exactly the same label for public
issues to avoid possible mistakes.

7 years agoUpdating CoreClr dependencies to beta-24324-02
dotnet-bot [Sun, 24 Jul 2016 08:28:29 +0000 (08:28 +0000)]
Updating CoreClr dependencies to beta-24324-02

7 years agoRyuJIT/x86: implement tailcall via helper
Bruce Forstall [Thu, 14 Jul 2016 15:06:25 +0000 (08:06 -0700)]
RyuJIT/x86: implement tailcall via helper

Fixes #4185

Also: (1) added a class to simplify non-standard arg handling in fgMorphArgs(),
(2) fixed minor tree output alignment bug.

7 years agoMerge pull request #6425 from weshaggard/UpdateMscorlibFacadeToUseRewrittenCoreLib
Stephen Toub [Sat, 23 Jul 2016 20:49:42 +0000 (13:49 -0700)]
Merge pull request #6425 from weshaggard/UpdateMscorlibFacadeToUseRewrittenCoreLib

Update mscorlib facade to use the rewritten S.P.CoreLib

7 years agoFix #6125 (#6432)
Martin Woodward [Sat, 23 Jul 2016 16:39:34 +0000 (09:39 -0700)]
Fix #6125 (#6432)

Add reference for Bit Twiddling Hacks

7 years agoGC update from CoreRT (#6429)
Jan Kotas [Sat, 23 Jul 2016 14:23:21 +0000 (07:23 -0700)]
GC update from CoreRT (#6429)

https://github.com/dotnet/corert/tree/master/src/Native/gc 91d7a9c8e2b393314422b6106adedec683c0ae51

7 years agoAdd link to https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord (#6430)
Jan Kotas [Sat, 23 Jul 2016 14:13:22 +0000 (07:13 -0700)]
Add link to https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord (#6430)

7 years agoMerge pull request #6428 from dotnet-bot/UpdateDependencies20160723082720
Gaurav Khanna [Sat, 23 Jul 2016 13:17:11 +0000 (06:17 -0700)]
Merge pull request #6428 from dotnet-bot/UpdateDependencies20160723082720

Updating CoreClr dependencies to beta-24323-02

7 years agoThe call to printf expects a string argument, but the actual argument was of class...
vinnyrom [Sat, 23 Jul 2016 11:46:50 +0000 (04:46 -0700)]
The call to printf expects a string argument, but the actual argument was of class type 'PathString'. (#6422)

8 years agoUpdating CoreClr dependencies to beta-24323-02
dotnet-bot [Sat, 23 Jul 2016 08:27:20 +0000 (08:27 +0000)]
Updating CoreClr dependencies to beta-24323-02

8 years agoUpdate mscorlib facade to use the rewritten S.P.CoreLib
Wes Haggard [Sat, 23 Jul 2016 05:38:43 +0000 (22:38 -0700)]
Update mscorlib facade to use the rewritten S.P.CoreLib

Indirectly we were building the mscorlib facade against the
pre-rewritten S.P.CoreLib which had more types in it that weren't
present after we rewrote the assembly. This change forces the
TargetPath to be the final output for S.P.CoreLib so the ProjectReference
pulls in the correct assembly and will give errors if there are
missing types when generating the facade.

ICloneable and and ResolveEventHandler were missing so including
those in the model.xml file.

8 years agoMerge pull request #6415 from joperezr/ExposeISerializableDatetime
Stephen Toub [Sat, 23 Jul 2016 02:20:07 +0000 (19:20 -0700)]
Merge pull request #6415 from joperezr/ExposeISerializableDatetime

Exposing ISerializable implementation in System.DateTime

8 years agoMerge pull request #6414 from dotnet-bot/UpdateDependencies20160722044814
Gaurav Khanna [Sat, 23 Jul 2016 01:23:34 +0000 (18:23 -0700)]
Merge pull request #6414 from dotnet-bot/UpdateDependencies20160722044814

Updating CoreClr dependencies to beta-24322-04

8 years agoMerge pull request #6417 from swaroop-sridhar/contract
Swaroop Sridhar [Fri, 22 Jul 2016 23:09:56 +0000 (16:09 -0700)]
Merge pull request #6417 from swaroop-sridhar/contract

GetGcInfo(): Add a missing contract declaration

8 years agoGetGcInfo(): Add a missing contract declaration
Swaroop Sridhar [Fri, 22 Jul 2016 20:34:08 +0000 (13:34 -0700)]
GetGcInfo(): Add a missing contract declaration

8 years agoUpdating CoreClr dependencies to beta-24322-04
dotnet-bot [Fri, 22 Jul 2016 16:48:14 +0000 (16:48 +0000)]
Updating CoreClr dependencies to beta-24322-04

8 years agoExposing ISerializable implementation in System.DateTime
Jose Perez Rodriguez [Fri, 22 Jul 2016 16:48:10 +0000 (09:48 -0700)]
Exposing ISerializable implementation in System.DateTime

8 years agoCreate CONTRIBUTING.md (#6386)
Rich Lander [Fri, 22 Jul 2016 15:29:25 +0000 (08:29 -0700)]
Create CONTRIBUTING.md (#6386)

This file exists in corefx and is an obvious file to look for. Making the two repos the same.

8 years agoARM-CI : Check a device is already mounted while mounting a device. (#6377)
Sujin Kim [Fri, 22 Jul 2016 10:04:55 +0000 (19:04 +0900)]
ARM-CI : Check a device is already mounted while mounting a device. (#6377)

Now ARM-CI makes building failure frequently with below messages.(#6329)

http://dotnet-ci.cloudapp.net/job/dotnet_coreclr/job/master/job/arm_emulator_cross_debug_ubuntu_prtest/559/console
00:01:27.252 + sudo umount /opt/linux-arm-emulator-root/dev
00:01:27.260 umount: /opt/linux-arm-emulator-root/dev: device is busy.
00:01:27.260 (In some cases useful info about processes that use
00:01:27.260 the device is found by lsof(8) or fuser(1))
00:01:27.265 Build step 'Execute shell' marked build as failure

I think ARM CI jobs have tried to unmount the same rootfs by an 'arm32_ci_script.sh' at the same time. (At this time, other jobs still are on running...)
So I suggest though the script is exited by any cases, the script would not run un-mounting.
But whenever CI is running and mounting a device, It will check the device is already mounted.

8 years agoMerge pull request #6399 from stephentoub/fix_typos
Stephen Toub [Fri, 22 Jul 2016 00:46:36 +0000 (17:46 -0700)]
Merge pull request #6399 from stephentoub/fix_typos

Fix build break when FEATURE_SERIALIZATION defined

8 years agoFix build break when FEATURE_SERIALIZATION defined
Stephen Toub [Fri, 22 Jul 2016 00:25:08 +0000 (17:25 -0700)]
Fix build break when FEATURE_SERIALIZATION defined

8 years agoMerge pull request #6367 from echesakov/StackAllocation
Egor Chesakov [Thu, 21 Jul 2016 23:51:50 +0000 (16:51 -0700)]
Merge pull request #6367 from echesakov/StackAllocation

Fix bug: inlinee did not copy inlinee bbFlags to caller bbFlags.

8 years agoJit: fix issues with optMethodFlags
Andy Ayers [Thu, 21 Jul 2016 07:34:25 +0000 (00:34 -0700)]
Jit: fix issues with optMethodFlags

Closes #6368.

optMethodFlags is a member field of the Compiler object. It is used
during importation to flag IR that might benefit from earlyProp, and
used in earlyProp to skip execution if nothing is flagged. However,
there were a number of issues with the implementation.

First, the value was never initialized. So in CHK/DBG builds, it would
get set to 0xFFFFFFFF by the default allocator fill. In RELEASE builds
the value would be randomly set. This randomness could easily lead to
nondeterministic codegen in RELEASE. More on this subsequently.

Second, the value was not propagated during inlining. So if interesting
constructs only entered the root method via inlines, they potentially
might not trigger earlyProp.

Third, not all interesting constructs were flagged.

The JIT ORs flag values into optMethodFlags as it imports constructs
that should trigger earlyProp. It also re-uses the same compiler instance
in most cases. So, relatively quickly, even in release, all the relevant
flags end up set and earlyProp will always be run. Hence the window
for observing the nondeterministic is was limited to the first few
methods jitted by each compiler instance.

So to sum up: in DBG/CHK, early prop always runs, regardless of need.
In RELEASE, it runs unpredictably for the first few methods, then always
runs, regardless of need.

To see the nondeterminism in RELEASE, early methods would have to be free
of interesting constructs but pull them in via inlining (or contain
interesting constructs not currently flagged as such during importation).
This set of circumstances is evidently rare enough that the nondeterminism
has not been noted. Also, it is quite unlikely to lead to bad codegen,
just missed opportunities.

We might have caught this if we had reliable RELEASE/CHK diffing ready;
see for instance #5063.

The fix is to initialize optMethodFlags to zero in compInit, and merge in
the inlinee's copy during fgInsertInlineeBlocks. Logging tracks when the
inlinee's copy causes a flag update.

This was tricky to test for diffs because in CHK all that should happen is
that we run earlyProp less often. So any diff in CHK is a missed case of
flagging during importation. I found once such case via SPMI where the array
index is a constant, and added constant indices to the flagging set.

Because I also set the block flag, this both caused earlyProp to run
and also look at that block; the latter has triggered a fair number of
diffs, almost all of them beneficial (0.42% improvement in SPMI), winners
outnumber losers by about 50:1.

A typical example of a diff is that the null check below is removed.

```asm
       mov      rcx, qword ptr [(reloc)]
       mov      edx, 4
       call     CORINFO_HELP_NEWARR_1_VC
**     mov      edx, dword ptr [rax+8]
       mov      byte  ptr [rax+16], 255
       mov      byte  ptr [rax+17], 254
```

With this change in place, earlyProp how runs selectively based on need in
all configurations. We're still running earlyProp in all the cases where it
can make a difference, and finding more improvements when it does run, but
we're not running it in cases where it can't.

8 years agoMerge pull request #6395 from adityamandaleeka/fix_shell_scripts
Aditya Mandaleeka [Thu, 21 Jul 2016 23:24:32 +0000 (16:24 -0700)]
Merge pull request #6395 from adityamandaleeka/fix_shell_scripts

Fix lexicographical compares of numeric values in a couple of scripts.

8 years agoMerge pull request #6300 from sejongoh/decompose_gt_ind
Sejong Oh [Thu, 21 Jul 2016 22:22:06 +0000 (15:22 -0700)]
Merge pull request #6300 from sejongoh/decompose_gt_ind

Decompose GT_IND for x86

8 years agoMerge pull request #6396 from adityamandaleeka/runtest_help_fix
Aditya Mandaleeka [Thu, 21 Jul 2016 21:12:14 +0000 (14:12 -0700)]
Merge pull request #6396 from adityamandaleeka/runtest_help_fix

Fix minor error in runtest help

8 years agoFix minor error in runtest help.
Aditya Mandaleeka [Thu, 21 Jul 2016 21:04:31 +0000 (14:04 -0700)]
Fix minor error in runtest help.

8 years agoFix lexicographical compares of numeric values.
Aditya Mandaleeka [Thu, 21 Jul 2016 20:55:29 +0000 (13:55 -0700)]
Fix lexicographical compares of numeric values.

8 years agoChange verbatim ELF.h and Dwarf.h LLVM headers to be able to build in CoreCLR +...
Evgeny Pavlov [Thu, 21 Jul 2016 18:18:46 +0000 (22:18 +0400)]
Change verbatim  ELF.h and Dwarf.h LLVM headers to be able to build in CoreCLR + add license header (#6389)

8 years agoMerge pull request #6277 from kyulee1/frageh
Kyungwoo Lee [Thu, 21 Jul 2016 17:17:18 +0000 (10:17 -0700)]
Merge pull request #6277 from kyulee1/frageh

ARM64: Enable Function Fragment

8 years agoMerge pull request #6375 from stephentoub/serialization_modelxml
Stephen Toub [Thu, 21 Jul 2016 17:02:40 +0000 (10:02 -0700)]
Merge pull request #6375 from stephentoub/serialization_modelxml

Expose serialization primitives from System.Private.Corelib

8 years ago[SOS][Linux] Fix incorrect processing 'setclrpath' command with portable PDB reader...
Evgeny Pavlov [Thu, 21 Jul 2016 16:52:10 +0000 (20:52 +0400)]
[SOS][Linux] Fix incorrect processing 'setclrpath' command with portable PDB reader (#6358)

* Fix incorrect processing 'setclrpath' command in lldb libsosplugin.so with portable PDB reader

* Replace 'fprintf' and 'perror' to 'ExtErr'

8 years agoRefactor GC background thread creation (#6384)
Jan Vorlicek [Thu, 21 Jul 2016 16:42:40 +0000 (18:42 +0200)]
Refactor GC background thread creation (#6384)

This change modifies the GCToEEInterface::CreateBackgroundThread so that it returns
a fully initialized and running thread.

8 years agoAdd ELF.h and Dwarf.h from LLVM for gdbjit feature implementation. (#6383)
Evgeny Pavlov [Thu, 21 Jul 2016 16:41:54 +0000 (20:41 +0400)]
Add ELF.h and Dwarf.h from LLVM for gdbjit feature implementation. (#6383)

Files were copied from http://llvm.org/git/llvm.git repo, commit: 8b47c17a53d683f313eaaa93c4a53de26d8fcba5

8 years agoifdef out CodeAccessPermission demand used in SerializationInfo on CoreCLR
Stephen Toub [Thu, 21 Jul 2016 15:29:59 +0000 (08:29 -0700)]
ifdef out CodeAccessPermission demand used in SerializationInfo on CoreCLR

It brings in an FCall not available on coreclr.

8 years agoMerge pull request #6385 from kyulee1/reemail
Kyungwoo Lee [Thu, 21 Jul 2016 15:06:17 +0000 (08:06 -0700)]
Merge pull request #6385 from kyulee1/reemail

ARM64: Reenable email notification

8 years agoARM64: Reenable email notification
Kyungwoo Lee [Thu, 21 Jul 2016 15:05:28 +0000 (08:05 -0700)]
ARM64: Reenable email notification

8 years agoExpose serialization primitives from System.Private.Corelib
Stephen Toub [Thu, 21 Jul 2016 04:46:55 +0000 (21:46 -0700)]
Expose serialization primitives from System.Private.Corelib

- Update the model.xml file to expose the serialization primitives from the runtime, e.g. [Serializable], [NonSerialized], ISerializable, etc.
- Tweak how FEATURE_SERIALIZATION is used on some types.  ISerializable and IDeserializationCallback are not ifdef'd based on FEATURE_SERIALIZATION, but their members are, which means there are some types which are implementing the interface but have the implementation of the interface's method ifdef'd.  This commit removes the ifdef'ing of the methods on the interface, and then ifdef's the implementation of the interface on the offending types.

8 years agoMerge pull request #6219 from adiaaida/compareLongs
Michelle McDaniel [Thu, 21 Jul 2016 13:41:33 +0000 (06:41 -0700)]
Merge pull request #6219 from adiaaida/compareLongs

Fix silent bad codegen in signed comparison

8 years agoRemove DBG GcInfo encoder/decoder (#6374)
Swaroop Sridhar [Thu, 21 Jul 2016 11:10:02 +0000 (04:10 -0700)]
Remove DBG GcInfo encoder/decoder (#6374)

This change removes the redundant set of GcInfo encoder/decoder
in the CoreCLR tree called Debug encoder/decoders.

These components are expected to be are well-tested versions
for verification, but are not actively used.
They cause additional overhead wrt maintaining two versions of
GcInfo encoder/decoder as GcInfo format changes.

8 years agoDocumentation: Add additional terminologies in the glossary.md (#6372)
Geunsik Lim [Thu, 21 Jul 2016 10:23:30 +0000 (19:23 +0900)]
Documentation: Add additional terminologies in the glossary.md (#6372)

It is a trivial patch. However, it will be helpful to developers that
learn the internals of CoreCLR via the source code and documents.

Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
8 years agoMerge pull request #6365 from jashook/arm32_umount
Jarret Shook [Thu, 21 Jul 2016 06:24:48 +0000 (23:24 -0700)]
Merge pull request #6365 from jashook/arm32_umount

More verbose logging for arm32 umount

8 years agoMore verbose logging for arm32 umount
jashook [Wed, 20 Jul 2016 22:04:38 +0000 (15:04 -0700)]
More verbose logging for arm32 umount

Umount fails occasionaly in the arm32 ci script. Add some logging
information using lsof before calling umount to diagnose which files are
open.

8 years agoMerge pull request #6297 from CarolEidt/MorphGenTreeRefactors
Carol Eidt [Thu, 21 Jul 2016 04:19:14 +0000 (21:19 -0700)]
Merge pull request #6297 from CarolEidt/MorphGenTreeRefactors

More Struct-related Refactorings

8 years agoMerge pull request #6325 from swaroop-sridhar/R2Rver
Swaroop Sridhar [Thu, 21 Jul 2016 04:11:30 +0000 (21:11 -0700)]
Merge pull request #6325 from swaroop-sridhar/R2Rver

GCInfo: Support versioning.

8 years agoGCInfo: Support versioning.
Swaroop Sridhar [Fri, 15 Jul 2016 07:41:30 +0000 (00:41 -0700)]
GCInfo: Support versioning.

This change enables the VM to support multiple versions GCInfo concurrently.
This is necessary in light of upcoming work to add ReturnType and other
modifications to the GCInfo format -- so that existing ReadyToRun images
will continue to run correctly.

The version# is not stored in the GcInfo structure -- because it is
wasteful to store the version once for every method. Instead, it is
tracked per range-section of generated/loaded methods.

The GCInfo version is computed as:
1) The current GCINFO_VERSION for JITted and Ngened images
2) A function of the Ready-to-run major version stored in READYTORUN_HEADER
   for ready-to-run images. ReadyToRunJitManager::JitTokenToGCInfoVersion()
   provides the GcInfo version for any Method. Currently, there's only one
   version of GCInfo.

An abstraction GCInfoToken is added to the GcInfo interface, which tracks the
{GcInfo, Version} pair in-memory. Several GcInfo APIs are
modified to use GCInfoToken in place of GcInfo pointers.

Notes:
1) SOS GcDump: The GCDump API has separate dump routines for Header and the
pointer-liveness information (DumpGCTable and DumpGCHeader) each of which
advance a pointer to the GCInfo block. These APIs are not changed to
recieve a GCInfoToken in place of the GcInfo block pointer. Instead, they
recieve the GcInfo version at the time of construction.
2) Some routines that are specific to x86 gcInfo (ex: crackMethodInfoHdr)
are not yet updated to use versioning, since the development plan is to
update the Non-x86 GcInfo structure first.
3) The x86 specific structs defining GcInfo headers are moved to GcInfoTypes.h,
along with the non-x86 GcInfo type definitions.

8 years agoRemove include of <utility> from seh.cpp (#6359)
Jan Vorlicek [Thu, 21 Jul 2016 00:37:26 +0000 (02:37 +0200)]
Remove include of <utility> from seh.cpp (#6359)

In my previous change that made exceptions smaller, I had `#include <utility>`
and I haven't realized that it pulls in some stl headers. That breaks build
on ARM.
The fix is to replace that include by defining just the std::move that's
all that was needed from the header.

8 years agoFix is_blittable partial specializations (#6357)
joemmett [Wed, 20 Jul 2016 23:31:04 +0000 (16:31 -0700)]
Fix is_blittable partial specializations (#6357)

The is_blittable partial specializations were defined using "class", privately
inheriting from std::true_type. This means the ::value member variable will
be inaccessible to most users of these types. Thus the type
``std::enable_if<is_blittable<T>::value>::type'' will always result in a
substitution failure with a compiler that respects accessibility in SFINAE.

This commit changes "class" to "struct" for these partial specializations
so they inherit publicly from std::true_type.

8 years agoFix bug: inlinee did not copy inlinee bbFlags to caller bbFlags.
Egor Chesakov [Tue, 19 Jul 2016 18:33:19 +0000 (11:33 -0700)]
Fix bug: inlinee did not copy inlinee bbFlags to caller bbFlags.

8 years agoMore Struct-related Refactorings
Carol Eidt [Fri, 15 Jul 2016 19:29:29 +0000 (12:29 -0700)]
More Struct-related Refactorings

- Make GT_OBJ and GT_NULLCHECK derive from GenTreeIndir, as they are also indirections.
- Extract the ordering-related methods from gentree and optcse, as they will need to be used slightly differently for struct assignments.
- Make fgMorphImplicitByRefArgs take a pointer to the tree, as it may need to replace the tree with one that a simple CopyFrom() will not work for.
- In gtSetEvalOrder(), in the addressing mode code, replace "adr" with "base" and "op1" with "addr", as the existing names are quite confusing.
- Other minor refactorings to reduce future diffs.

8 years agoMerge pull request #6326 from sivarv/phase2
Sivarv [Wed, 20 Jul 2016 22:14:58 +0000 (15:14 -0700)]
Merge pull request #6326 from sivarv/phase2

Support for reg optional tree temps.

8 years agoMerge pull request #6242 from Maoni0/race
Maoni Stephens [Wed, 20 Jul 2016 21:55:48 +0000 (14:55 -0700)]
Merge pull request #6242 from Maoni0/race

Fixed race condition in setting dd_new_allocation

8 years agoMerge pull request #6348 from hseok-oh/softfp_rootfs
Aditya Mandaleeka [Wed, 20 Jul 2016 21:24:02 +0000 (14:24 -0700)]
Merge pull request #6348 from hseok-oh/softfp_rootfs

Fix to ignore codename for arm-softfp

8 years agoSupport for reg optional tree temps.
sivarv [Mon, 18 Jul 2016 23:56:59 +0000 (16:56 -0700)]
Support for reg optional tree temps.

8 years agoMerge pull request #6323 from wtgodbe/updatePackages
William Godbe [Wed, 20 Jul 2016 19:01:10 +0000 (12:01 -0700)]
Merge pull request #6323 from wtgodbe/updatePackages

Enable automatic updating of package versions in test project.json files

8 years agoEnable automatic updating of package versions in test project.json files
wtgodbe [Mon, 18 Jul 2016 22:25:04 +0000 (15:25 -0700)]
Enable automatic updating of package versions in test project.json files

8 years agoMerge pull request #6360 from mmitche/fix-regex
Matt Mitchell [Wed, 20 Jul 2016 18:43:52 +0000 (11:43 -0700)]
Merge pull request #6360 from mmitche/fix-regex

Incorrect quoting around regex string

8 years agoIncorrect quoting around regex string
Matt Mitchell [Wed, 20 Jul 2016 18:43:07 +0000 (11:43 -0700)]
Incorrect quoting around regex string
Strings requiring inline replacement need double quotes

8 years agoFix silent bad codegen in signed comparison
Michelle McDaniel [Mon, 11 Jul 2016 16:32:56 +0000 (09:32 -0700)]
Fix silent bad codegen in signed comparison

While working on #5956, I uncovered a silent bad codegen bug in signed
comparison. The way the code was written, we'd do an unsigned set after a
signed compare/jump from the high comparison. However, in this case, we
need to make sure that we are honoring the sign of the comparison done on
the high part of the operation, and the lo comparison would still want to
be an unsigned compare followed by an unsigned set. This change splits
comparisons into two cases: 1) A signed comparison where we have two jumps
for the high part (GT_GT, GT_LT, GT_GE, and GT_LE), which require a signed
set if the high comparisons are true, and an unsigned set if not, and 2)
An unsigned comparison, or a comparison where the sign does not matter for
the compare (GT_NE, GT_EQ), which just require an unsigned set for both
the high and lo operations (the code we already had in genCompareLong).

When we compare longs, we don't need to have both a jg/ja and a jne
instruction for the hi compare for the case where we enregister the result
of the compare, since the set will do the right thing. We only need to
check the lo halves if the hi halves were equal.

For long compares where the result isn't stored in a register, we need to use
signed jumps for the high comparison, and unsigned jumps for the low compare.
Currently, we generate a signed jump in the code for GT_JTRUE that is used by
both compares. This change modifies the logic for these compares/JTRUEs.
We separate the logic into genJTrueLong. In genJTrueLong, we use similar
logic as the legacy backend for the jumps, using a signed jump after the
high compare when we have signed operands, and unsigned jump when we have
a unsigned operands, and an unsigned jump for the low compare.

This change also modifies genJumpKindsForTreeLongHi, since it is now only
used for the uncontained case, where we need to jump to the bbJumpDest if
the compare is true, so we need to use the actual jump type, rather than
just checking for inequality (as inequality only tells us if we need to
check the low halves, not if the condition is true or not).

This change also adds test cases for the two silent bad codegen cases this
commit fixes.

8 years agoMerge pull request #6340 from wtgodbe/tPack
William Godbe [Wed, 20 Jul 2016 17:24:24 +0000 (10:24 -0700)]
Merge pull request #6340 from wtgodbe/tPack

Stop building targetingPack package on non-windows

8 years agoMerge pull request #6346 from dotnet-bot/UpdateDependencies20160720052232
Gaurav Khanna [Wed, 20 Jul 2016 17:04:17 +0000 (10:04 -0700)]
Merge pull request #6346 from dotnet-bot/UpdateDependencies20160720052232

Updating External dependencies to beta-24320-00

8 years agoMerge pull request #6354 from dotnet/revert-6344-UndoNetCIChange
Matt Mitchell [Wed, 20 Jul 2016 16:59:40 +0000 (09:59 -0700)]
Merge pull request #6354 from dotnet/revert-6344-UndoNetCIChange

Revert "Revert: Pull crash dump links"

8 years agoRevert "Revert: Pull crash dump links"
Matt Mitchell [Wed, 20 Jul 2016 16:01:04 +0000 (09:01 -0700)]
Revert "Revert: Pull crash dump links"