summaryrefslogtreecommitdiff
path: root/src/vm/threads.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-11-02Fix handling of embedded scopes with multiple exception holdersJan Vorlicek1-1/+1
During the exception handling pass 1 on Unix, we only find one holder for each frame. But for the case where there are multiple scopes embedded in each other, each of them having their own exception holder, this is not correct and we need to call filters for all holders on such frame, starting from the inner-most one. This change fixes that. In addition, it fixes one usage of the EX_CATCH_CPP_ONLY in the src/vm/threads.cpp where the presence of the exception holder in the EX_TRY is not correct and causes the exception handler pass 1 to consider the managed exception handled at that place. The fix is to create a new EX_TRY_CPP_ONLY that doesn't contain the holder and use it at that place. In fact, the comment at EX_CATCH_IMPL_CPP_ONLY was suggesting that a separate EX_TRY clone would be a better solution anyways, since it eliminates one try / catch level in the EX_CATCH_IMPL_CPP_ONLY.
2015-10-27[arm] Fix the debug build as wellGeoff Norton1-1/+1
2015-10-21Move some functions to allow them to be inlined with clangKoundinya Veluri1-10/+0
For the moment, GetThread, _rotl/_rotr, Interlocked..., and similar functions were moved to allow inlining them with clang. The plan is to eventually enable link-time optimization (LTO) to cover inlining across translation units. Renamed some code files in PAL tests to compile as C++ to use the C++ inline semantics.
2015-10-20Implementation of System V ABI struct passing.Lubomir Litchev1-0/+3
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-10-07correct word spellingあまみや ゆうこ1-2/+2
2015-09-18Change PAL_InjectActivation to use pthread_killJan Vorlicek1-0/+2
This change modifies the PAL_InjectActivation to use much more portable pthread_kill instead of pthread_sigqueue. Remove the activation function passing from the PAL_InjectActivation and add a PAL API to set the activation function globally, since we need just one.
2015-09-16Fix for GH issue 410 - https://github.com/dotnet/coreclr/issues/410Gaurav Khanna1-0/+31
Whenever a managed exception is thrown, the details about the thrown exception are also saved off the managed thread object (as LastThrownObject). The VM also has an exception tracker that tracks its dispatch across the managed frames and incase of nested exceptions, the trackers are collapsed correctly, when the nested exception is handled, and last thrown object is updated correctly. The VM works on the premise that the LastThrownObject is updated correctly. Incase of this bug, a method (M1)is invoked via Reflection and has an exception E1. During exception dispatch for E1, an IL filter is invoked that, in turn, has an exception (E2) that remains unhandled. While this is swallowed by the VM (as expected), the LastThrownObject is not updated to reflect the active exception to be E1. Thus, when the dispatch for original exception E1 completes and no managed handler is found, the exception is caught by Reflection subsystem that extracts the thrown exception using the GET_THROWABLE macro that uses the LastThrownObject to determine the thrown exception. Since the LTO was not updated, it still reflects E2. The fix is to update the managed exception state, if the filter has an unhandled exception, similar to how we do when a managed catch block successfully handles the exception. I have refactored the code to make the semantic cleaner. [tfs-changeset: 1525835]
2015-09-04Remove thread affinity and critical region stuff for UnixJan Vorlicek1-5/+24
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-14Add build-time check for existence of pthread_sigqueue and fix minorAditya Mandaleeka1-2/+4
issues.
2015-08-13Remove temporary ifdef and refactor/simplifyAditya Mandaleeka1-6/+4
2015-08-13Enable FEATURE_HIJACK on 64-bit LinuxAditya Mandaleeka1-2/+3
2015-08-13Implement GC Suspension for UnixAditya Mandaleeka1-4/+7
2015-05-07Merge changes from parent branchdotnet-bot1-0/+15
[tfs-changeset: 1466545]
2015-02-21Fix warnings generated when building with Clang on Linux.Pat Gavlin1-1/+1
There were three classes of warnings that needed to be fixed: 1) Warnings for unused typedefs 2) Warnings for pointer to boolena conversions that were always true 3) Warnings for taking the absolute value of unsigned values (1) accounted for the majority of the warnings. All of these warnings originated from macro definitions debugreturn.h, staticcontract.h, or pal_assert.h. In the first two cases, typedefs were used as compile-time checks to ensure certain invariants inside of method or function bodies. These cases were addressed by using an empty member of the typedef under an "if (0)" guard. In the third case, typedefs were used for compile-time assertions that may appear in any location in a source file; these have been updated to use C++11's static_assert. (2) and (3) were much more straightforward: the former was addressed by explicitly comparing the source pointer against NULL and the latter by removing the offending calls to abs(). This change also contains a small update to .gitignore to ignore the binaries directory and CMake artifacts created by build.sh.
2015-02-13Simplify platform ifdefsJan Kotas1-4/+4
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/+13602
[tfs-changeset: 1407945]