platform/upstream/coreclr.git
7 years agoStreamlined MinOpts GC ref tracking. (#9869)
Peter Kukol [Wed, 1 Mar 2017 15:51:31 +0000 (08:51 -0700)]
Streamlined MinOpts GC ref tracking. (#9869)

7 years agoMerge pull request #9831 from WinCPP/LazyInitializerNewOverloads
Stephen Toub [Wed, 1 Mar 2017 15:10:26 +0000 (10:10 -0500)]
Merge pull request #9831 from WinCPP/LazyInitializerNewOverloads

CoreFx #16274 Implementation - New overloads of LazyInitializer.EnsureInitialized for reference types

7 years ago[x86/linux] Add IsIPinVirtualStub() on x86/linux (#9844)
Yongseop Kim [Wed, 1 Mar 2017 14:52:35 +0000 (23:52 +0900)]
[x86/linux] Add IsIPinVirtualStub() on x86/linux (#9844)

* [x86/linux] Add IsIPinVirtualStub() on x86/linux #9691

To pass Loader.classloader.methodoverriding.regressions.549411.exploit
test failure on x86/linux. This patch is from #5542.

7 years ago[Arm64/Unix] Revert fix stack unwinding in CallDescrWorkerInternal (#9866)
Steve MacLean [Wed, 1 Mar 2017 09:35:56 +0000 (04:35 -0500)]
[Arm64/Unix] Revert fix stack unwinding in CallDescrWorkerInternal (#9866)

7 years ago[x86/Linux] Use ESTABLISHER_FRAME_POINTER_IS_CALLER_SP (#9814)
Jonghyun Park [Wed, 1 Mar 2017 09:13:40 +0000 (18:13 +0900)]
[x86/Linux] Use ESTABLISHER_FRAME_POINTER_IS_CALLER_SP (#9814)

* [x86/Linux] Introduce ESTABLISHER_FRAME_ADDRESS_IS_CALLER_SP

7 years ago[x86/Linux] Correct GetStackParameterSize on Funclet (#9849)
Jonghyun Park [Wed, 1 Mar 2017 09:12:37 +0000 (18:12 +0900)]
[x86/Linux] Correct GetStackParameterSize on Funclet (#9849)

7 years agoMerge pull request #9870 from dotnet-bot/master-UpdateDependencies
Stephen Toub [Wed, 1 Mar 2017 03:49:09 +0000 (22:49 -0500)]
Merge pull request #9870 from dotnet-bot/master-UpdateDependencies

Update CoreClr to beta-25101-01 (master)

7 years agoCorefx #16274 - LazyInitializer.EnsureInitialized overload for reference
WinCPP [Wed, 1 Mar 2017 03:19:49 +0000 (08:49 +0530)]
Corefx #16274 - LazyInitializer.EnsureInitialized overload for reference
types

LazyInitializer.EnsureInitialized overload for reference types that does
not take boolean for tracking initialization status of the reference
type object. Null check on the object parameter is sufficient to whether
or not it has been initialized.

7 years agoGlobalization merge (#9835)
Tarek Mahmoud Sayed [Wed, 1 Mar 2017 02:51:12 +0000 (18:51 -0800)]
Globalization merge (#9835)

* Merging the Globalization code in coreclr

This change is merging the globalization code used for Linux and Windows. here Is come notes about this merge:
- Mainly picked most of the code from the corefx folder as it is well formatted and cleaned up before and then tweaked the implementation to work on Windows
- Tries to reduce the dependencies from Globalization code on the VM. this will give flexibility to work on the code without worrying the VM
- Provided the missing implementation as I removed many internal calls to the VM. This also help in having .Net Native have complete implementation for .net standard 2.0
- We may need to have some small tweaks when merging this globalization code to corert
-   We'll need to do some clean up for the code which not used anymore in the VM

* Fix ifdef's

* Fix field name in linux build

* Fix field name in linux compilation

* Misc cleanup & return randomized hashing

* Fix missing method for Linux

* one more minor fix

* Fix Linux build

7 years agoMove files that are identical with CoreRT under mscorlib\shared (#9861)
Jan Kotas [Wed, 1 Mar 2017 02:48:00 +0000 (18:48 -0800)]
Move files that are identical with CoreRT under mscorlib\shared (#9861)

7 years agoUpdate CoreClr to beta-25101-01
dotnet-bot [Wed, 1 Mar 2017 01:34:11 +0000 (01:34 +0000)]
Update CoreClr to beta-25101-01

7 years agoMerge pull request #9865 from alexperovich/moveToShared
Alex Perovich [Wed, 1 Mar 2017 01:19:16 +0000 (19:19 -0600)]
Merge pull request #9865 from alexperovich/moveToShared

Add more shared sources

7 years agoMerge pull request #9609 from pgavlin/HandleContainedNodesEarlier
Pat Gavlin [Wed, 1 Mar 2017 01:13:54 +0000 (17:13 -0800)]
Merge pull request #9609 from pgavlin/HandleContainedNodesEarlier

Handle contained nodes earlier in buildRefPositionsForNode.

7 years agoMerge pull request #9862 from mikedn/ge-vnf-gt
Pat Gavlin [Wed, 1 Mar 2017 00:54:02 +0000 (16:54 -0800)]
Merge pull request #9862 from mikedn/ge-vnf-gt

Fix broken GT_GE - VNF_GT_UN mapping

7 years agoMerge pull request #9825 from mskvortsov/ryujit-arm32-pinvoke
Bruce Forstall [Wed, 1 Mar 2017 00:04:09 +0000 (16:04 -0800)]
Merge pull request #9825 from mskvortsov/ryujit-arm32-pinvoke

[RyuJIT/ARM32] P/Invoke support

7 years agoHandle contained nodes earlier in buildRefPositionsForNode.
Pat Gavlin [Wed, 15 Feb 2017 01:08:44 +0000 (17:08 -0800)]
Handle contained nodes earlier in buildRefPositionsForNode.

These nodes never produce ref positions. Handling them earlier in this function
avoids a rather large amount of unnecessary work (e.g. this decreases overall
compile time by about 0.5% for `crossgen System.Private.CoreLib`).

7 years agoMerge pull request #9794 from pgavlin/PutArgRegInit
Pat Gavlin [Tue, 28 Feb 2017 23:14:52 +0000 (15:14 -0800)]
Merge pull request #9794 from pgavlin/PutArgRegInit

Refactor register arg handling in TreeNodeInfoInit.

7 years agoAdd more shared sources
Alex Perovich [Tue, 28 Feb 2017 22:37:49 +0000 (14:37 -0800)]
Add more shared sources

7 years agoMerge pull request #9729 from rahku/hijackfix
Rahul Kumar [Tue, 28 Feb 2017 22:14:11 +0000 (14:14 -0800)]
Merge pull request #9729 from rahku/hijackfix

add FP return values as part of HijackFrame

7 years agoMerge pull request #9857 from jashook/arm64_inner_structs
Jarret Shook [Tue, 28 Feb 2017 21:34:38 +0000 (13:34 -0800)]
Merge pull request #9857 from jashook/arm64_inner_structs

Add the correct offset for finding nested structs.

7 years agoRyuJIT/ARM32: Enable P/Invoke lowering.
Mikhail Skvortcov [Mon, 6 Feb 2017 14:46:17 +0000 (17:46 +0300)]
RyuJIT/ARM32: Enable P/Invoke lowering.

7 years agoFix mismatch in the cmake script endif condition (#9859)
Jan Vorlicek [Tue, 28 Feb 2017 19:19:24 +0000 (20:19 +0100)]
Fix mismatch in the cmake script endif condition (#9859)

This change fixes a mismatch in the cmake script endif condition introduced
by #9809.

7 years agoMerge pull request #9781 from dotnet-bot/master-UpdateDependencies
Gaurav Khanna [Tue, 28 Feb 2017 19:02:07 +0000 (11:02 -0800)]
Merge pull request #9781 from dotnet-bot/master-UpdateDependencies

Update CoreClr, CoreFx to beta-25028-02, stable, respectively (master)

7 years agoFix broken GT_GE - VNF_GT_UN mapping
Mike Danes [Tue, 28 Feb 2017 18:41:34 +0000 (20:41 +0200)]
Fix broken GT_GE - VNF_GT_UN mapping

7 years agoMerge pull request #9852 from mskvortsov/ryujit-arm32-label
Bruce Forstall [Tue, 28 Feb 2017 17:57:34 +0000 (09:57 -0800)]
Merge pull request #9852 from mskvortsov/ryujit-arm32-label

[RyuJIT/ARM32] enable CG for GT_LABEL nodes

7 years agoRemove some unused benchmarks (#9843)
Andy Ayers [Tue, 28 Feb 2017 17:15:14 +0000 (09:15 -0800)]
Remove some unused benchmarks (#9843)

7 years agoAdd the correct offset for finding nested structs.
jashook [Tue, 28 Feb 2017 17:05:04 +0000 (09:05 -0800)]
Add the correct offset for finding nested structs.

As is the base offset of a nested struct that was a lclField was
being dropped.

7 years agoMerge pull request #9796 from pgavlin/FixOurGetThreadCycles
Pat Gavlin [Tue, 28 Feb 2017 16:30:46 +0000 (08:30 -0800)]
Merge pull request #9796 from pgavlin/FixOurGetThreadCycles

Fix _our_GetThreadCycles for clang/xarch.

7 years agoFix cross component builderror - CMakeLists.txt for PAL (#9819)
Hyeongseok Oh [Tue, 28 Feb 2017 13:09:37 +0000 (22:09 +0900)]
Fix cross component builderror - CMakeLists.txt for PAL (#9819)

define & use PAL_ARCH_SOURCES_DIR in PAL CMakeLists.txt to build assembly based on platform architecture.
root/CMakeLists.txt defines ARCH_SOURCES_DIR based on target architecture.

7 years agoRyuJIT/ARM32: enable CG for GT_LABEL nodes
Mikhail Skvortcov [Tue, 28 Feb 2017 13:01:20 +0000 (16:01 +0300)]
RyuJIT/ARM32: enable CG for GT_LABEL nodes

7 years agoDisable DBGIPC_TRANSPORT_DI and DBGIPC_TRANSPORT_VM on Android (#9809)
Frederik Carlier [Tue, 28 Feb 2017 12:55:59 +0000 (13:55 +0100)]
Disable DBGIPC_TRANSPORT_DI and DBGIPC_TRANSPORT_VM on Android (#9809)

* Disable DBGIPC_TRANSPORT_DI and DBGIPC_TRANSPORT_VM on Android

7 years agoUse BIT64 instead of _WIN64 for LONG helpers (#9845)
Jonghyun Park [Tue, 28 Feb 2017 10:36:55 +0000 (19:36 +0900)]
Use BIT64 instead of _WIN64 for LONG helpers (#9845)

7 years agoUpdate CoreClr, CoreFx to beta-25028-02, stable, respectively
dotnet-bot [Tue, 28 Feb 2017 09:28:23 +0000 (09:28 +0000)]
Update CoreClr, CoreFx to beta-25028-02, stable, respectively

7 years ago[x86/linux] Implement BackPatchWorkerAsmStub (#9690)
Yongseop Kim [Tue, 28 Feb 2017 09:25:10 +0000 (18:25 +0900)]
[x86/linux] Implement BackPatchWorkerAsmStub (#9690)

* [x86/linux] Implement BackPatchWorkerAsmStub

This implementation is ported from BackPatchWorkerAsmStub in
vm/i386/virtualcallstubcpu.hpp

7 years agoMerge pull request #9774 from sandreenko/coreRT-fat-pointers-fix
Sergey Andreenko [Tue, 28 Feb 2017 04:14:27 +0000 (20:14 -0800)]
Merge pull request #9774 from sandreenko/coreRT-fat-pointers-fix

coreRT fat pointer hidden argument fix for calls with retBufArg

7 years agoReplace INSIDE_CLR with CORECLR (#9841)
Dan Moseley [Tue, 28 Feb 2017 03:39:04 +0000 (19:39 -0800)]
Replace INSIDE_CLR with CORECLR (#9841)

7 years agoMove Used interop sources into shared folder (#9840)
Alex Perovich [Tue, 28 Feb 2017 02:54:54 +0000 (20:54 -0600)]
Move Used interop sources into shared folder (#9840)

7 years agoCC fix
Sergey Andreenko [Tue, 28 Feb 2017 02:41:40 +0000 (18:41 -0800)]
CC fix

7 years agoSome tests for devirtualization (#9834)
Andy Ayers [Tue, 28 Feb 2017 02:10:27 +0000 (18:10 -0800)]
Some tests for devirtualization (#9834)

7 years agoUse flags in exceptionhandling.cpp (#9823)
Jonghyun Park [Tue, 28 Feb 2017 02:06:38 +0000 (11:06 +0900)]
Use flags in exceptionhandling.cpp (#9823)

* Add USE_FUNCLET_CALL_HELPER

* Use STACK_RANGE_BOUNDS_ARE_CALLER_SP

7 years ago[x86/Linux] Fix GetCurrentSP (#9838)
Jonghyun Park [Tue, 28 Feb 2017 01:26:51 +0000 (10:26 +0900)]
[x86/Linux] Fix GetCurrentSP (#9838)

7 years agocoreRT fat pointer hidden argument fix for calls with retBufArg
Sergey Andreenko [Fri, 24 Feb 2017 21:39:36 +0000 (13:39 -0800)]
coreRT fat pointer hidden argument fix for calls with retBufArg

7 years agoMerge pull request #9837 from adityamandaleeka/remove_useless_message
Aditya Mandaleeka [Mon, 27 Feb 2017 23:34:48 +0000 (15:34 -0800)]
Merge pull request #9837 from adityamandaleeka/remove_useless_message

Remove useless message from runtest output.

7 years agoRemove useless message from runtest output.
Aditya Mandaleeka [Mon, 27 Feb 2017 23:30:15 +0000 (15:30 -0800)]
Remove useless message from runtest output.

7 years agoDon't generate a runtime lookup for static base if not needed (#9833)
Michal Strehovský [Mon, 27 Feb 2017 23:21:57 +0000 (15:21 -0800)]
Don't generate a runtime lookup for static base if not needed (#9833)

`fgInitThisClass` makes sure that the type initializer for the type that
owns the method being compiled has run. On CoreCLR, the fallthrough code
somehow ends up not doing a runtime lookup if the owning type is not
canonical. We need to avoid it on CoreRT as well.

7 years agoMerge pull request #9795 from pgavlin/RefactorIsContained
Pat Gavlin [Mon, 27 Feb 2017 21:05:59 +0000 (13:05 -0800)]
Merge pull request #9795 from pgavlin/RefactorIsContained

Refactor isContained().

7 years agoREADME.md: More idiomatic Markdown usage (#9799)
Per Lundberg [Mon, 27 Feb 2017 20:57:48 +0000 (22:57 +0200)]
README.md: More idiomatic Markdown usage (#9799)

- In essence, use backticks where applicable.
- Also, changed some incorrect case (`Build.cmd` vs `build.cmd` which is the canonical name; if you have your git repo on a case-sensitive filesystem like I do, this makes a real difference - you can't run it with the incorrect case).
- Fixed naming of Git and CMake to use their official capitalization.

7 years agoImprove BitConverter.ToIntNN methods (#9803)
mikedn [Mon, 27 Feb 2017 20:44:27 +0000 (22:44 +0200)]
Improve BitConverter.ToIntNN methods (#9803)

* Improve BitConverter.ToIntNN methods

- Avoid duplicate argument validation
- Fix failed optimization attempt: (uint)i < a.Length needs to be (uint) < (uint)a.Length otherwise it gets promoted to long and that's bad for 32 bit architectures
- Workaround JIT limitation: fixed variables cannot be enregistered
- Use Unsafe.ReadUnaligned to avoid alignment handling complications
- Use Unsafe.As instead of fixed as it generates shorter code
- Don't forward unsigned method to signed methods. The JIT doesn't want to inline the signed methods even though the generated code isn't significantly larger

7 years agoUse Unsafe.ReadUnaligned/WriteUnaligned in UMA (#9829)
mikedn [Mon, 27 Feb 2017 20:05:13 +0000 (22:05 +0200)]
Use Unsafe.ReadUnaligned/WriteUnaligned in UMA (#9829)

7 years agoAdd Unsafe.ReadUnaligned/WriteUnaligned (#9808)
mikedn [Mon, 27 Feb 2017 16:40:51 +0000 (18:40 +0200)]
Add Unsafe.ReadUnaligned/WriteUnaligned (#9808)

7 years agoUse WIN64EXCEPTIONS to declare EE_PERSONALITY_ROUTINE helpers (#9821)
Jonghyun Park [Mon, 27 Feb 2017 15:00:42 +0000 (00:00 +0900)]
Use WIN64EXCEPTIONS to declare EE_PERSONALITY_ROUTINE helpers (#9821)

7 years ago[x86/Linux] Clean up unused NakedThrowHelper stub (#9824)
Jonghyun Park [Mon, 27 Feb 2017 14:57:20 +0000 (23:57 +0900)]
[x86/Linux] Clean up unused NakedThrowHelper stub (#9824)

7 years ago[x86/Linux] 16-byte aligned Funclet Helpers (#9810)
Jonghyun Park [Mon, 27 Feb 2017 10:07:05 +0000 (19:07 +0900)]
[x86/Linux] 16-byte aligned Funclet Helpers (#9810)

7 years agoClean up PInvokeStubForHost and PInvokeStubForHostInner (#9815)
Jonghyun Park [Mon, 27 Feb 2017 05:21:19 +0000 (14:21 +0900)]
Clean up PInvokeStubForHost and PInvokeStubForHostInner (#9815)

7 years agoClean up nested WIN64EXCEPTIONS-ifdef (#9817)
Jonghyun Park [Mon, 27 Feb 2017 05:20:43 +0000 (14:20 +0900)]
Clean up nested WIN64EXCEPTIONS-ifdef (#9817)

7 years ago[x86/Linux] Use _X86_ instead of _TARGET_X86_ (#9816)
Jonghyun Park [Mon, 27 Feb 2017 04:09:10 +0000 (13:09 +0900)]
[x86/Linux] Use _X86_ instead of _TARGET_X86_ (#9816)

7 years ago[x86/Linux] Clean up PopSEHRecords (#9812)
Jonghyun Park [Mon, 27 Feb 2017 02:46:19 +0000 (11:46 +0900)]
[x86/Linux] Clean up PopSEHRecords (#9812)

7 years ago[x86/Linux] Clean up CallRtlUnwind (#9813)
Jonghyun Park [Mon, 27 Feb 2017 02:45:50 +0000 (11:45 +0900)]
[x86/Linux] Clean up CallRtlUnwind (#9813)

7 years ago[x86/Linux] Clean up ARRAY STUB(s) (#9811)
Jonghyun Park [Mon, 27 Feb 2017 02:41:48 +0000 (11:41 +0900)]
[x86/Linux] Clean up ARRAY STUB(s) (#9811)

7 years agoDelete a bit of dead code (#9801)
Jan Kotas [Sun, 26 Feb 2017 20:55:49 +0000 (12:55 -0800)]
Delete a bit of dead code (#9801)

7 years agoMerge pull request #9789 from mikedn/le-intrinsic
Pat Gavlin [Sun, 26 Feb 2017 05:10:01 +0000 (21:10 -0800)]
Merge pull request #9789 from mikedn/le-intrinsic

Treat BitConverter.IsLittleEndian as an intrinsic

7 years agoMerge pull request #9782 from mellinoe/ilasm-pathlength-fix
Eric Mellino [Sun, 26 Feb 2017 02:54:06 +0000 (18:54 -0800)]
Merge pull request #9782 from mellinoe/ilasm-pathlength-fix

Increase the length of allowed parameters in ilasm

7 years agoUpdate BitConverter from CoreFX (#9788)
Jan Kotas [Sun, 26 Feb 2017 02:27:32 +0000 (18:27 -0800)]
Update BitConverter from CoreFX (#9788)

* Update BitConverter from CoreFX

Related to #9701

* Use ThrowHelper

7 years agoBetter ArraySegment .ctor tests (#9800)
Ben Adams [Sun, 26 Feb 2017 00:02:14 +0000 (00:02 +0000)]
Better ArraySegment .ctor tests (#9800)

7 years ago[ARM/CI] Fix arm32 CI git check failure (#9798)
Hyung-Kyu Choi [Sat, 25 Feb 2017 19:24:16 +0000 (04:24 +0900)]
[ARM/CI] Fix arm32 CI git check failure (#9798)

Because layout in corefx binary has been changed, it causes arm CI failure.
And skip arm32 tests because test is not working recently.

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
7 years ago[ARM/CI] Update arm CI to sync up with corefx change (#9797)
Hyung-Kyu Choi [Sat, 25 Feb 2017 18:29:20 +0000 (03:29 +0900)]
[ARM/CI] Update arm CI to sync up with corefx change (#9797)

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
7 years agoFix _our_GetThreadCycles for clang/xarch.
Pat Gavlin [Sat, 25 Feb 2017 18:09:00 +0000 (10:09 -0800)]
Fix _our_GetThreadCycles for clang/xarch.

The `"=A"` constraint in `asm volatile("rdtsc" : "=A"(cycles))` does not work as expected
on AMD64. Instead, the assembly must use an output constraint for both `eax` and `edx`
(i.e. `=a"(lo), "=d"(hi)`).

7 years agoRefactor register arg handling in TreeNodeInfoInit.
Pat Gavlin [Sat, 25 Feb 2017 01:16:35 +0000 (17:16 -0800)]
Refactor register arg handling in TreeNodeInfoInit.

The handling for outgoing register arguments in TreeNodeInfoInitCall was
unnecessarily complex and difficult to follow. In particular, the processing
of FIELD_LIST arguments performed a fair amount of unnecessary work,
contained code to deal with impossible IR patterns, and did not share any
code for handling the component PUTARG_REG nodes with the normal PUTARG_REG
case. This changes resolves all three of these issues and fixes an ordering
issue in lowering that was causing PInvoke prologs to remain unlowered.

7 years agoRefactor isContained().
Pat Gavlin [Fri, 24 Feb 2017 19:19:27 +0000 (11:19 -0800)]
Refactor isContained().

This changes isContained to terminate early if it is not possible for the node in question
to ever be contained. There are many nodes that are statically non-containable: any node
that is not a value may not be contained along with a small number of value nodes. To avoid
the need for a `switch` to identify the latter, their node kinds have been marked with a
new flag, `GTK_NOCONTAIN`. The checks for identifying non-containable nodes are encapsulated
withing a new function, `canBeContained`.

7 years agoMerge pull request #9791 from dotnet/revert-9231-MinOptsSimplifiedGCtracking
Jan Kotas [Sat, 25 Feb 2017 16:09:54 +0000 (08:09 -0800)]
Merge pull request #9791 from dotnet/revert-9231-MinOptsSimplifiedGCtracking

Revert "Simplified MinOpts GC ref tracking."

7 years agoRevert "Simplified MinOpts GC ref tracking."
Jan Kotas [Sat, 25 Feb 2017 14:33:11 +0000 (06:33 -0800)]
Revert "Simplified MinOpts GC ref tracking."

7 years agoFix GC hole when exception filter throws unhandled exception (#9785)
Jan Vorlicek [Sat, 25 Feb 2017 10:08:35 +0000 (11:08 +0100)]
Fix GC hole when exception filter throws unhandled exception (#9785)

The extra Unix specific piece of code in the StackFrameIterator::Filter that
handles the difference in the exception stack unwinding on Unix was not
skipping exception trackers belonging to filter clauses. But that was not
right, since filter funclet stack frames behave the same way on Windows and
Unix. They can be present on the stack when we reach their parent frame if
the filter hasn't finished running yet or they can be gone if the filter
completed running, either succesfully or with unhandled exception.

This change adds skipping of filter funclet related exception trackers at
that place so that the common code processes them.

This fixes the GC hole mentioned in the title that was discovered when
running some tests with GCStress mode 2.

7 years agoTreat BitConverter.IsLittleEndian as an intrinsic
Mike Danes [Sat, 25 Feb 2017 09:45:02 +0000 (11:45 +0200)]
Treat BitConverter.IsLittleEndian as an intrinsic

7 years agoRemove `this == null` checks from string.Equals (#9768)
James Ko [Sat, 25 Feb 2017 06:48:36 +0000 (01:48 -0500)]
Remove  `this == null` checks from string.Equals (#9768)

7 years agoMove S.Buffers and S.IO sources shared with corert into shared folder (#9778)
Alex Perovich [Sat, 25 Feb 2017 06:46:59 +0000 (00:46 -0600)]
Move S.Buffers and S.IO sources shared with corert into shared folder (#9778)

7 years agoMerge pull request #9756 from AndyAyersMS/RefCountGenericContext
Andy Ayers [Sat, 25 Feb 2017 01:51:10 +0000 (17:51 -0800)]
Merge pull request #9756 from AndyAyersMS/RefCountGenericContext

JIT: keep ref count for runtime generic context lookups

7 years agoUse clock_gettime(CLOCK_REALTIME) in DateTime.UtcNow (#9772)
Stephen Toub [Sat, 25 Feb 2017 01:39:44 +0000 (20:39 -0500)]
Use clock_gettime(CLOCK_REALTIME) in DateTime.UtcNow (#9772)

gettimeofday() is currently used in DateTime.UtcNow.  Depending on the system, it may have accuracy and precision in line with either clock_gettime(CLOCK_REALTIME) or clock_gettime(CLOCK_REALTIME_COARSE), but in returning its data it's necessarily limited by struct timeval's tv_usec field (microseconds), whereas clock_gettime uses struct timespec which has tv_nsec (nanoseconds).  This commit switches to use clock_gettime(CLOCK_REALTIME) to gain the additional precision (though the FILETIME through which the data is returned only supports 100-nsec precision).  On my machine, there was no measurable impact to throughput.

7 years agoMerge pull request #9598 from ahsonkhan/OptimizeSpanClear
Ahson Ahmed Khan [Sat, 25 Feb 2017 01:27:54 +0000 (17:27 -0800)]
Merge pull request #9598 from ahsonkhan/OptimizeSpanClear

Optimize span clear

7 years agoIncrease the length of allowed parameters in ilasm.
Eric Mellino [Sat, 25 Feb 2017 00:48:50 +0000 (16:48 -0800)]
Increase the length of allowed parameters in ilasm.

The way this code is structured prevents parameters longer than 128 characters
from being passed. This change simply increases that to 1024 characters, although
a more robust change could be made in the future to account for platform differences.

7 years agoRemove optimizedtls.cpp (#9777)
Aditya Mandaleeka [Sat, 25 Feb 2017 00:37:26 +0000 (16:37 -0800)]
Remove optimizedtls.cpp (#9777)

7 years agoRemove NakedThrowHelper and ifdef-out its callers (#9771)
Jan Vorlicek [Fri, 24 Feb 2017 21:47:31 +0000 (22:47 +0100)]
Remove NakedThrowHelper and ifdef-out its callers (#9771)

This change removes NakedThrowHelper function for Unix since it was not used.
It also ifdefs out its upstream callers.

7 years agoreview feedback
Andy Ayers [Fri, 24 Feb 2017 21:35:37 +0000 (13:35 -0800)]
review feedback

7 years agoMerge pull request #9336 from mikedn/const-fold
Pat Gavlin [Fri, 24 Feb 2017 21:17:56 +0000 (13:17 -0800)]
Merge pull request #9336 from mikedn/const-fold

Fix incorrect cast in gtFoldExprConst

7 years agoMerge pull request #9769 from ianhays/filelock_osx
Ian Hays [Fri, 24 Feb 2017 21:08:17 +0000 (13:08 -0800)]
Merge pull request #9769 from ianhays/filelock_osx

Remove OSX FileStream Lock/Unlock

7 years agoRemove getcontext and setcontext usage (#9759)
Jan Vorlicek [Fri, 24 Feb 2017 20:29:15 +0000 (21:29 +0100)]
Remove getcontext and setcontext usage (#9759)

It turns out that the getcontext and setcontext that I have used in my stack
oveflow reporting change are not present e.g. on Alpine Linux or on Android.
So I am replacing their usage with RtlCaptureContext and RtlRestoreContext
instead.

I have also found that the addition of the .cfi_adjust_cfa_offset to the
PROLOG_SAVE_REG_PAIR has broken unwinding of all helpers that use
PROLOG_WITH_TRANSITION_BLOCK, because the PROLOG_STACK_ALLOC macro
updates the CFA offset. So I am fixing that by removing the CFA offset
updating from the PROLOG_STACK_ALLOC and adding explicit one to the
ARM64 CallSignalHandlerWrapper.

7 years agoMerge pull request #9732 from hseok-oh/fix_9442
Bruce Forstall [Fri, 24 Feb 2017 20:28:50 +0000 (12:28 -0800)]
Merge pull request #9732 from hseok-oh/fix_9442

Fix code generation for array length check in legacy JIT

7 years agoEnable DevDiv_377155
Mike Danes [Sat, 4 Feb 2017 10:17:13 +0000 (12:17 +0200)]
Enable DevDiv_377155

7 years agoFix incorrect cast in gtFoldExprConst
Mike Danes [Sat, 4 Feb 2017 10:14:54 +0000 (12:14 +0200)]
Fix incorrect cast in gtFoldExprConst

The fact that an operation is unsigned affects the operation itself but that doesn't mean that the result of the operation is also unsigned. Constants are stored as ssize_t and the node type is TYP_INT so the result has to be sign extended, not zero extended.

Otherwise code that uses the return of IconValue() without first narrowing it to int will behave incorrectly. Such code does exists, even gtFoldExprConst does this when folding shift operations:

uint a = uint.MaxValue;
uint b = 0;
int r = (int)checked(a + b);
Console.WriteLine((r >> 2).ToString("X"));

The above code prints 3FFFFFFF instead of the expected FFFFFFFF.

This also makes gtFoldExprConst consistent with ValueNumStore::EvalFuncForConstantArgs which evaluates TYP_INT nodes as int and then casts to ssize_t.

7 years agoUpdate FileLock/Unlock PNSE message for OSX
Ian Hays [Fri, 24 Feb 2017 19:46:25 +0000 (11:46 -0800)]
Update FileLock/Unlock PNSE message for OSX

7 years agoAvoid unnecessary branch in CultureAwareComparer (#9767)
Justin Van Patten [Fri, 24 Feb 2017 19:08:08 +0000 (11:08 -0800)]
Avoid unnecessary branch in CultureAwareComparer (#9767)

* Avoid unnecessary branch in CultureAwareComparer

Determine the CompareOptions up-front instead of during each operation.

7 years agoMerge pull request #9749 from wtgodbe/XunitCopyStuff
William Godbe [Fri, 24 Feb 2017 18:54:40 +0000 (10:54 -0800)]
Merge pull request #9749 from wtgodbe/XunitCopyStuff

Use -f instead of -n when copying from Core_Root in runtest.sh

7 years agoRemove OSX FileStream Lock/Unlock
Ian Hays [Thu, 23 Feb 2017 22:46:15 +0000 (14:46 -0800)]
Remove OSX FileStream Lock/Unlock

OSX doesn't support usage of both fcntl and flock. Since we're already using one in FileShare for the entire file, we cannot enable partial file locking like we do on other Unix platforms. The alternative is to throw a PNSE and suggest using FileShare on the whole file instead.

7 years agoMerge pull request #9766 from discostu105/patch-1
Stephen Toub [Fri, 24 Feb 2017 18:35:48 +0000 (13:35 -0500)]
Merge pull request #9766 from discostu105/patch-1

fix typo in sos_md.h

7 years ago[Local GC] Move workstation GC DAC globals to a struct shared between GC and DAC...
Sean Gillespie [Fri, 24 Feb 2017 18:12:26 +0000 (10:12 -0800)]
[Local GC] Move workstation GC DAC globals to a struct shared between GC and DAC (#9255)

* [Local GC] Move workstation GC DAC globals to a struct shared between
the GC and the DAC

* (Some) code review feedback and bug fixes for issues found while debugging on OSX

* Address some code review feedback:
 1. Make g_gcDacGlobals a pointer and dacvar on the VM side, so
    that publishing the GC dac vars is done atomically (through
    a pointer assignment). This fixes a race that Noah noticed.
 2. Remove the requirement for the GC's generation class struct
    to be known at compile-time, by using a dacvar as the size
    of the generation class at run-time (for pointer arithmetic)
 3. Move all DAC-interesting fields to be at the start of GC
    internal classes, so that the DAC does not need to know the
    size or exact layout of the class past the fields it cares
    about.

* Split the definition of the size of several arrays across the SOS/DAC and GC/DAC interfaces, and add static asserts that they are the same

* Repair the Windows Release build

* Implement the GC DAC scheme for Server GC and eliminate the duplicate GC dac vars

* Some work

* Decouple use of the GC generation table from a write barrier by having the EE store a copy of the global during initialization

* Actually make it work with server GC

* Checkpoint

* Checkpoint where everything works

* Code cleanup

* Fix debugger test failures

* Additional code cleanup

* Address code review feedback by adding a static assert and standardizing the way that we iterate over the generation table

* Repair the Windows x86 build

* Revert "Decouple use of the GC generation table from a write barrier by having the EE store a copy of the global during initialization"

This reverts commit 573f61a16b4fa8c2fc4c568c0b968a921230f31c.

* Revert "Repair the Windows x86 build"

This reverts commit 188c22d87e1d65abf00ab8fa28f46ad607a9028f.

* Partial revert, move `generation_table` back the global namespace for a single-proc allocation helper

* Fix a debugger test failure

* Repair crash dump scenarios

7 years agofix typo in sos_md.h
Christoph Neumüller [Fri, 24 Feb 2017 14:52:11 +0000 (15:52 +0100)]
fix typo in sos_md.h

7 years ago[Linux/ARM,ARM64] Fix undefined FixContextHandler issue (#9755)
Jonghyun Park [Fri, 24 Feb 2017 14:48:58 +0000 (23:48 +0900)]
[Linux/ARM,ARM64] Fix undefined FixContextHandler issue (#9755)

7 years agoFix segmentation fault when using ZapImage::PrintStats() (#9731)
Sujin Kim [Fri, 24 Feb 2017 14:43:15 +0000 (23:43 +0900)]
Fix segmentation fault when using ZapImage::PrintStats() (#9731)

Currently, ZapImage::PrintStats is not used anywhere. But I want to get detailed informations about Native Image(ni.dll) components.
So I just used ZapImage::PrintStats when called ZapImage::SaveImage. After that I met the segmentation fault likes #9680.

I found the reason for this issue is accessing the null pointer to get sizes.

7 years agotypo in CMakeLists.txt (#9763)
John Gorter [Fri, 24 Feb 2017 14:41:42 +0000 (15:41 +0100)]
typo in CMakeLists.txt (#9763)

7 years agoMerge pull request #9738 from stephentoub/ordinalignorecase_hashing
Stephen Toub [Fri, 24 Feb 2017 12:43:36 +0000 (07:43 -0500)]
Merge pull request #9738 from stephentoub/ordinalignorecase_hashing

Tweak OrdinalComparer for OrdinalIgnoreCase

7 years ago[x86/Linux] Initial patch for EH funclet (#9601)
Hanjoung Lee [Fri, 24 Feb 2017 07:02:21 +0000 (16:02 +0900)]
[x86/Linux] Initial patch for EH funclet (#9601)

- Generate a simple EH funclet frame and support SP-based stack unwinding for funclets.
- Introduce assembly helpers : CallEHFunclet and CallEHFilterFunclet