summaryrefslogtreecommitdiff
path: root/src/vm/class.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-08-19Use function-local StackingAllocator for EnC added methods (#26256)Juan Hoyos1-2/+6
As adding EnC methods happens on the Debugger Thread, there's no managed Thread object from which to obtain the cached StackingAllocator. Instead, just use a function-local StackingAllocator.
2019-05-24Set the HasExplicitSize flag when a class size is specified in metadata. ↵Jeremy Koritzinsky1-0/+7
(#24763) * Set the HasExplicitSize flag when a class size is specified in metadata. * Add test from @mikedn.
2019-05-20Cuckoo metadata (#24498)David Wrighton1-3/+2
* Basic infra for cuckoo filter of attributes - Implement cuckoo filter lookup logic - Implement new ready to run section - Add dumper to R2RDump - Parse section on load into data structure - Implement function to query filter - Add concept of enum of well known attributes - So that attribute name hashes themselves may be cached * Wrap all even vaguely perf critical uses of attribute by name parsing with use of R2R data * Update emmintrin.h in the PAL header to contain the needed SSE2 intrinsics for the feature - Disable the presence table for non Corelib cases. Current performance data does not warrant the size increase in other generated binaries
2019-05-16Split the phases of EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing ↵Jeremy Koritzinsky1-495/+445
(#23013) * Split the phases of EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing into separate private static functions. * Combine native and managed-sequential field offset and size calculations (since they are the exact same algorithm) * Remove TypeLayoutHelper because it's was only used in CalculateSizeAndFieldOffsets after having combined the offset/size calculations. * Remove unused members in LayoutRawFieldInfo. * Comment boolean parameter. * Add comments to parameters. * Remove unused prototypes. * Make sure we consistently use managed in the managed paths and native in the native paths. * Add to m_numCTMFields instead of setting it (need to make sure we account for fields in a non-trivial parent). * Track native alignment in a field. * Refactor field placement info to remove lots of repeated branching. * PR Feedback.
2019-05-08Remove more MDA support code (#24457)Steve MacLean1-0/+1
* Remove more MDA support code * PR Feedback
2019-04-25Improve the performance of the type loader (#24177)David Wrighton1-3/+5
Improve the performance of the type loader - Disable interface ambiguity checks in Corelib - Improve StackingAllocator perf - Increase size of allocation blocks - Cleanup allocation blocks comletely on gc suspension - Check for presence of generic parameters to methods in a more efficient manner - Querying the count of GenericParameter records requires a binary search in the GenericParams table - Checking the generic flag on the method signature is effectively free - Skip unnecessary checks in EnumerateClassMethods for corelib - Use Sanity check flag where appropriate - Use slightly faster hashtable functions in StringLiteralMap - Remove pointless string literal entry hash table search - Change stacking allocator to not be allocated for the lifetime of a thread, but instead its allocated/destroyed around the first frame on the thread that needs the allocator. - Allocate at most 1 stacking allocator per thread - The allocation is on the stack via _alloca (as managed by the ACQUIRE_STACKING_ALLOCATOR macro - This will put an 8KB buffer on the stack, and if there is need for a larger buffer it will allocate off of the heap. - Stacking allocator initial block is always present, so the allocation routine for the allocator can be somewhat simpler - More logic has been move the the cpp file, to reduce header bloat, and improve iteration when modifying StackingAllocator code - Avoid use of alloca for StackingAllocator when less than 512KB of stack is available
2019-04-16Arm64 vector ABI (#23675)Carol Eidt1-26/+139
* Support for Arm64 Vector ABI Extend HFA support to support vectors as well as floating point types. This requires that the JIT recognize vector types even during crossgen, so that the ABI is supported consistently. Also, fix and re-enable the disabled Arm64 Simd tests. Fix #16022
2019-04-04Fix SystemV AMD64 Explicit structure classification (#22041)Jeremy Koritzinsky1-8/+30
* 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-03-04Move EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing to class.cpp (#22932)Jeremy Koritzinsky1-0/+700
Move `EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing` to class.cpp and out of fieldmarshaler.cpp. This change co-locates `EEClassLayoutInfo::CollectLayoutFieldMetadataThrowing` with the rest of the implementation of `EEClassLayoutInfo`. Additionally, this PR separates out the field blittability check into a separate function instead of burying it in `CollectLayoutFieldMetadataThrowing`. Finally, it adds a small optimization in the field marshaler implementations where if a field's native size is statically known, the code returns that value instead of calling into one of the FieldMarshaler "virtual" calls. Originally part of #21415, but extracted out to make that PR smaller.
2019-01-23Remove all traces of FEATURE_STACK_PROBE. (#22149)Filip Navara1-4/+0
2018-11-09Delete dead/unreachable code related to remoting (#20880)Jan Kotas1-5/+0
2018-10-05Remove context statics stuff (#20256)Jan Vorlicek1-3/+1
* Remove context statics stuff part 1 This change removes all context statics stuff from the runtime since context statics are not supported and this code was obsolete. * Remove context statics stuff from the debugger code
2018-06-15Delete bitrotten appdomain agility checks (#18489)Jan Kotas1-474/+0
Fixes #18484
2018-06-09Avoid NativeOverlapped pinning by allocating unmanaged memory for it (#18360)Jan Kotas1-15/+1
It makes PinnableBufferCache unnecessary
2018-06-04Work in VM towards cross-bitness crossgen (#18245)Egor Chesakov1-2/+2
* Replace sizeof expressions with target-specific constants: * sizeof(ObjHeader) -> OBJHEADER_SIZE * sizeof(Object) -> OBJECT_SIZE * ObjSizeOf(Object) -> OBJECT_BASESIZE * sizeof(ArrayBase) -> ARRAYBASE_SIZE * ObjSizeOf(ArrayBase) -> ARRAYBASE_BASESIZE * Remove ObjSizeOf macro * Use OBJECT_SIZE in ArrayBase::GetBoundsOffset * Cast ppObj to CORCOMPILE_GCREFMAP_TOKENS* before dereferencing in FakePromote * LOG2_PTRSIZE should depend on _TARGET_64BIT_
2018-02-28Replace ambiguous _WIN64 and BIT64 with _TARGET_64BIT_ macroEgor Chesakov1-4/+4
2018-02-22Remove relocations for MethodTable::m_pParentMethodTable for Linux ARM (#15915)gbalykov1-1/+9
2018-01-22Merge pull request #15942 from tannergooding/no-multireg-simdTanner Gooding1-0/+14
Updating the VM to no longer treat the SIMD HWIntrinsic types as HFA or MultiReg structs
2018-01-21Remove AppDomainLeaks configuration option (#15956)antofik1-2/+2
Removed all usages of AppDomainLeaks configuration option and CHECK_APP_DOMAIN_LEAKS feature Fix #12094
2018-01-19Updating the VM to no longer treat the SIMD HWIntrinsic types as HFA or ↵Tanner Gooding1-0/+14
MultiReg structs.
2018-01-13Revert "Remove relocations for MethodTable::m_pParentMethodTable for Linux ARM"Jan Kotas1-9/+1
This reverts commit cf1fb9e17fc8b6ee849edab5a696d0ec5c6eadd2.
2017-09-27Fix issue with HFA altjit apiBruce Forstall1-1/+8
One case in the Interop\ArrayMarshalling\ByValArray\MarshalArrayByValTest\MarshalArrayByValTest.cmd test marshals an array of strings as members of a struct. The !FEATURE_HFA code for IsHFA() needs to check for value type before calling CheckForHFA(), which will assert if it is not a value type. Fixes #14196.
2017-08-30Fix a typoCarol Eidt1-2/+1
2017-08-30Support checking for HFA types in altjitCarol Eidt1-2/+223
When using an HFA altjit with a non-HFA coreclr, `FEATURE_HFA` will not be defined in the runtime. In this case, instead of caching the information on the `MethodTable`, it will be recomputed for every call to query for an HFA type or to get the base element type. In order to do this, the functionality must be available on a built class, so implement these methods on `EEClass` instead of `MethodTableBuilder` (which was already using `GetHalfBakedClass()` to access some of the `EEClass` functionality). Fix #13092
2017-08-08Merge pull request #12168 from gbalykov/remove-relocations-readonlyBruce Forstall1-3/+14
Partially remove relocations from SECTION_Readonly
2017-08-07Cleanup code access security from the unmanaged runtime (#13241)Jan Kotas1-6/+0
2017-07-10Remove relocations for MethodTable::m_pParentMethodTable for Linux ARMGleb Balykov1-1/+9
2017-07-10Remove relocations for MethodTable::m_pPerInstInfo for Linux ARMGleb Balykov1-2/+5
2017-06-27Partially remove relocations from Class section of NGEN-ed images (#11962)Ruben Ayrapetyan1-4/+4
* Remove relocations for ParamTypeDesc::m_TemplateMT. * Remove relocations for LayoutEEClass::m_LayoutInfo.m_pFieldMarshalers. * Prepare RelativeFixupPointer. * Remove relocations for FieldMarshaler::m_pFD and FieldMarshaler_*::m_*.
2017-06-13Partially remove relocations for ModuleSection (ZapVirtualSectionType). (#11853)Ruben Ayrapetyan1-7/+7
2017-02-14Remove never defined FEATURE_REMOTINGdanmosemsft1-9/+0
2017-02-12Remove never defined FEATURE_CER and headerdanmosemsft1-9/+0
2016-12-19Fix the bug that Secure Delegate Stubs are compiled every time. (#8592)Sujin Kim1-0/+1
* Fix the bug that Secure Delegate Stubs are compiled every time. I found that Secure Delegate stubs are compiled every time during application execution, which has a negative impact on execution performance. #8554 Like the GetMulticastInvoke() method, GetSecureInvoke() checks the hashtable when the method is executed and uses it if it already exists. * Fix pDelMT bug and change file rights
2016-11-29Disable CER feature as it is not used (#8218)John Chen1-0/+3
Use FEATURE_CER to scope CER code, and disable CER feature in CoreCLR.
2016-03-09Delete dead codeJan Kotas1-1281/+0
- Delete BINDER, STANDALONE_BINDER and MDIL ifdefs
2016-01-27Update license headersdotnet-bot1-4/+3
2015-10-20Implementation of System V ABI struct passing.Lubomir Litchev1-1/+1
This PR adds support for System V x86_64 ABI classification and calling convention to the VM and the Jit, including, but not limited to Ubuntu Linux and Mac OS X. The general rules outlined in the System V x86_64 ABI (described at http://www.x86-64.org/documentation/abi.pdf) are followed with a few little exceptions, described below: 1. The hidden argument for by-value passed structs is always after the ÎéÎíthisÎéÎí parameter (if there is one.). This is a difference with the Sysetem V ABI and affects only the internal jit calling conventions. For PInvoke calls the hidden argument is always the first parameter since there is no ÎéÎíthisÎéÎí parameter in this case. 2. Managed structs that have no fields are always passed by-value on the stack. 3. The jit proactively generates frame register frames (with RBP as a frame register) in order to aid the native OS tooling for stack unwinding and the like.
2015-04-28Updating WinRT Projections to use FacadesRyan Byington1-1/+1
WinRT projections currently depend on implementation assemblies like System.Uri living in System.dll. System.Uri has already been moved out of System.dll to Internal.Uri.dll which breaks the projection for System.Uri. This change updates the WinRT projection to understand Facades like System.Runtime to resolve System.Uri. When we load a type like System.Uri we need to know if it is a projected type. We currently do this by comparing the namespace plus type name and assembly however this only works because we know the implementation assembly at compile time. I am changing it so that we use ClassLoader to resolve the typedef and assembly and compare the resolved assembly with the current one. Also removing the cached assemblies as they don’t add a lot of value anymore. [tfs-changeset: 1461733]
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+4746
[tfs-changeset: 1407945]