Age | Commit message (Collapse) | Author | Files | Lines |
|
warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
conversions
Update src/ToolBox/superpmi/mcs/verbdumptoc.cpp
Co-Authored-By: franksinankaya <41809318+franksinankaya@users.noreply.github.com>
|
|
Add missing DECODE_HAS_TAILCALLS flag.
Closes #22163
|
|
|
|
* 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.
|
|
* [x86/Linux] Enable gcMarkFilterVarsPinned
Do gcMarkFilterVarsPinned() for WIN64EXCEPTIONS
* [x86/Linux] GCInfo : Force this pointer untracked
`this` pointer is now always untracked so we can use pinned flag in tracked lifetimes.
This allows us to make the refs(inside filter) pinned to prevent from double-relocation.
* [x86/Linux] GCInfo : fix comment and formatting
* [x86/Linux] GCInfo : Update
- Force "this" pointer untracked only when "this" is generic context
- Style fixes
* [x86/Linux] GCInfo : remove this_OFFSET_FLAG
|
|
|
|
|
|
(#8475)
|
|
|
|
This commit includes the following changes:
1) Thread GcInfo version through X86 specific APIs
2) Add ReturnKind and ReversePinvokeOffset fields to InfoHdr structure
GcInfo v1 and v2 use the same InfoHdr structures, because:
InfoHdrSmall: ReturnKind is encoded within previously unused bits.
InfoHdr: revPInvokeOffset will never be written to the image,
since ReversePinvokeOffset==INVALID_REV_PINVOKE_OFFSET for V1.
3) Update the Pre-computed header table to include bits for the above
[The default setting of ReturnKind=RT_Scalar is used for all entries in the table.
Optimizing this table based in most frequent usage scenarios is to be done separately]
4) Change the GC encoder/decoder to handle the above two fields
5) Use the ReturnKind in the GCInfo from thread-suspension code.
GcInfo version is changed for CoreCLR X86 only, not for Desktop JIT
Fixes #4379
|
|
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.
|
|
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.
|
|
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.
|
|
This mainly involved DACizing the VM code.
A bulk edit for changing RUNTIME_FUNCTION to T_RUNTIME_FUNCTION
[tfs-changeset: 1591667]
|
|
|
|
|
|
[tfs-changeset: 1407945]
|