Age | Commit message (Collapse) | Author |
|
Removes SerializableAttribute from CoreCLR types not intended to be serializable as well as adding special handling to MulticastDelegate to prevent serializing delegates (which can't be correctly serialized cross platform/runtime).
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
|
|
* Optimize ObjectWriter to emit series of bytes
Writing each byte of an `ObjectNode` out to the object file one by one
is inefficient. We also cannot emit all the bytes of an `ObjectNode` at
once because of the streaming nature of the LLVM API. Relocs, CFI info,
and symbol definitions are all interruptions emitted at specific points
in the stream. Optimize the current implementation by calculating the
longest run of bytes between each required interruption.
Testing on a large app, ASP.NET Core, this yields a 4% reduction in
total compilation time. The total time to compile (collected in Release
mode averaged over 5 runs) decreased from 31611ms to 30345ms. A further
gain may be possible when we get a high performance implementation of
Span<T>, able to efficiently pin the byte arrays we pass to native.
|
|
Building against the lightweight version of S.P.CoreLib has bitrotted
over the past year. The classlib is handy for codegen and architecture
bringups and we might want to use it when getting rid of ready to run
helpers.
|
|
Make metadata generation dependency driven
|
|
* Update Unix SafeHandle to throw NotFound correctly
Need to match Windows semantics for missing files. This means throwing
FileNotFound only if the last segment of the path can't be found.
* Dispose handle and trim ending separator properly
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
Signed-off-by: UIDL YGEN <uidlygen@yandex.ru>
|
|
This api was approved here:
https://github.com/dotnet/corefx/issues/5884
and is a necessary step to fixing the System.Dynamic.Runtime.Tests
failure:
https://github.com/dotnet/corefx/issues/19895
which is caused by Microsoft.CSharp trying to do the impossible
and emulate this api without GetMetadataToken() support.
This approach opts for the most straightforward and efficient
implementation without any special-casing for weird situations
(this is also what Microsoft.CSharp implements today as
well as what someone else trying to trampoline members
across generic instantaitions is like to do.)
This results in the following behavior for these
corner cases. With the possible exception of #3,
I think they are tolerable enough to accept and codify:
1. "other" implemented by an entirely different Reflection
provider than "this".
Behavior:
returns false without invoking any methods on the
"other" Member.
To change it to throw an ArgumentException would
mean extra cast checks against the 6 possible
Runtime types (or having said RuntimeTypes implement
a sentinel interface.)
Given that HasSameMetadataDefinitionAs() is a
"looser cousin of Equals()" and "Equals()"
doesn't throw for objects from a different universe,
this seems reasonable.
2. Arrays, ByRefs, Pointers and Types from GetTypeFromCLSID()
Behavior:
Arrays, ByRefs, Pointers all return token 0x0600000
and so they'll return "true" wrt to each other (provided
both types are implemented by the same provider.)
CLSID types all return the typedef of __ComObject
so they'll return "true" wrt to each other.
The constructor exposed by CLSID types all return
the typedef of some constructor on __ComObject so
they'll return "true" wrt to each other.
I do not think these are interesting cases that merit
special handling. These types will never appear
in an enumeration of the members of a type. (The
fact that Reflection surfaces them in objects
that are assignable to MemberInfo is a structural
flaw in Reflection's object model.)
3. Synthesized constructors and methods on array types.
Behavior:
These methods all return 0x06000000 as a token
so the constructors will all compare true wrt
each other, and likewise with the methods.
This is a bit crummy though it's not clear
what the "right" policy should look like.
I could be persuaded to throw NotSupported
for these, to leave the possibility open
for a better story later. On the other hand,
I wouldn't demand it either.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
This lets RyuJIT optimize range checks on Span same way as it does for
arrays.
* Annotate the intrinsics
* Uncomment them in the table
* Report `sigInst` for all intrinsics
|
|
Merge nmirror to master
|
|
CastingHelper (#3666)
* Handling interface->object assignment + test
* Adapted logic in CanCastToClass and use CastingHelper.CanCastTo in IsAssignable(TypeDesc src, TypeDesc dst)
|
|
This was needed when we weren't using the type loader to load invoke
stub dictionaries. This hasn't been needed for months.
|
|
* Add PreInitFieldInfo that extracts preinitialized data information from fields that have [PreInitialized] and [InitDataBlob] pointing to RVA field
* Added FrozenArrayNode for frozen arrays with data extracted from preinit RVA data field
* Added GCStaticsPreInitDataNode (CoreRT only) to hold GC pointers for GC static fields. Pre-init data fields points to frozen data, while other data initialized to null.
* Changed GCStaticsNode to emit a pointer reloc to GCStaticspreInitDataNode and mask 0x2 for the GC static EEType.
* Changed InitializedStatics in StartupCodeHelper to check for 0x2 and memcpy the GC field data as needed
* Fixed a bug in bad GCStaticsEETypeNode size calculation - it's off-by-1 as static GC static field layout in CoreRT includes EEType already.
|
|
Generic interface types have a generic dictionary slot like any other
type, except sometimes the slot is null.
We can now call static methods on generic interfaces with a usable
generic context.
Got reminded of this while reading about the planned C# language support
for static methods on interfaces. I didn't want to push on it when #3100
added the logic, but it turns out this is really easy.
|
|
This is in preparation to moving reflection metadata analysis to the
scanning phase.
* Metadata needs are modeled in the dependency analysis engine:
`TypeMetadataNode`/`MethodMetadataNode`/`ModuleMetadataNode` now model
the metadata needs of individual types. We no longer use list of
generated EETypes/Methods to drive metadata generation.
* Dependencies of custom attributes are now correctly modeled. We no
longer end up with custom attributes that are useless at runtime and
crash with TypeLoadExceptions (cough, in ResourceManager, cough)
* Reflection blocking now applies when emitting invoke mapping tables
* MetadataBlocking policy is now a reusable object (we'll need to reuse
it between the metadata manager used for scanning for reflection use and
metadata manager used at compile time when we no longer analyze
reflection).
* We now correctly filter special methods that are not eligible to be in
the mapping tables (cctors, finalizers, etc.).
|
|
With some changes I have in flight `GetFinalizer` in compiler traces
went from "might be worth looking into making this faster" to "we spend
15% of compilation time here".
The answer to `HasFinalizer` is cheap to cache and reduces the pressure
on `GetFinalizer` significantly.
|
|
[tfs-changeset: 1658968]
|
|
[tfs-changeset: 1658966]
|
|
We'll want to allow compiler driver users to pick and configure the
metadata manager to their liking.
|
|
|
|
* Make calling Rank 1 MdArray ctor more reliable. This is not a great
fix (great fix would be one of the two options I enumerated in #3610),
but at least makes the problem go away. It's unlikely anyone is going to
use this anyway.
* Fix exception types we throw.
|
|
Merge nmirror to master
|
|
|
|
[tfs-changeset: 1658863]
|
|
FileBasedResourceGroveler.FindResourceFile.
Implementing File.Exists brought in the majority of the changes, which includes the added structs, attributes, and native calls to KERNEL32. The majority of these additions were copied straight from CoreFX.
Note: On Unix, this File.Exists implementation throws NotImplementedException.
Types/Methods added:
shared/
- Interop.Kernel32.FileAttributes
- Interop.Kernel32.FindClose
- Interop.Kernel32.FindFirstFile
- Interop.Kernel32.GetFileAttributesEx
src/
- Microsoft.Win32.SafeHandles.SafeFindHandle
- System.IO.File (for internal use)
- System.Runtime.InteropServices.BestFitMappingAttribute (relocated from S.P.Interop)
[tfs-changeset: 1658849]
|
|
[tfs-changeset: 1658843]
|
|
[tfs-changeset: 1658842]
|
|
* update ObjectWriter
* small types fixes
* CodeView: ArrayType
* Use mangled names
CV has unique indexes and use them to link types inside, but somehow
not-unique names create conflicts. Use mangled names to avoid them.
* Use an Object Initializer
|
|
computed results (90% perf improvement on Release builds for the ASPNet benchmark app (22 mins to 2 mins total compile time) (#3652)
|
|
[tfs-changeset: 1658797]
|
|
|
|
Merge nmirror to master
|
|
This project builds quickly and building it avoids unpleasant surprises coming through the mirror.
[tfs-changeset: 1658774]
|
|
* ILVerify Readme: added additional resources
|
|
Passing a negative length to an api that creates multidim
arrays throws OverflowException rather than ArgumentOutOfRangeException
(presumably due to the assumption that we overflowed while computing
the size rather than a specific bad length being passed in.)
|
|
Missed one check.
|
|
apparently in the failing cases, the IAT table has been corrupted.
It seems better to fail fast in these cases rather than to AV, or, even worse, crash later in even more confusing ways.
As there are already a bunch of ASSERTs in this code to sanity-check the IAT, it seems safest to turn the ASSERTs into conditional fail fast calls that are active in release build as well.
[tfs-changeset: 1658735]
|
|
- Instead of performing lazy lookups at individual use sites, perform a single lazy lookup to get a dictionary, and then use normal canonical lookups from there
- Shares logic with USG dictionary acquisition, and with normal canonical codegen
- Add LazyGenericPolicy nob to CoreRT environment to control policy
Universal Shared Generics Changes
- Fixup EETypeNode generation for USG types
- Consider TemplateTypeLayout necessary for all universal generic canon types
- Use RhAllocLocal2 which returns a byref to the first field of the "local" object instead of the start of the object.
- Tweak USG field invoke map generation to not stop compilation. Still needs to be implemented.
[tfs-changeset: 1658670]
|
|
Merge master to nmirror
|
|
My previous checking in breaks projectx scenario, since I added one pinvoke RoParseTypeName whose function doesn't exists in current testilc lib folder.
if a pinvoke with [McgGeneratedNativeCallCodeAttribute] , mcg will just skip this pinvoke
if a pinvoke without [McgGeneratedNativeCallCodeAttribute], it will do runtime loading if you enable loadlibrary on runtime
[tfs-changeset: 1658653]
|
|
Fix compilation failures appearing in the ToF JIT category.
[tfs-changeset: 1658610]
|
|
|
|
Merge nmirror to master
|
|
See #19738. Note that the enumerable is only used on Unix- but updated
it anyway. Conditioned the set/unset for ! Unix. SetErrorMode in the
PAL is a no-op, want to use the shared interop.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
* Get rid of for loop in StartImportingBasicBlock() and take advantage of EH Indexes on BasicBlock
* Reverted to for loop in StartImportingBasicBlock for try blocks
|
|
|
|
Fix EventSource Test Breaks in CoreFX
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
|
|
* Fixes #3568
* Added optional throwIfNotFound to reflect optional types in the TypeSystemContext interface
* Only System.Object is required - all other types are optional
|
|
Change Description:
The change is to add Type->TypeName and TypeName->Type marshalling support.
Changes:
1. in Projection.cs: add a winrt type name for these projection types
2. in WellknownOpenGenericType.cs, track all of these 'winrt' generic types
3. InteropExtensions.GetGenericArgumentCount is to fetch type argument count from a genericTypeDefinitionHandle(or open generic type)
4. Add Pinvoke RoParseTypeName to parse(or split) type name
5. McgModuleManager.cs: Hook up GetTypeName() and GetTypeFromName()
6. McgTypeHelpers.cs: Add IsWinRTPrimitiveType and IsWinRTPrimitiveType() method to determine whether a type is winrt primitive type
7. Update DynamicGuid to use WellknownOpenGenericType
[tfs-changeset: 1658461]
|
|
|