summaryrefslogtreecommitdiff
path: root/src/gcinfo/gcinfoencoder.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-05-14Fix issues reported by PREfast static analysis tool (#24577)Jan Kotas1-1/+1
2018-08-01Cross-bitness in GcInfoEncoder::Build() (#19206)Egor Chesakov1-54/+35
* Remove dead code in BitArray * Replace size_t with uint32_t in BitArray
2018-06-14clean up list of disabled warnings. (#18318)Sergey Andreenko1-3/+3
* delete warnings that do not longer exist For example C4171 was deleted after VS 6.0 (https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa233011(v=vs.60)) * delete C4206 fromm the list because its default value is 4, so this line is useless. * reenable warning as error. * enable warning C4430 and fix places that trigger it. * fix C4334 * format the list * fix ssize_t
2018-06-03Warnings cleanup (#18260)Robin Sue1-1/+1
* Cleanup all disabled warnings that do not trigger * Fix warning about line continuation in single line comment * Eliminiate all unreferenced local variables and reenable warning
2018-02-14Fix ARM/ARM64 hijacking in tail calls (#16039)Jan Vorlicek1-1/+21
* Fix ARM/ARM64 hijacking in tail calls This change fixes an issue that can happen when a function that has tail calls is hijacked. There are two potential issues: 1. When a function that tail calls another one is hijacked, the LR may be stored at a different location in the stack frame of the tail call target. So just by performing tail call, the hijacked location becomes invalid and unhijacking would corrupt stack by writing to that location. 2. There is a small window after the caller pops LR from the stack in its epilog and before the tail called function pushes LR in its prolog when the hijacked return address would not be not on the stack and so we would not be able to unhijack. The fix is to prevent hijacking of functions that contain tail calls. * Enable the tailcall hijacking test for ARM64 The test JIT/Methodical/tailcall_v4/hijacking should be passing now on ARM64.
2016-12-06GcInfoEncoder: Initialize the BitArrays tracking liveness (#8485)Swaroop Sridhar1-1/+2
The non-X86 GcInfoEncoder library uses two bit-arrays to keep track of pointer-liveness. The BitArrays are allocated using the arena allocator which doesn't zero-initialize them. This was causing non-deterministic redundant allocation of unused slots. This change fixes the problem.
2016-10-27Fixed gcinfoencoder build errors. (#7826)Jim Ma1-0/+8
MEASURE_INFO switch now depends on _DEBUG switch. Ensure NumUntracked, UntrackedSlotSize, NumUntrackedSize and EncPreservedSlots fields handled correctly in GcInfoSize::operator+=() and GCInfoSize::Log(). fix #6008
2016-10-24Add back call to BitArray::ClearAll (#7779)Jan Kotas1-0/+1
2016-10-23Delete DISABLE_EH_VECTORSJan Kotas1-131/+0
2016-08-24GcInfo: Don't use slim header for struct-returnsSwaroop Sridhar1-1/+2
This checkin has two changes: 1) Add a check to ensure that methods with struct-returns are use the fat header which encodes ReturnKind in 4 bits. 2) Fix a bug in GetReturnKind().
2016-08-05Implement GcInfo v2Swaroop Sridhar1-6/+57
Ref #4379 This change implements GcInfo version 2 for all platforms that use the GcInfo library (all architectures other than X86). Changes are: 1) Defines ReturnKind enumeration for all platforms 2) Change the GcInfo encoder library to encode the ReturnKind and ReversePInvokeFrame slot 3) Change the CM's GcInfo decoder to encode the ReturnKind and ReversePInvokeFrame slot for GCINFO_VERSION 2 4) Some corrections to GCINFO_MEASUREments 5) Changes to RYU Jit to provide the correct information to the encoder 6) Changes to the VM to use the ReturnKind information while hijacking a thread - If ReturnKind is available from GcInfo, new hijack routines are used - Otherwise, fall back to old method (for compatibility) 7) Rework and simplify the thread hijack routines by scanning HijackFrames directly for gcroots 8) Supporting code to implement the above features. Returning Structs in multiple registers Hijacking for StructInRegs is currently only implemented for Unix SystemV ABI Multi-reg struct returns. However, the hijack-workers that use ReturnKind are ready to handle other platforms (ex: ARM/ARM64 Windows) once the corresponding HijackTripThread() assembly routines are defined. The New feature flag: FEATURE_MULTIREG_RETURN is set for platforms where a struct value can be returned in multiple registers [ex: Windows/Unix ARM/ARM64, Unix-AMD64] FEATURE_UNIX_AMD64_STRUCT_PASSING is a specific kind of FEATURE_MULTIREG_RETURN specified by SystemV ABI for AMD64 Compatibility with other JITs - All new GCInfo generated by RYU Jit is in GcInfo version 2 - All Ngen images must be regenerated with the new GcInfo version. - Ready-to-run images with old GcInfo will continue to work. - Jit64/X64 uses the GcInfo library, so it generates GcInfo version 2. However, it doesn't (yet) provide the data to encode the correct ReturnKind Similar is the case for ARM32 code running on JIT32, and any other JITs that may be using GcInfo library but not yet modified to use the new API. So, compatibility is achived using RT_Unset flag. When ReturnKind is RT_Unset, it means that the JIT did not set the ReturnKind in the GCInfo, and therefore the VM cannot rely on it, and must use other mechanisms (similar to GcInfo ver 1) to determine the Return type's GC information. Implement GC root scanning for Hijack-frames This change implements GCScanRoots() method for Hijacke-frames based on the ReturnKind information available from the GcInfo. If the exact ReturnKind is not available in the GcInfo, the thread-suspension logic will compute the ReturnKind based on the method-signature. As a result of this change, several hijack-helpers in the VM are cleaned up. There's only one implementation of HijackWorker() to handle all returnKinds. This change also simplifies the thread-hijack logic by using a single assembly helper OnHijackTripThread() in most cases. The only other helper used is for X86 floating point return values for save/restoring the top of the FP stack. ARM64 Only GcIndfo v2 is reliably supported for ARM64 platform. The changes to thread-hijack mechanism fixes #6494 for ARM64. No measurable change in JIT throughput, performance or native-image size from this change.
2016-07-21Remove DBG GcInfo encoder/decoder (#6374)Swaroop Sridhar1-84/+0
This change removes the redundant set of GcInfo encoder/decoder in the CoreCLR tree called Debug encoder/decoders. These components are expected to be are well-tested versions for verification, but are not actively used. They cause additional overhead wrt maintaining two versions of GcInfo encoder/decoder as GcInfo format changes.
2016-04-19ARM64: Fix GC encoding settingsSwaroop Sridhar1-1/+3
This change fixes certain settings in the GCInfo encoder/decoders. It also fixes the debug info for the stack pointer.
2016-04-15Stop including utilcode.h in the GC info encoder.Pat Gavlin1-2/+7
This required two other minor changes: - A prototype for `ThrowOutOfMemory` is now defined in gcinfoencoder.h - `BitArray` now defines an overload of `operator new` that accepts an `IAllocator`.
2016-04-14Move `BitPosition` into its own file.Pat Gavlin1-0/+1
This will allow the GC info encoder and the JIT to use this function without pulling in the entire utilcode header.
2016-04-13Refactor `MemoryBlockDesc`.Pat Gavlin1-18/+46
- Encapsulate link management into `MemoryBlockDescList`. - Replace `MemoryBlockDesc` and its separately-allocated buffer with a new type, `MemoryBlock`, that stores the link to the next memory block with the buffer itself.
2016-04-13Replace `SList` in the GC info encoders.Pat Gavlin1-8/+11
Instead of using `SList`, manage the links manually. There are only a few list manipulations in the encoders, so this is not too onerous.
2016-04-12Clean up StructArrayList for GC info.Pat Gavlin1-4/+4
- Move the code into the GC info encoder, as that is its only consumer. - Remove contracts - Delete dead code - Reformat and refactor to current coding standards
2016-04-08Replace CQuickSort with qsort in GC info encoders.Pat Gavlin1-64/+50
This removes another utilcode dependency from the GC info encoders.
2016-04-06Add JIT and GC info SimplerHashTable behaviors.Pat Gavlin1-30/+67
These behaviors override the default out-of-memory handling s.t. it is appropriate for the JIT.
2016-03-09Delete dead codeJan Kotas1-5/+0
- Delete BINDER, STANDALONE_BINDER and MDIL ifdefs
2016-03-08Move some definitions out of gcinfoencoder.h.Pat Gavlin1-0/+415
There are a number of macros, method bodies, and type definitions that do not need to be in gcinfoencoder.h. Instead, these definitions have been moved into gcinfoencoder.cpp.
2016-01-27Update license headersdotnet-bot1-4/+3
2015-12-09Enable Linux compilation of LLILCManu1-19/+19
Fixed some C++ warnings that are treated as errors when compiling LLILC.
2015-11-20Fix build breaks in legacy buildJan Kotas1-0/+2
[tfs-changeset: 1550765]
2015-11-10Fix for build breakKyungwoo Lee1-0/+2
When building llilc against coreclr in Linux, m_IsSlotTableFrozen is defined under _DEBUG but it is used without guard "#ifdef _DEBUG" This is fix for it.
2015-09-03Fix compilation warnings in gcinfoencoder.Andy Ayers1-0/+2
Add fake uses for two variables referenced only in asserts.
2015-07-06Remove a few Unused DefinitionsSwaroop Sridhar1-3/+0
Remove three unused local variable definitions -- which caused warnings in the LLILC build.
2015-05-12Fix some const-correctness issues in the GC info encoder.Pat Gavlin1-7/+7
2015-05-05GcInfo: Add support for Standalone buildSwaroop Sridhar1-1/+5
The STANDALONE_BUILD switch can be used to build the GcInfoEncoder library independently by clients outside the CoreClr tree. The GcInfo library uses some custom data-structures (ex: ArrayList) and includes some utility libraries (ex: UtilCode) which pull in several other headers with considerable unrelated content. Rather than porting all the utility code to suite other clients, the STANDALONE_BUILD switch can be used to include only the minimal set of headers specific to GcInfo encodings. Clients of STANDALONE_BUILD will likely use standard library implementations of data-structures like ArrayList, HashMap etc., in place of the custom implementation currently used by GcInfoEncoder. Rather than spew the GcInfoEnoder code with #ifdef STANDALONE_BUILD ... #else .. #endif blocks, we include a special header GcInfoUtil.h in STANDALONE_BUILD mode. GcInfoUtil.h is expected to supply the interface/implementation for the data-structures and utilities used by GcInfoEncoder. This header should be provided by the clients doing the standalone build in their source tree.
2015-02-28Fix definitions of preserved regs in GCInfo to match Unix calling conventionJan Kotas1-0/+2
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+2378
[tfs-changeset: 1407945]