summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2019-04-09Improve RuntimeHelpers.GetSubArray (#23829)Stephen Toub1-9/+27
* Improve RuntimeHelpers.GetSubArray This change does three things. First, it fixes `GetSubArray` to work when the supplied array is actually a `U[]` where `U : T`. Currently this case ends up throwing an exception inside of span, which doesn't like working with arrays covariantly. Second, it fixes argument validation so that we throw an ArgumentNullException if the input array is null rather than NullReferenceException. Third, it improves the performance of `GetSubArray` for the 95% common case where either `T` is a value type or the type of the array matches the `T` type specified. * Only use `Array.Empty<T>` when `typeof(T[]) == array.GetType()`
2019-04-08Merge pull request #23739 from briansull/struct-cseBrian Sullivan1-11/+21
Block the hoisting of TYP_STRUCT rvalues in loop hoisting
2019-04-08Merge pull request #23752 from adityamandaleeka/arm64_clrwwAditya Mandaleeka2-6/+19
Enable CLR write watch for ARM64 Windows
2019-04-08Block the hoisting of TYP_STRUCT rvalues in loop hoistingBrian Sullivan1-11/+21
Added test case GitHub_23739.cs
2019-04-08Merge pull request #23251 from mjsabby/largePagesInGCJan Vorlicek13-14/+231
Add Large pages support in GC
2019-04-08Remove the MultiFileSec option from EventPipe. (#23777)José Rivero9-209/+25
This option was a pseudo mechanism to fake "streaming" events out-of-proc. The idea was to have EventPipe creating files every N seconds, with event data up to that point. Thus, external processes could read these files in an attempt to get "read-time" data. Now, we actually have streaming of event through IPC channels, so this option is not needed.
2019-04-08Merge pull request #23715 from BruceForstall/FixArmStackProbingBruce Forstall6-53/+79
Fix ARM32/ARM64 large frame stack probing
2019-04-08Add Large pages support in GCMukul Sabharwal13-14/+231
2019-04-08Merge pull request #23605 from franksinankaya/gcc_cleanup_17Jan Vorlicek1-1/+1
Fix conversion warning
2019-04-08Allow reabstraction of default interface methods (#23313)Michal Strehovský5-7/+71
Allow the runtime to load types with incomplete interface implementations. With this change, we allow (in pseudo-C#): ```csharp interface IFoo { void Frob() { } } interface IBar : IFoo { abstract void IFoo.Frob() } class Fooer : IBar { } ``` Calling IFoo.Frob on an instance of `Fooer` will result in new exception being thrown because the default implementation of `IFoo.Frob` was re-abstracted by `IBar`.
2019-04-07Fix two new nullable warnings with latest compilerStephen Toub2-2/+3
2019-04-06Normalize directory separators before calling LoadLibrary (#23776)Jeremy Koritzinsky1-0/+16
* Normalize directory separators when loading native library via ALC.LoadUnmanagedDllFromPath
2019-04-06Remove remaining devdocs and cleanup ComponentModel code (#23175)Hugh Bellamy5-137/+126
* Remove remaining devdocs and cleanup ComponentModel code
2019-04-06Make GCToOSInterface::FlushProcessWriteBuffers use ↵Vladimir Sadov1-35/+102
MEMBARRIER_CMD_PRIVATE_EXPEDITED if available (#23778) Basically a port of https://github.com/dotnet/coreclr/pull/20949 to GCToOSInterface
2019-04-05Match PtrToStringUTF8 to the other PtrToString* families. (#23731)Jeremy Koritzinsky1-8/+7
* Match PtrToStringUTF8 to the other PtrToString* families. * Make PtrToString*(IntPtr,int) exceptions consistent. * Exclude out-of-date tests in CoreFX. * Update exclusions to cover tests that are now throwing ArgumentOutOfRangeExceptions instead of ArgumentExceptions. * Fix parameter order for exception. * Pass value to exception.
2019-04-05Fix typo in Buffer.BlockCopy (#23636)Egor Bogatov1-1/+1
2019-04-05WIP Fix ARM32/ARM64 large frame stack probingBruce Forstall6-53/+79
2019-04-05Merge pull request #23728 from briansull/FixConstByrefBrian Sullivan3-23/+24
Fix for Issue #23538
2019-04-05Replacing some calls to GetThread with an inlined version (#23771)Fadi Hanna3-7/+12
2019-04-05Whitespace (#23772)Steve MacLean3-125/+125
2019-04-05Fix rounding to UINT32_MAX (#23764)Ludovic Henry2-21/+7
In case you would have UINT32_MAX - 1 CPUs, you would round up to return UINT32_MAX CPUs.
2019-04-05Fix issue 23713: handle TypeDesc field handles (#23767)Fadi Hanna1-1/+2
2019-04-05Update the JIT to recognize the IsSupported property for all HWIntrinsics ↵Tanner Gooding27-138/+162
(#23751) * Moving some JITDUMP calls into Compiler::lookupNamedIntrinsic * Marking the IsSupported methods as Intrinsic for all HWIntrinsic ISAs * Updating the hwintrinsic importation to more generally handle IsSupported and ThrowPNSE * Applying formatting patch. * Adding using System.Runtime.CompilerServices to the various x86 PlatformNotSupported HWIntrinsic files
2019-04-05Enable return buffers on Windows ARM64 for struct-returning member functions ↵Jeremy Koritzinsky7-24/+42
(#23625) * Enable return buffers on Windows ARM64 for struct-returning member functions. Fixes #23577. * Update comment to match new condition. * Enable byref return on all Windows (excluding arm64 HFA. Add more test cases for ThisCall. * On x86, if we have a normalized return value in an instance method, get back the actual type so that we correctly marshal it via a return buffer. * Fix param ordering. * Clean up based on PR feedback. * Fix accidental variable shadowing.
2019-04-05Fix conversion warningSinan Kaya1-1/+1
2019-04-05Don't null out references in Stream/BinaryReader/Writer (#23725)Stephen Toub4-326/+168
These types null out some fields on Dispose, and some of those fields are accessible directly via exposed properties, which means that nulling them out would either force us to annotate those properties as being nullable or would require us to lie about them being nullable. Nulling them out also makes it easier to accidentally null ref in the implementation, and prevents us from making the fields readonly. It should be exceedingly rare that you dispose of one of these objects and then keep it alive while also being concerned about keeping alive the other helper objects the type uses. So this change just uses a separate flag to track disposal, and avoids nulling out the fields, which is not a common practice elsewhere in the framework. This will be a visible change in that after Dispose, properties like StreamWriter.BaseStream/Encoding will now return the stream/encoding rather than null. In theory that could break someone if they were using those properties to determine whether the writer had been disposed, but that seems unlikely / similar fallout from most any bug fix, and objects generally aren't supposed to be touched after Dispose, anyway.
2019-04-05Change the backing storage for Byref constants in ValueNumber-ing to use size_t.Brian Sullivan3-23/+24
Fixes #23538
2019-04-05Partially improve support for `--cpus` from Docker CLI (#23747)Ludovic Henry3-9/+17
* Round up the value of the CPU limit In the case where `--cpus` is set to a value very close to the smaller integer (ex: 1.499999999), it would previously be rounded down. This would mean that the runtime would only try to take advantage of 1 CPU in this example, leading to underutilization. By rounding it up, we augment the pressure on the OS threads scheduler, but even in the worst case scenario (`--cpus=1.000000001` previously being rounded to 1, now rounded to 2), we do not observe any overutilization of the CPU leading to performance degradation. * Teach the ThreadPool of CPU limits By making sure we do take the CPU limits into account when computing the CPU busy time, we ensure we do not have the various heuristic of the threadpool competing with each other: one trying to allocate more threads to increase the CPU busy time, and the other one trying to allocate less threads because there adding more doesn't improve the throughput. Let's take the example of a system with 20 cores, and a docker container with `--cpus=2`. It would mean the total CPU usage of the machine is 2000%, while the CPU limit is 200%. Because the OS scheduler would never allocate more than 200% of its total CPU budget to the docker container, the CPU busy time would never get over 200%. From `PAL_GetCpuBusyTime`, this would indicate that we threadpool threads are mostly doing non-CPU bound work, meaning we could launch more threads.
2019-04-05Fix invalid use of stack memory (#23758)Aaron Robinson1-18/+16
* Fix invalid use of stack memory
2019-04-05Revert optimization (#23759)Grant1-11/+11
2019-04-04Disable marshalling delegates as _Delegate and enable marshalling delegates ↵Jeremy Koritzinsky4-10/+49
as IDispatch. (#23738) * Disable marshalling delegates as _Delegate and enable marshalling delegates as IDispatch. * ifdef out the new IDispatch marshalling on non-COM-supporting platforms. * PR feedback.
2019-04-04Improve performance of Memory<T>.Span property getter (#23750)Levi Broderick2-6/+22
2019-04-04Merge pull request #23633 from dotnet/NullableFeatureSantiago Fernandez Madero450-2599/+2969
Nullable feature into master
2019-04-04Fix Debug.Assert in GenericDelegateCache (#23755)Santiago Fernandez Madero1-1/+1
2019-04-04Fix SystemV AMD64 Explicit structure classification (#22041)Jeremy Koritzinsky5-147/+253
* Don't bail out on enregistering explicit structs if there are no overlapping fields. * Don't enregister if any unaligned fields. * Enable passing explicit structs by-value by enregistering on systemv. Some edge cases are likely still broken, but just removing our blanket opt-out makes the current tests pass. * Enable MarshalstructAsLayoutExp off-Windows. * Start adding additional tests for explicit layout to try to catch edge cases in SystemV classification. * Added a test that spans across multiple eightbytes and has an overlap in the second eightbyte. * Change repro to use an array of floats and an int field in managed and use a float array for padding in native to force an SSE classification on the first byte. * New algorithm to calculate eightbyte classification by going throw the structure byte-by-byte instead of field-by-field. * Fix updating eightbyte classifications in the loop to actually used the iterated-upon variable. * Consider each element of a fixed array as a separate field (to match native implementations). * Implement correct SystemV classification for fixed buffers in non-blittable structures. Fixed buffers in blittable structures have the managed layout assign classifications, which still is buggy. * Add tests. * Correctly classify blittable fixed buffers. Move "is this field a fixed buffer" tracking into one of the unused bits in FieldDesc as code that isn't in marshalers needs to know about it. * Handle the case where we have a struct that has no fields in an eightbyte that contains (i.e. no fields in the first eight bytes of the structure). * PR feedback. * Only look up FixedBufferAttribute when the type is a value class and the type of the field is a value type. * Use heuristic to determine if a type is a fixed buffer for SystemV classification. * Revert tracking if a field is a fixed buffer in the FieldDesc. * Update comments. * Classify aligned, nonoverlapping, float/double only structures as HFAs even if explicitly laid out * Enable overlapping fields in HFAs. Update NativeType HFA to check for alignment. I checked Godbolt to verify that HFAs for overlapping fields are allowed. * Add HFA tests. * Fix compile errors from HFA alignment check. * Non-valuetypes will never have their managed layout used to classify SystemV eightbytes. * Don't classify a struct with no zero-offset field as an HFA. * Remove duplicate semicolon. * PR feedback. * Add test with 2-field double HFA. * Clean up and add static asserts for struct size. * Add define for static_assert_no_msg to the native test headers * Fix build breaks. * Remove unneeded "size = X bytes" comments. They were holdovers from the .NET Framework test tree. * Use GetNumInstanceFieldBytes instead of GetLayoutInfo()->GetManagedSize() * Fix build break. * Centralize FieldMarshaler offsettting in ClassifyEightBytesWithNativeLayout. * Fix signed/unsigned mismatch * Fix condition to also detect arm64. * Change ifdef to if defined. * Remove duplicate declaration (broken in rebase) * Add some logging in one of the unreproable OSX test failures. * Mark System.Numerics.Vector as intrinsic and don't use the eightbyte classifier to enregister it. * Also explicitly opt-out of HFAs for System.Numerics.Vector`1 for consistency. * Update R2R required version to 3.0. * Remove debugging prints.
2019-04-05Merge pull request #23537 from janvorli/remove-gc-cpu-group-knowledgeJan Vorlicek17-483/+955
Remove CPU groups notion from the gc.cpp
2019-04-04Fix merge conflicts on Delegate and String.resxSantiago Fernandez Madero3-100/+57
2019-04-04Merge remote-tracking branch 'dotnet/master' into merge-master-nullableSantiago Fernandez Madero164-4667/+2005
2019-04-04Runtime support for upcoming .NET Core WinRT Host (#23402)Jeremy Koritzinsky22-27/+187
* First pass at adding winrt host entry-point. * There's no way to specify HResult-swapping on a function called via hosted-interop so just return the HResult instead. * Use the WindowsRuntimeMarshal class to create the activation factory and initialize it. * Implement loading the dependent assemblies of a WinRT assembly into an isolated load context. * PR Feedback. * Fail to get the activation factory if the found type is not a managed type exported from a winmd. * Rearrange parameters based on PR feedback. * Remove unneeded include. * Make ActivationFactoryLoader internal. * Fix null-ref in WinRT-dependent-assembly loading * Remove extraneous "System."
2019-04-04Support simple assembly name in startup hook (#23517)Jan Kotas2-20/+89
* Add support for specifying only assembly name for startup hook. * Implement checking for simple assembly names in startuphook. Also wrap load exceptions. * Avoid global alloc * Allow extra path separators in the startup hook variable * Fixes for extra path separators
2019-04-04Merge pull request #23721 from janvorli/fix-musl-arm64-crossbuildJan Vorlicek1-1/+1
Fix MUSL ARM64 cross build
2019-04-04Add Working Set runtime counter (#23717)Sung Yoon Whang1-0/+2
* Add cpu counter * Fix windows build * Make the counter just return current CPU usage as % * Add Unix * Fix unix build * Some cleanup * rename * fixing some build errors * some cleanup * remove unused using * more cleanup * newline * Add working set counter * Remove old file
2019-04-04Fix build break due to conflicting PRs (#23726)Stephen Toub3-10/+9
2019-04-04Improve Upper Vector Save/Restore (#23344)Carol Eidt8-233/+561
Improve Upper Vector Save/Restore In order to avoid saving and restore the upper half of large vectors around every call even if they are not used, separately model the upper half of large vector lclVars, and track whether the large vector lclVar is partially-spilled, in which case its upper half resides in its upper half Interval's location. Fix #18144
2019-04-04Handle local struct pointer arithmetic (#23704)Carol Eidt1-13/+5
The assert introduced in #23570 was overly aggressive, and didn't account for the fact that pointer arithmetic can exist in the IL, not just introduced by morph. Fix #23693
2019-04-04Move parts of delegate to shared partition (#23552)Marek Safar4-172/+129
2019-04-04Fix MUSL ARM64 cross buildJan Vorlicek1-1/+1
There were two issues: * the cross/toolchain.cmake was unconditionally setting the linker to ld.gold. This is not wanted in general and the ld.gold cannot link arm64 MUSL stuff correctly (it leaves a couple of TLS symbols as undefined) * the src/vm/arm64/asmhelpers.S was referencing a global variable using absolute relocation, which is not allowed in shared libraries on MUSL based Linux distros.
2019-04-04Don't null out buffer in MemoryStream on Capacity reset (#23700)Stephen Toub1-1/+1
2019-04-04Modify affinity range config format for WindowsJan Vorlicek9-30/+195
Each entry has to be prefixed by group number followed by comma. There is nothing like global CPU index on Windows, all the APIs that support more than 64 processors use group, in-group index pair. So specifying the affinity this way matches what users are used to.
2019-04-04Fixes for extra path separatorsVitek Karas2-6/+7