Age | Commit message (Collapse) | Author | Files | Lines |
|
* 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()`
|
|
Block the hoisting of TYP_STRUCT rvalues in loop hoisting
|
|
Enable CLR write watch for ARM64 Windows
|
|
Added test case GitHub_23739.cs
|
|
Add Large pages support in GC
|
|
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.
|
|
Fix ARM32/ARM64 large frame stack probing
|
|
|
|
Fix conversion warning
|
|
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`.
|
|
|
|
* Normalize directory separators when loading native library via ALC.LoadUnmanagedDllFromPath
|
|
* Remove remaining devdocs and cleanup ComponentModel code
|
|
MEMBARRIER_CMD_PRIVATE_EXPEDITED if available (#23778)
Basically a port of https://github.com/dotnet/coreclr/pull/20949 to GCToOSInterface
|
|
* 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.
|
|
|
|
|
|
Fix for Issue #23538
|
|
|
|
|
|
In case you would have UINT32_MAX - 1 CPUs, you would round up to return UINT32_MAX CPUs.
|
|
|
|
(#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
|
|
(#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.
|
|
|
|
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.
|
|
Fixes #23538
|
|
* 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.
|
|
* Fix invalid use of stack memory
|
|
|
|
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.
|
|
|
|
Nullable feature into master
|
|
|
|
* 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.
|
|
Remove CPU groups notion from the gc.cpp
|
|
|
|
|
|
* 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."
|
|
* 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
|
|
Fix MUSL ARM64 cross build
|
|
* 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
|
|
|
|
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
|
|
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
|
|
|
|
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.
|
|
|
|
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.
|
|
|