summaryrefslogtreecommitdiff
path: root/src/vm/prestub.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-08-02Merge pull request #13158 from parjong/fix/INTERPERTER_GDBJIT_ConflictNoah Falk1-3/+12
Resolve FEATURE_GDBJIT/FEATURE_INTERPRETER conflict
2017-08-02Remove unused extern declarations (#13159)Jonghyun Park1-8/+0
2017-08-02Resolve FEATURE_GDBJIT/FEATURE_INTERPRETER conflictJonghyun Park1-3/+12
2017-08-01Fix FEATURE_INTERPRETER build errorJonghyun Park1-1/+1
2017-07-28Fix tier0 flag on default code versions (#13098)Noah Falk1-2/+6
Fixes github issue 13019.
2017-07-24Add the runtime code versioning featurenoahfalk1-593/+737
This makes tiered compilation work properly with profiler ReJIT, and positions the runtime to integrate other versioning related features together in the future. See the newly added code-versioning design-doc in this commit for more information. Breaking changes for profilers: See code-versioning-profiler-breaking-changes.md for more details.
2017-07-05Jitted Code Pitching Feature implementedsergey ignatov1-4/+26
2017-06-26Replace array type handle with method table in arguments of array allocation ↵Ruben Ayrapetyan1-1/+3
helpers (#12369) * Remove direct usage of type handle in JIT_NewArr1, with except of retrieving template method table. * Assert that array type descriptor is loaded when array object's method table is set. * Pass template method tables instead of array type descriptors to array allocation helpers.
2017-06-02Remove relocations from SECTION_MethodDesc for ngened images for fields ↵gbalykov1-0/+13
accessed from jit code for Linux ARM (#11963)
2017-05-17Finish deleting dead CAS code from CoreLib (#11436)Jan Kotas1-3/+0
Fixes #9321 and deletes CleanupToDoList.cs Delete unmanaged security implementation
2017-05-05Add compact entry points for ARM (#11109)gbalykov1-0/+22
2017-03-31Add Tier0/1 jit flagsnoahfalk1-2/+2
These flags provides a hook to change the JIT policy in the future and diverge tier0/tier1 compilation from min_opt/speed_opt respectively.
2017-03-29Tiered Compilation step 1noahfalk1-4/+56
Tiered compilation is a new feature we are experimenting with that aims to improve startup times. Initially we jit methods non-optimized, then switch to an optimized version once the method has been called a number of times. More details about the current feature operation are in the comments of TieredCompilation.cpp. This is only the first step in a longer process building the feature. The primary goal for now is to avoid regressing any runtime behavior in the shipping configuration in which the complus variable is OFF, while putting enough code in place that we can measure performance in the daily builds and make incremental progress visible to collaborators and reviewers. The design of the TieredCompilationManager is likely to change substantively, and the call counter may also change.
2017-03-28[x86/Linux] Fix signature mismatch inside InstantiatingStub (#10538)Jonghyun Park1-0/+6
2017-03-25Typo correction (#10482)Ofer Zelig1-1/+1
2017-02-15Merge pull request #9603 from danmosemsft/defines4Dan Moseley1-28/+0
Remove more dead native defines
2017-02-14Remove never defined FEATURE_REMOTINGdanmosemsft1-28/+0
2017-02-14[x86/Linux] Fix CreateInstantiatingILStub (#9590)SaeHie Park1-18/+10
The hidden argument should be always passed last for x86
2017-02-14[x86/Linux] Fix IL Stub for Shared Generic (#9571)SaeHie Park1-6/+16
Fix parameter order in UnboxingILStub for Shared Generic
2017-02-13Rejit support for R2R imagesnoahfalk1-0/+1
Two changes: a) R2R code wasn't being reported to the Rejit Manager when it was used, this is a simple fix in prestub.cpp. This makes the ReJit API work. b) The bulk of the changes handle adding support for an inlining table to R2R so that ICorProfilerInfo6::EnumNgenMethodsInliningThisMethod can supply that information to profilers. This was only tested on Windows thus far, but there is no apparent reason this change would be OS specific.
2017-02-12Remove never defined FEATURE_CER and headerdanmosemsft1-7/+0
2017-01-11[x86/Linux] Fix generic context(hidden arg) position (#8848)SaeHie Park1-5/+23
This fixes how to handle generic context position in x86 by num of arguments
2016-12-13[x86/Linux] implement TheUMEntryPrestub (#8589)SaeHie Park1-7/+7
Initial code for x86 TheUMEntryPrestub, UMThunkStub
2016-12-04[x86/Linux] Revert UMThkCallFrame-related changes (#8434)Jonghyun Park1-7/+7
* [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-11-29Disable CER feature as it is not used (#8218)John Chen1-2/+2
Use FEATURE_CER to scope CER code, and disable CER feature in CoreCLR.
2016-11-29[x86/Linux] Fix constructor missing in UnmanagedToManagedFrame (#8275)SaeHie Park1-3/+3
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-01Use resolver to get IL header and size (#7924)Mukul Sabharwal1-15/+19
2016-10-27Introduce new CORJIT_FLAGS typeBruce Forstall1-5/+5
The "JIT flags" currently passed between the EE and the JIT have traditionally been bit flags in a 32-bit word. Recently, a second 32-bit word was added to accommodate additional flags, but that set of flags is definitely "2nd class": they are not universally passed, and require using a separate set of bit definitions, and comparing those bits against the proper, 2nd word. This change replaces all uses of bare DWORD or 'unsigned int' types representing flags with CORJIT_FLAGS, which is now an opaque type. All flag names were renamed from CORJIT_FLG_* to CORJIT_FLAG_* to ensure all cases were changed to use the new names, which are also scoped within the CORJIT_FLAGS type itself. Another motivation to do this, besides cleaner code, is to allow enabling the SSE/AVX flags for x86. For x86, we had fewer bits available in the "first word", so would have to either put them in the "second word", which, as stated, was very much 2nd class and not plumbed through many usages, or we could move other bits to the "second word", with the same issues. Neither was a good option. RyuJIT compiles with both COR_JIT_EE_VERSION > 460 and <= 460. I introduced a JitFlags adapter class in jitee.h to handle both JIT flag types. All JIT code uses this JitFlags type, which operates identically to the new CORJIT_FLAGS type. In addition to introducing the new CORJIT_FLAGS type, the SSE/AVX flags are enabled for x86. The JIT-EE interface GUID is changed, as this is a breaking change.
2016-10-21Address CR feedbackMukul Sabharwal1-2/+2
2016-10-21Add LCG JIT Compilation Profiler CallbacksMukul Sabharwal1-0/+8
Methods that contain no metadata (e.g. of sources are IL Stubs, DynamicMethod, Expression Trees, etc.) also known as LCG methods are not reported to profilers via the Profiling API. LCG, introduced in .NET 2.0 timeframe is unique in that it doesn't require the method to be hosted in an assembly > module > type heirarchy and is GCable in of itself. This change adds new APIs that notify the profiler of such methods but since there is no metadata to go lookup, it provides some useful pieces of information that the profiler author may want to expose to the profiler user. In the compilation start method we provide a className (always dynamicClass), a methodName that can be a set of few predetermined names like (ILStub_COMToCLR, etc.) or if the user has set the name for the LCG method that can show up here. For example, when using the Expression Trees API, the user can specify a friendly name which would be returned here. In the jit completed callback we provide information for the native code start address and size. This is particularly useful to get more accurate accounting of what the (previously unidentified) code is. At least the user would know it is JITTed if nothing more (but most likely more information like what kind of stub). Furthermore, since this is going to be a profiler callback, the profiler can initiate a stackwalk and give more contextual information to its users beyond the pieces of information we can provide here that could identify what they're encountering. Finally, there is also the case that today the profiling APIs underreport JITTed code in the process. Considerable amount of LCG code can now be present in the program and in security-sensitive environments where tracking JITTed code for security reasons is important the profiling apis fall short. In such environments there is also often restrictions on running with elevated privileges, so procuring this data through other means (like ETW) may pose a challenge.
2016-10-01Initial support of local variables and method arguments in GDB JIT interface ↵Evgeny Pavlov1-1/+1
(#7400)
2016-09-08Merge pull request #6764 from swgillespie/gc-interface-3Sean Gillespie1-1/+1
Move the GC behind an interface and use that interface in the VM
2016-09-08Introduce an interface separating the GC and the VM,Sean Gillespie1-1/+1
modifying the VM to utilize this interface. Introduce an interface separating the GC and the rest of the VM Remove static members of both IGCHeap and IGCHeapInternal and move the management of the singular GC heap to the VM. Rename uses of IGCHeap in the VM to GCHeapHolder, as well as other misc. renames throughout the VM and GC. Split each interface function into categories, document them, use consistent formatting across the interface Undo some accidental find/replace collateral damage Remove all ifdefs from the GC interface Deduplicate function declarations between IGCHeap and IGCHeapInternal, expose AllocAlign8 through the interface and the reference to alloc_context to repair the ARM build Paper cut: false -> nullptr Repair the ARM and x86 builds Rename GCHeapHolder -> GCHeapUtilities and address documentation feedback Rebase against master Rename gcholder.h/cpp -> gcheaputilities.h/cpp Fix an uninitialized field on alloc_context causing test failures on clang Rename the include guard for gcheaputilities.h Un-breaks SOS by making the following changes: 1) Instructs the DAC to look for IGCHeap::gcHeapType by name, instead of assuming that it exists near g_pGCHeap, 2) Eliminate all virtual calls on IGCHeap in the DAC, since we cannot dispatch on an object in another process, 3) Because of 2, expose the number of generations past the GC interface using a static variable on IGCHeap that the DAC can read directly. repair the Windows build
2016-09-06[Linux][LLDB][GDB/JIT] Add support for lldb 'breakpoint set' for jitted code ↵Dmitri-Botcharnikov1-1/+5
(#6956) * Add support for lldb 'breakpoint set' for jitted code * Updated after review * Enlarge buffer for line program
2016-06-23Undo accidental changeJan Kotas1-1/+1
[tfs-changeset: 1614521]
2016-06-23Add missing contractsJan Kotas1-1/+3
[tfs-changeset: 1614520]
2016-06-21Fixing build break on x86 and arm.Fadi Hanna1-1/+1
[tfs-changeset: 1614031]
2016-06-21Generic dictionary minor performance improvement and simplification for R2R ↵Fadi Hanna1-107/+129
(#5690) A set of refactoring changes to slighly improve the performance of generic dictionary access on R2R images, and simplifying the codebase: 1) Removing dependency on CEEInfo::ComputeRuntimeLookupForSharedGenericTokenStatic (and deleting the API). 2) Stop parsing the generic type/method signatures when generating the R2R dictionary lookup assembly stub. 3) Avoid re-encoding the generic type/method signatures in a new in-memory blob using a SigBuilder (signatures used directly from the R2R image) 4) Moved the parsing/loading of type/method signatures to Dictionary::PopulateEntry() 5) Dictionary index and slot number are now encoded in the generated assembly stub instead of the signature (stub takes a pointer to a data blob, which contains the signature, the dictionary index and slot, and the module pointer)
2016-06-02Avoid calling prestub through wrong MethodDesc (#5439)John Chen1-5/+2
While fixing up a call from a Ready-to-Run method, we don't always have the right implementation MethodDesc for the target of the call. Thus it is potentially unsafe to DoPrestub using the MethodDesc we have, causing a test failue (Loader.classloader_regressions_429802_CMain) in issue #5366. This is fixed by not calling DoPrestub from ExternalMethodFixupWorker.
2016-05-19Implementation of the following generic dictionary entries for R2R: (#5079)Fadi Hanna1-4/+25
MethodDescSlot MethodEntrySlot DispatchStubAddrSlot
2016-05-18Porting the changes to support generic dictionaries lookups in R2R images to ↵Fadi Hanna1-12/+14
the JIT32 implementation, to support the x86 architecture. All of the changes in importer.cpp were ported from JIT\importer.cpp, which was merged to the coreclr master branch last Friday evening (reviewed and signed-off in a PR on GitHub). The remaining changes include: 1) Adjusting #ifdefs to enable the x86 scenario 2) Implementation of the R2R stub for generic dictionary lookups 3) Small change in prestub.cpp required for x86 to work correctly [tfs-changeset: 1605906]
2016-05-13Initial implementation of generic dictionary access for R2R. (#4519)Fadi Hanna1-8/+113
For now, only TypeHandle dictionary entry slots are supported and encoded in a R2R version resilient format (the rest to come soon). Support is only limited for x64 Windows platforms (rest is still TODO) The basic idea: each dictionary access is initally a call to a DynamicHelper R2R cell that computes the dictionary signature, and patches the R2R cell address with an assembly stub that performs the dictionary lookup.
2016-04-25ARM64: Fix Vararg for PInvokeKyungwoo Lee1-1/+1
Fixes https://github.com/dotnet/coreclr/issues/4474 1. Fix entry point to `VarargPInvokeStub_RetBuffArg` instead of `VarargPInvokeStub` to pass `VASigCookieReg` via `x1` when hasRetBuffArg is true. 2. The previous fix for varargs SP offset is not correct when both varargs and callee save regs exist. Fix the SP offset computation from caller's SP. 3. Fix epilog which didn't take varargs into account.
2016-03-23Fix generic struct delegate in ReadyToRun (#3690)John Chen (JOCHEN7)1-0/+8
The following code pattern triggers a crash when compiled into Ready To Run: struct S<T> { public void M() { ... } } class C { } Then create a delegate using S<C>.M The cause of the crash is calling S<C>.M normally reaches a shared generic method S<__Canon>.M, but for delegate creation we need to use the actual S<C>.M. Ready To Run generated code that attempts to create delegate using S<__Canon>.M, which is not allowed.
2016-03-18Fix instantiating stub for methods of value typesJan Vorlicek1-2/+6
This change fixes a problem with instantiating stubs for methods of value types. The problem was that the CreateInstantiatingILStub didn't take into account the fact that methods of value types need to have "this" passed "byref". The issue manifested itself as a rare corruption of references in array of structs that were thin wrappers for string reference during GC stack scan. GC thought that the reference to an array entry is an object reference that starts with method table. GC marks method table pointers by setting their bit zero to 1. But in this case, it has accidentally modified an object reference instead and a test was crashing with wrong object address. The root cause of the problem is that the instantiating stubs were placed on a global singleton reference class no matter whether the target method was on a reference class or a value type. I have fixed it by putting the stubs on the instantiated target generic type instead.
2016-02-11Fix VSO bug #190301 contract problems in DACRaiseException.Mike McLaughlin1-2/+3
Added the proper contracts to the DAC notification functions.
2016-01-27Update license headersdotnet-bot1-4/+3
2016-01-18Add ready to run support to unix crossgenJan Vorlicek1-1/+1
This change enables ready to run support in the unix crossgen that was accidentally not enabled when adding ready to run support for Unix in the past. Only the FEATURE_READYTORUN was set, but not the FEATURE_READYTORUN_COMPILER.
2015-11-12Merge pull request #2033 from brianrob/crossgen_perfmap2Brian Robbins1-2/+2
Enable Offline Generation of Text-Based Symbol Tables for NGEN Images
2015-11-12Fix Thread.Start while debugging bug on OSX.Mike McLaughlin1-2/+6
The OSX exception logic is running on a separate thread from the one that the exception happened. The CatchHardwareExceptionHolder::IsEnabled used to check for h/w exception holders assumed it was running on the thread the exception/holders happened not the exception notification thread. Moved the h/w exception holder count to the CPalThread object instead of a TLS thread variable so the OSX exception code can check it given a CPalThread instance. The main problem was that the stubmgr when creating a thread (for the start notification) put a breakpoint in ThePreStubPatch which is in the coreclr text section and because the h/w exception holder check was broken, it thought the breakpoint wasn't the debugger's and aborted the coreclr process. The other part of this fix is to put a h/w exception holder around the called to ThePreStubPatch in prestub.cpp. The stubmgr's delegate invoke subclass used the wrong registers for Linux/OSX to read the "this" and parameter registers. Added the proper ifdefs and registers (ecx -> rdi, rdx -> rsi) for the Unix platforms. On both Linux and OSX, the h/w exception holder check in the exception routing logic needed to check if the int3/trap is in DBG_DebugBreak so asserts always abort/core dump. Move DBG_DebugBreak to an assembly worker so the start/end address can be used for this check.