summaryrefslogtreecommitdiff
path: root/src/vm/frames.h
AgeCommit message (Collapse)AuthorFilesLines
2018-12-18Fix stack walking and reporting of default interface methods (#21525)Michal Strehovský1-0/+25
Default interface methods in their unresolved state don't have a generic context. The generic context is only added once the method is resolved to its implementation.
2018-12-10Delete vm/context.* (#21459)Jan Kotas1-72/+3
* Delete vm/context.* Leftover from remoting
2018-10-31Remove superfluous 'const' qualifier from trivial return types (#20652)Michał Janiszewski1-1/+1
The 'const' used in this context has no meaning
2018-08-07Make VM-side changes for ARM64 Windows calling convention.Aditya Mandaleeka1-0/+1
2018-04-23GenericPInvokeCalli shift left then or 1 (#17734)Steve MacLean1-0/+1
When _WIN64 is defined vm relies on the secret arg being shifted left and orred with #1. Revert part of changes from #17659 to fix dotnet/corefx#29266 Fix arm64 to match amd64 Simplify dllimport.cpp
2018-02-03Fix failfast stacktrace (#15895)Sung Yoon Whang1-0/+73
* attempt to fix stacktrace getting printed twice * Fix some default parameter issues, and wrong commit from last commit * Fix build errors, switch call from Debug.Assert to new FailFast FCall * Fix signature to allow more types of exception title * cleanup * Addressing comments from PR * More PR comments * remove useless using * Address comments on GC hole and few naming changes
2017-06-23[Local GC] Remove a number of inclusions of handle table private headers ↵Sean Gillespie1-1/+0
from the VM (#12389) * Remove inclusions of private handle table headers from the VM * Add TraceRefCountedHandles to the GC handle table interface * Fix the Unix build * Move ValidatePinnedObject to marshalnative.h
2017-05-17Finish deleting dead CAS code from CoreLib (#11436)Jan Kotas1-26/+0
Fixes #9321 and deletes CleanupToDoList.cs Delete unmanaged security implementation
2017-05-17Remove unused CLRVectoredExceptionHandlerShim forward declarations (#11667)Jonghyun Park1-1/+1
2017-04-25Move DynamicHelperFrame::UpdateRegDisplay into cgenx86.cpp (#11193)Jonghyun Park1-5/+1
* Move DynamicHelperFrame::UpdateRegDisplay into cgenx86.cpp * Fix x86/Windows link error
2017-03-01[x86/Linux] Clean up EXCEPTION_REGISTRATION_RECORD (#9895)Jonghyun Park1-2/+2
2017-02-14Remove never defined FEATURE_REMOTINGdanmosemsft1-78/+0
2017-02-14Remove never defined FEATURE_INCLUDE_ALL_INTERFACESdanmosemsft1-70/+0
2017-02-10Revert "Remove always defined FEATURE_CORRUPTING_EXCEPTIONS"danmosemsft1-0/+2
This reverts commit b0dab0d6de90a38dfbf0d6b2039a7b8f5269d802.
2017-02-10Remove always defined FEATURE_CORRUPTING_EXCEPTIONSdanmosemsft1-2/+0
2017-02-10Remove always defined FEATURE_CORECLRdanmosemsft1-18/+0
2017-01-11[x86/Linux] Fix WIN64EXCEPTIONS build error (#8629)Jonghyun Park1-7/+13
* Move GetUnwindInfo and GetNumberOfUnwindInfos into the real code header This commit fixes #8342. * Use WIN64EXCEPTIONS instead of _TARGET_X86_ * Revise FaultingExceptionFrame This commit revises FaultingExceptionFrame to support WIN64EXCEPTIONS in x86/Linux port. * Add RUNTIME_FUNCTION__EndAddress as NYI * Revise regdisp.h * Revise eetwain.h * Comment out exinfo.cpp if WIN64EXCEPTIONS is defined * Revises excep.cpp * Fix mistmatch in ThrowControlForThread defintion * Revises cgenx86.cpp * Disable SEH-based exception handlers when WIN64EXCEPTIONS is defined * Revise stackwalk.cpp * Revise jitinterface.cpp * Revise readytorun.h * Revise dbgipcevents.h * Revise zapcode.cpp * Revise clrnt.h * Fix Windows build error * Mark FaultingExceptionFrame::UpdateRegDisplay as NYI * Revise per feedback * Revert #if defined(..) as #ifdef * Fix style changes * Fix style changes * Remove #undef _TARGET_X86_ * 2nd attempt to fix Windows build error * Revise per feedback * Revert the chagnes in clrdefinitions.cmake and add BIT32 in CMakeLists.txt * Use !BIT64 instead of BIT32 * Include exceptionhandling.cpp and gcinfodecoder.cpp in build This commit includes exceptionhandling.cpp and gcinfodecoder.cpp in build, and fixes related compile errors. * Fix COMPlus_EndCatch undefined reference * Fix build error * Fix GcInfoDecoder-related undefined references * Fix AdjustContextForVirtualStub undefined reference * Fix GetCallerSP undefined reference * Fix ResetThreadAbortState undefined reference * Attempt to fix Windows build error * Fix CLRNoCatchHandler undefined reference * Another attemp to fix Windows build error * Fix GetXXXFromRedirectedStubStackFrame undefined references * Fix Windows Build Error * Add RtlpGetFunctionEndAddress and RtlVirtualUnwind as NYI * Fix undefined references on JIT helpers * Enable Dummy Application Run with WIN64EXCEPTIONS * Revert "Move GetUnwindInfo and GetNumberOfUnwindInfos into the real code header" This reverts commit c2bad85ac1136be3c6fb6ad7eedc5b3814b2ab29. * Use indirect code header when WIN64EXCEPTIONS is enabled * Port 'SyncRegDisplayToCurrentContext' and 'FillRegDisplay' * Revise style 'RUNTIME_FUNCTION__SetUnwindInfoAddress' * Extract out HandlerData from #ifdef region * Add UNIXTODO * Add UNIXTODO * Port 'GetRegdisplayReturnValue' * Fix incorrect comment * Remove messages that mentions WIN32EXCEPTIONS * Revise AdjustContextForWriteBarrier * Port 'FaultingExceptionFrame::UpdateRegDisplay' * Extract out 'AdjustContextForVirtualStub' and 'CLRNoCatchHandler' from #ifdef region * Merge two #ifdef regions * Set WIN64EXCEPTIONS as a default for x86/Linux * Remove unnecessary #ifdef from ThrowControlForThread * Remove unnecessary stubs * Add Dependency Check between Compile Flags * Revise per feedback
2016-12-04[x86/Linux] Revert UMThkCallFrame-related changes (#8434)Jonghyun Park1-2/+2
* [x86/Linux] Revert UMThkCallFrame-related code * [x86/Linux] Fix dangling 'TheUMEntryPrestub' reference This commit re-enables GenerateUMThunkPrestub and its related code in order to remove TheUMEntryPrestub reference. * [x86/Linux] Re-enable several methods in StubLinkerCPU This commit re-enables the following methods for x86/Linux: - StubLinkerCPU::EmitSetup - StubLinkerCPU::EmitComMethodStubProlog - StubLinkerCPU::EmitComMethodStubEpilog In addtion, EmitComMethodStubEpilog is marked as NYI.
2016-12-01Re-enable UMThkCallFrame and fix compile errors (#8411)Jonghyun Park1-6/+6
2016-11-29[x86/Linux] Disable WIN64EXECPTION and fix related changes (#8375)SaeHie Park1-2/+2
Fix compile error for x86/Linux - undo some changes to disable WIN64EXCEPTION so the x86/Linux builds
2016-11-29[x86/Linux] Fix constructor missing in UnmanagedToManagedFrame (#8275)SaeHie Park1-5/+7
Fix compile error for x86/Linux - full error string: constructor for 'UMThkCallFrame' must explicitly initialize the base class 'UnmanagedToManagedFrame' which does not have a default constructor - wrap UMThkCallFrame with also !FEATURE_PAL
2016-11-23[x86/Linux] Fix compile error with exception handling (#8269)SaeHie Park1-2/+2
Fix compile error for x86/Linux - fix unknown type name 'EHWatsonBucketTracker' - fix field has incomplete type 'EXCEPTION_REGISTRATION_RECORD' - fix for FaultingExceptionFrame class
2016-08-05Implement GcInfo v2Swaroop Sridhar1-3/+4
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-05-06Fix Windows x86 exception handling issue (#4830)Jan Vorlicek1-64/+0
This change fixes an exception handling issue that happens on x86 on Windows when exception is raised in System.RuntimeType.MakeGenericType. The problem was caused by GCPROTECT_HOLDER macro in RuntimeTypeHandle::GetTypeByName that causes popping of GCFrame (and zeroing its m_next field) that's in the middle of the thread's frames list during the stack unwinding. That breaks the list and when UnwindFrames happen later and tries to walk the stack, the StackFrameIterator::NextRaw asserts when checking the validity of the list. The fix is to move the keepAlive to the managed caller of the RuntimeTypeHandle::GetTypeByName QCall, which removes the need for the GCPROTECT_HOLDER. Since it was the only usage of that holder and of the underlying FrameWithCookieHolder class, I've removed those. In addition to that, I've modified COMModule::GetType and AssemblyNative::GetType to use the same pattern, since they could also suffer from the problem the GCPROTECT_HOLDER was attempting to fix.
2016-02-19Fix the explicit frames unwinding on UnixJan Vorlicek1-43/+72
This change fixes a problem when exception unwinds native frames of code that contains explicit frames. There were two issues. First, the destructor of the explicit frame base class Frame that was responsible for popping the frames was missing switch to GC cooperative mode and so it could pop frames that GC was currently walking. And second, after adding the switch to cooperative mode, it turned out that if a thread gets blocked in the Frame destructor due to GC and the stack walker tries to get stack cookie from FrameWithCookie wrapper of a class derived from the Frame, it fails since the vtable pointer was already reset to the vtable of the base Frame class and it detects that as an invalid case. The fix was to add destructors to all final classes derived from Frame and perform the frame popping from there.
2016-01-27Update license headersdotnet-bot1-4/+3
2016-01-14Improve stack limit checking precisionJan Vorlicek1-1/+1
This change improves the precision of checking whether an address is in stack limits for cases where ulimit -s is set to unlimited and the stack limit is checked for the current thread. It uses current SP instead of the cached stack limit, since the OS is free to move the stack limit up during the process runtime and the cached value reflects the initial stack limit.
2015-11-17Enable CLANG sanitizers for native debug buildsSteve Harter1-1/+2
2015-10-13Improve frame destructor performanceJan Vorlicek1-0/+1
This change makes the Frame destructor access thread local storage much less often, only in rare case when the Frame was not popped before the destructor is called.
2015-10-07correct word spellingあまみや ゆうこ1-1/+1
2015-09-04Remove thread affinity and critical region stuff for UnixJan Vorlicek1-5/+19
The WaitHandleNative::CorWaitMultipleNative was calling Thread::BeginThreadAffinityAndCriticalRegion that results in incrementing the Thread::m_dwCriticalRegionCount. However, there is nothing that would decrement it on CoreCLR, so if the WaitHandleNative::CorWaitMultipleNative is called, in debug build we get an assert in Thread::InternalReset. It turns out that the critical region and thread affinity stuff is not to be used in CoreCLR, so I have disabled handling of that in CoreCLR for Unix. The only remainder are the static methods Thread::BeginThreadAffinity and Thread::EndThreadAffinity which are used in the ThreadAffinityHolder. Conditionally removing the holder usage would be messy, so I have rather kept those methods and made their bodies empty.
2015-08-14Fix typo "retrive" and "retrieved" to "retrieve" and "retrieved"Jon Hanna1-1/+1
Mostly just in comments, test case and trace text, but the exception thrown if you try to GetInterfaceMap on an array type has it in the description.
2015-07-27[aarch64] Initial aarch64/linux bring upGeoff Norton1-1/+1
2015-04-28Build crossgen for LinuxJohn Chen (JOCHEN7)1-2/+2
- Crossgen is now built as part of coreclr - Crossgen successfully compiles mscorlib.dll - Resulting mscorlib.ni.dll not yet usable
2015-03-13Exclude the Frame destructor from DAC buildJan Vorlicek1-2/+2
The destructor is not needed on DAC builds and the definition was not being built for DAC already. Conditionally disabling the declaration too.
2015-03-13Fix managed exception unwinding through CallDescrWorkerInternalJan Vorlicek1-0/+4
This change fixes issue with exception unwinding in the case when the unwinding passed through a frame of the CallDescrWorkerInternal function. This function had personality routine on it, but a windows style personality routine was specified. The windows one has a completely different signature, so the code was crashing. When looking into that, I've found that even if I have implemented a proper Unix style personality routine, it cannot work the same way on Linux as it used to work on Windows. This personality routine's goal is to pop Frames from the Frame list in the current thread so that all frames upto the frame handling the exception are popped. There are two problems on Linux. First, unlike on Windows, the personality routine is not passed the RSP of the frame handling the exception in an official way. Although it can be extracted from the private_2 member of the exception object during the 2nd pass, it is an implementation detail that we cannot rely on. Moreover, even if we used that, it would still not be the right frame in all cases due to the fact that we implement exception filters by catching and rethrowing and so the frame we would get would be the frame of a filtering catch in case there was one. My solution to this problem is to add destructor to the Frame type and let it pop the frame being destroyed if it is still in the list in the current thread. That way the native code unwinding automatically takes care of popping the frames. As an additional changes, I've added handling of the case when the Thread::VirtualUnwindToFirstManagedCallFrame walks out of stack, fixed a stack alignment issue in the recently added StartUnwindingNativeFrames function and a cosmetic change in the UnwindManagedExceptionPass1.
2015-02-13Simplify platform ifdefsJan Kotas1-1/+1
Simplify platform ifdefs like #if defined(_WIN64) || defined(_TARGET_ARM_) to #if !defined(_TARGET_X86_) based on @BruceForstall suggestion
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+3851
[tfs-changeset: 1407945]