summaryrefslogtreecommitdiff
path: root/src/gcinfo
AgeCommit message (Collapse)AuthorFilesLines
2018-02-17delete unused mirror files (#16423)Sergey Andreenko3-3/+0
2018-02-14Fix ARM/ARM64 hijacking in tail calls (#16039)Jan Vorlicek2-1/+25
* 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.
2017-04-25Fix GCInfo library used by ARM/ARM64 protononjit buildsBruce Forstall3-0/+24
Otherwise, using the normal GCInfo library, the altjits will assert creating GC info. Create new "cross-target" builds of the GCInfo library.
2016-12-26Remove files related to legacy build system (#8723)Robert4-64/+0
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-23Initial commit to build Win32 Arm CoreCLRGaurav Khanna1-2/+4
2016-08-15Arm64 Sos fixes forRama Krishnan Raghupathy1-2/+2
!verify heap !u !u -gcinfo
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 Sridhar4-1067/+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-07-20GCInfo: Support versioning.Swaroop Sridhar1-7/+7
This change enables the VM to support multiple versions GCInfo concurrently. This is necessary in light of upcoming work to add ReturnType and other modifications to the GCInfo format -- so that existing ReadyToRun images will continue to run correctly. The version# is not stored in the GcInfo structure -- because it is wasteful to store the version once for every method. Instead, it is tracked per range-section of generated/loaded methods. The GCInfo version is computed as: 1) The current GCINFO_VERSION for JITted and Ngened images 2) A function of the Ready-to-run major version stored in READYTORUN_HEADER for ready-to-run images. ReadyToRunJitManager::JitTokenToGCInfoVersion() provides the GcInfo version for any Method. Currently, there's only one version of GCInfo. An abstraction GCInfoToken is added to the GcInfo interface, which tracks the {GcInfo, Version} pair in-memory. Several GcInfo APIs are modified to use GCInfoToken in place of GcInfo pointers. Notes: 1) SOS GcDump: The GCDump API has separate dump routines for Header and the pointer-liveness information (DumpGCTable and DumpGCHeader) each of which advance a pointer to the GCInfo block. These APIs are not changed to recieve a GCInfoToken in place of the GcInfo block pointer. Instead, they recieve the GcInfo version at the time of construction. 2) Some routines that are specific to x86 gcInfo (ex: crackMethodInfoHdr) are not yet updated to use versioning, since the development plan is to update the Non-x86 GcInfo structure first. 3) The x86 specific structs defining GcInfo headers are moved to GcInfoTypes.h, along with the non-x86 GcInfo type definitions.
2016-06-10Fixes AV in sos for arm64Rahul Kumar1-1/+1
2016-04-20Merge pull request #4377 from swaroop-sridhar/aagc1Swaroop Sridhar1-1/+3
ARM64: Fix GC encoding settings
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-18enable build of cross target components.Rahul Kumar1-1/+1
Currently only enabled for arm64
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 Gavlin2-63/+83
- 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 Gavlin2-16/+30
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-12Merge pull request #4255 from pgavlin/GcInfoArrayListPat Gavlin5-6/+112
Refactor `StructArrayList` for the GC info encoder.
2016-04-12Clean up StructArrayList for GC info.Pat Gavlin5-6/+112
- 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-11GCInfo: Fix ARM64 GCInfo decodingSwaroop Sridhar1-1/+1
GCStress traps were not inserted in ARM64 code correctly because safepoint offsets were not correctly computed by EnumerateSafepoints(). This change fixes the issue by adding the (-1) adjustment to the ARM64 Safepoint offsets, similar to ARM and AMD64.
2016-04-08Replace CQuickSort with qsort in GC info encoders.Pat Gavlin2-114/+87
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-30Getting SOS to work on ARm64:Rama Krishnan Raghupathy1-8/+71
This mainly involved DACizing the VM code. A bulk edit for changing RUNTIME_FUNCTION to T_RUNTIME_FUNCTION [tfs-changeset: 1591667]
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-bot3-12/+9
2016-01-21FIx the incremental build for WindowsJan Vorlicek2-2/+2
Conflicts: build.cmd src/dlls/clretwrc/CMakeLists.txt Cleanup
2016-01-10Use ARCH_SOURCES_DIR consistentlyMike Danes1-2/+1
Some places already use ARCH_SOURCES_DIR for things like include_directories but others test the platform/arch variables to figure out the dir. Use ARCH_SOURCES_DIR everywhere for consistency.
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-18Replace most windows style types by c++ typesJan Vorlicek1-1/+1
This change replaces DWORD, LONGLONG, ULONGLONG, SIZE_T, BYTE, LONG32 and few more by standard c++ types. The DWORD still remains present in signatures of Windows APIs used by the GC. There are few issues with those that need to get fixed.
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-08-04Enable the Windows x86 buildMike Danes1-0/+7
This allows building the Windows x86 version of CoreCLR by using "x86" for the BuildArch parameter of build.cmd. Note that CMAKE_SYSTEM_PROCESSOR is no longer used in Windows builds to set IS_64BIT_BUILD. This change is enough to get CoreCLR to build but more changes are required for it to actually run correctly. In particular, the JIT compiler support for x86 is pretty limited at this point.
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 Sridhar2-1/+8
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-04-28Build crossgen for LinuxJohn Chen (JOCHEN7)1-3/+1
- Crossgen is now built as part of coreclr - Crossgen successfully compiles mscorlib.dll - Resulting mscorlib.ni.dll not yet usable
2015-04-20Enable build crossgen.exe from build.cmd.John Chen5-4/+32
Adds and modifies CMakeLists.txt files to enable building of crossgen.exe from build.cmd for x64 processor on Windows. Also adds a step in build.cmd to generate native image for mscorlib. [tfs-changeset: 1456454]
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-bot9-0/+4115
[tfs-changeset: 1407945]