Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master to nmirror #7305

Merged
merged 58 commits into from Apr 15, 2019

Conversation

Projects
None yet
@MichalStrehovsky
Copy link
Member

MichalStrehovsky commented Apr 15, 2019

No description provided.

trylek and others added some commits Apr 12, 2019

Improving PE section management in CPAOT (#7282)
The ability to use SuperIlc to ILC the entire Pri#1 test suite
let me quickly identify several remaining CPAOT compilation
issues. This change should be fixing the biggest bucket of 8
failing compilations.

As in contrast to Crossgen we don't copy the input MSIL
selectively to the output R2R PE image (which may change soon
with Simon's latest changes), in case of RVA fields we just
store the section name in which the field content resides
and, when serializing the sections to the output PE, we
resolve the appropriate SectionStartNode's in the symbol map
for the relocation pass.

As the R2R PE emitter is basically the oldest part of the CPAOT
compiler, I was naturally making various arbitrary choices during
its initial implementation and because of this the section
management logic ended up somewhat randomly scattered among
ReadyToRunObjectWriter, SectionBuilder and R2RPEBuilder.

The SectionBuilder only knew about the sections emitted by
the CPAOT compiler itself, not about the incoming sections from
the input MSIL; those got only combined with the SectionBuilder
sections in R2RPEBuilder constructor.

Due to this fact the section serialization code in SectionBuilder
didn't know about the MSIL section holding the RVA field (as it
wasn't one of the sections produced by the CPAOT compiler) and
so it didn't resolve its start node in the symbol map.

To fix this, I have centralized the logic for building the list
of output sections in SectionBuilderExtensions.PrepareSections
where we compose the complete section list upfront and set it
to SectionBuilder. R2RPEBuilder constructor can be much simpler
as it can reuse the SectionBuilder section map and the section
start nodes get properly resolved even for the MSIL input
sections.

As described in previous commits on this PR, investigating this
issue made me realize the interplay between ReadyToRunObjectWriter,
R2RPEBuilder and SectionBuilder is overcomplicated and non-intuitive.
Based on my offline discussion with Simon I have made the following
steps to improve the state of affairs:

1) The gist of my change is that the R2RPEBuilder class, which was
previously used just as an internal helper by
SectionBuilderExtensions.EmitR2R, becomes the R2R-specific
encapsulation of SectionBuilder. ObjectWriter no longer explicitly
instantiates SectionBuilder, instead it constructs the R2RPEBuilder
and communicates construction of the R2R PE executable with it.

2) I have completely deleted SectionBuilderExtensions. They didn't
belong to the source file SectionBuilder.cs anyway (as they were
tied to R2R, not to SectionBuilder which is R2R-agnostic by itself)
and they are much easier to implement as members of the beefed up
R2RPEBuilder class.

3) I have partially reverted my previous changes on this PR by
beefing up the R2RPEBuilder constructor with the section preparation
logic I had previously moved to
SectionBuilderExtensions.PrepareSections. In combination with the
other rearrangements I believe it's now much more logical. The
EmitR2R function became R2RPEBuilder.Write.

Thanks

Tomas
Delete ManualResetEventSlim.cs (#7291)
We use the copy in the `shared` directory.
Merge pull request #7293 from dotnet/nmirror
Merge nmirror to master
Add optimized UTF-8 validation and transcoding logic - Hook it up thr…
…ough the existing Utf8 public static APIs - Move some shared methods out of ASCIIUtility - Hook it up through the Utf8String ctor

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Hook up new UTF-8 logic through UTF8Encoding - Add vectorized UTF-16 …
…validation and transcoded byte counts - Move Utf16Utility into Unicode namespace alongside Utf8Utility - Fix some bugs in DecoderNLS's draining logic

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Improve perf of "is ASCII?" inner loop in UTF-8 validation.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Remove SSE41.X64 optimization from AsciiUtility RyuJIT now handles th…
…is optimally

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Clarify that vector read is unaligned
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Simplify vectorized logic; remove unnecessary adjustment
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback: GetElement(0) -> Sse2.StoreLow
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback - Simplify CountNumberOfLeadingAsciiBytesFrom24BitInteger…
… - Extract some consts out to top of file w/ comments

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback: Enable SSE2 in Utf16Utility code
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Expand masks in Utf8Utility, fix const in fallback path
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Fix incorrect Debug.Assert statements
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Expose new EventCounter APIs (dotnet/coreclr#23808)
* rename BaseCounter to DiagnosticCounter

* Change MetaData->Metadata

* Make EventSource and Name a property for counter classes

* Make the counter APIs public

* fix build errors

* Change float to double

* Few cleanups, fix test

* fix GetMetadataString

* PR feedback

* More PR feedback

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Tweaking some APIs according to user feedback. (dotnet/coreclr#23857)
* Updating the Avx2.ConvertToVector256UInt APIs to return a signed type (matching the native signature and Sse41 APIs).

* Adding explicit overloads for `Sse41.ConvertToVector128Int*` and `Avx2.ConvertToVector256Int*` that take a pointer

* Updating the word ordering for the Compare/CompareScalar methods.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Update Range.GetOffsetAndLength (dotnet/coreclr#23855)
* Update Range.GetOffsetAndLength

Make it return offset and length tuple instead of the old Type Range.OffsetAndLength

* Fix the return Tuple fields names

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Make GC.GetGCMemoryInfo public (dotnet/coreclr#23779)
* Make GC.GetGCMemoryInfo public

This is to be used to allow users to optimize memory consumption based
on what's available to the GC and on the system.

This is based on dotnet/corefx#34631

* Address reviews

- Pass GCMemoryInfo struct to native in place of many arguments
- Make GCMemoryInfo.HeapSize and GCMemoryInfo.Fragmentation long in place of IntPtr

* Address reviews

- Mark GCMemoryInfo readonly

* Rearrange fields and match managed/native names

* Fix compilation

* Use getter shorthand

* Address API Design Review

dotnet/corefx#34631 (comment)

* Fix comments

* Fix comments

* Do everything in managed

* Address review

 - Remove unecessary [StructLayout.Sequential]
 - Remove "_" prefix for parameters variables

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Move TimerQueue.TickCount Windows implementation to shared CoreLib (#…
…23838)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Move AssemblyName to shared (dotnet/coreclr#23737)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Add comments tracking JIT workarounds.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Rename DWORD -> UInt32 throughout API surface
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Re-flow Utf8Utility.Helpers
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Contextual reflection (dotnet/coreclr#23740)
* Add ContextualReflection APIs

Add ContextualReflection APIs approved in dotnet/corefx#36236
Fix issue #22213

* SetParentAssembly even when IsCollectible()
* ContextualReflection tests

* PR Feedback
* Add more usage tests

Add using statement tests
Add bad usage tests including Assert.Throws<>

* Only initialize on set
* Add XML API comments
* Unify VerifyIsolation
* Fix unused expectedAssembly
* Remove ContextualReflectionScope throw
* Clean up TestResolveMissingAssembly et. al
* Remove unused QCall::AppDomainHandle
* Remove AppDomainBaseObject
* Pass AssemblyLoadContext as managed object to native
* Fix AssemblyLoadContextBaseObject packing

* AssemblyLoadContext backing stores

Use explicit backing stores for events and properties

* Remove StaticAsyncLocalCurrentContextualReflectionContext
* Remove PermissionSetObject

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback: Fix typos
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback: CountNumberOfLeadingAsciiBytesFrom24BitInteger
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback: Remove redundant endianess checks
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback: Validate nint definitions
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>

GrabYourPitchforks and others added some commits Apr 11, 2019

PR feedback: Clarify charIsNonAscii vector usage
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback: document tempUtf8CodeUnitCountAdjustment usage
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Fix compilation failure in Utf16Utility
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
PR feedback: Clarify 3-byte sequence processing
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Add missing check to 3-byte processing logic
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Clarify comment in 3-byte processing
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Fix Version's comparer operators to allow null (dotnet/coreclr#23898)
Previously for `<`/`<=` it would throw if `v1` argument was null, but for `>`/`>=` would throw if the `v1` argument was null, albeit using `v1` in the exception parameter name.  It's also not expected for comparisons like this to throw, in general.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Fix Assembly.LoadFromPartialName(string) (dotnet/coreclr#23912)
Assembly.LoadFromPartialName(string) should not throw FileNotFoundException, but
should rather return null.

ArgumentException should use nameof(partialName)

Fixes #19817

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Delete COMPlus_FinalizeOnShutdown (dotnet/coreclr#23595)
This compat quirk is increasingly more broken since the framework is generally not compatible with, and we have not heard anybody actually using it.

Changed Environment.HasShutdownStarted to unconditionally return false. It does not make sense for it to ever return true with shutdown finalization disabled.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Delete outdated comment
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Move DateTime Windows implementation to shared CoreLib (#23888)
* Move DateTime Windows implementation to shared CoreLib

* Make all the BOOL/struct marshalling explicit

* internal -> private

* Use unsafe code on all layers, remove unnecessary fixed blocks

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
EnterContextualReflection handle null (dotnet/coreclr#23953)
* EnterContextualReflection handle null

* Add ContextualReflection MockAssembly test

* Fix ContextualReflection typo

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Delete unused AssemblyName._hashForControl and related code (#23972)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Update BuildTools, CoreClr to preview4-03913-01, preview5-27612-73, r…
…espectively (master) (#23916)

* Update BuildTools, CoreClr to preview4-03913-01, preview5-27612-73, respectively

* Fix nullable build errors

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Enhance analysis of reflection dependencies (#7298)
EventSource reflects on method signatures that might refer to types we never heard about (they were never referenced from code in a way that would bring in the dependency). Bring the dependencies explicitly.
Add analysis of EventSource metadata (#7297)
Event sources should not be blocked, so we need to poke a hole through blocking. On Project N, there's a separate IL2IL transform that deals with framework-provided event sources to sidestep this - I don't think we want to replicate that.

Then we need to add special rule to make the compiler keep metadata for the magical nested types.
Group Task/Opcodes/Keywords in ClrThreadPoolEventSource (#7296)
EventSource requires these specially named nested types.
Remove old method names from Rune (dotnet/coreclr#23938)
* Remove old method names from Rune, reenable suppressed tests

* Revert re-enablement of failing ArraySegment tests

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Remove unused offset calculation (dotnet/coreclr#23793)
Utf8Parser has a redundant calculation of date time offset.

Fix #21834

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
improve entropy (dotnet/coreclr#23591)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Remove problematic characters in eventtrace.cpp (#7303)
The C++ compiler finds the typographic apostrophe disturbing.

`warning C4828: The file contains a character starting at offset 0x103e5 that is illegal in the current source character set (codepage 65001).`

@MichalStrehovsky MichalStrehovsky merged commit c599e69 into nmirror Apr 15, 2019

1 check passed

license/cla All CLA requirements met.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.