add-new-jit-ee-api
Add a new API to the JIT-VM (aka JIT-EE) interface in the codebase.
Install
mkdir -p .claude/skills/add-new-jit-ee-api && curl -L -o skill.zip "https://mcp.directory/api/skills/download/5206" && unzip -o skill.zip -d .claude/skills/add-new-jit-ee-api && rm skill.zipInstalls to .claude/skills/add-new-jit-ee-api
About this skill
JIT-EE Interface extension
1 — Goal
Implement one new JIT-VM (also known as JIT-EE) API and all supporting glue. The JIT-VM interface defines the APIs through which the JIT compiler communicates with the runtime (VM).
2 — Required user inputs
Ask the user for a C-like signature of the new API if it's not provided.
Suggest <repo_root>/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt file as a reference. Example:
CORINFO_METHOD_HANDLE getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg);
3 — Implementation steps (must be completed in order)
- Update the
ThunkInput.txtfile with the new API definition. Example:
+CORINFO_METHOD_HANDLE getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg);
Insert the new API definition without removing any existing entries, placing it near similar signatures.
-
Invoke
<repo_root>/src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.shscript (or<repo_root>/src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.baton Windows) to update auto-generated files. Use the correct directory for the script to run. -
Open
<repo_root>/src/coreclr/inc/corinfo.hand add the new API insideclass ICorStaticInfoclass as the last member. Example:
+ virtual CORINFO_METHOD_HANDLE getUnboxedEntry(
+ CORINFO_METHOD_HANDLE ftn,
+ bool* requiresInstMethodTableArg
+ ) = 0;
- Open
<repo_root>/src/coreclr/tools/Common/JitInterface/CorInfoImpl.csand add the new API in the end ofclass CorInfoImplclass declaration. Use<repo_root>/src/coreclr/tools/Common/JitInterface/CorInfoImpl_generated.csto inspect how type parameters look like for C# for the newly added API since it is expected to be auto-generated there by the gen.sh(bat) script. Example:
+ private CORINFO_METHOD_STRUCT_* getUnboxedEntry(CORINFO_METHOD_STRUCT_* ftn, ref bool requiresInstMethodTableArg)
+ {
+ // Use CorInfoImpl.RyuJit.cs and CorInfoImpl.ReadyToRun.cs if the implementation
+ // is not shared for NativeAOT and R2R.
+ throw new NotImplementedException();
+ }
Implement the API if asked, leave the NotImplementedException() otherwise.
- Open
<repo_root>/src/coreclr/vm/jitinterface.cppand add a dummy implementation at the file's end. Example:
+CORINFO_METHOD_HANDLE CEEInfo::getUnboxedEntry(
+ CORINFO_METHOD_HANDLE ftn,
+ bool* requiresInstMethodTableArg)
+{
+ CONTRACTL {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_PREEMPTIVE;
+ } CONTRACTL_END;
+
+ CORINFO_METHOD_HANDLE result = NULL;
+
+ JIT_TO_EE_TRANSITION();
+
+ UNREACHABLE(); // To be implemented
+
+ EE_TO_JIT_TRANSITION();
+
+ return result;
+}
Implement the API if asked, leave the UNREACHABLE() otherwise.
- Now implement the most complex part - SuperPMI. SuperPMI acts as a (de)serializer for JIT-VM queries in order to then replay them without the actual VM to speed up jit-diffs and other scenarios. All parameters and return values recorded/restored using special primitve types and helpers. We need to update the following files:
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h:<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h:<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h:<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp:
Go through each of them one by one.
-
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h: Define twoAgnostic_*types for input arguments and another one for output parameters (return value, output arguments). Do not create them if one of the generics ones can be re-used such asDLD,DD,DLDL, etc. UseDWORD*like types for integers. Inspect the whole file to see how other APIs are defined. -
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h: Add a new entry to theLWMlist. Example:
+LWM(GetUnboxedEntry, DWORDLONG, DLD);
NOTE: Use upper-case for the first letter of the API name here. Add the new record after the very last LWM one.
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h: Define 3 methods in this header file insideclass MethodContextclass (at the end of its definition).
The methods are prefixed with rec* (record), dmp* (dump to console) and rep* (replay). Example
+ void recGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg, CORINFO_METHOD_HANDLE result);
+ void dmpGetUnboxedEntry(DWORDLONG key, DLD value);
+ CORINFO_METHOD_HANDLE repGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg);
Now add a new element to enum mcPackets enum in the same file. Example:
+ Packet_GetUnboxedEntry = <last value + 1>,
<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp: Add the implementation of the 3 methods tomethodcontext.cppat the end of it. Consider other similar methods in the file for reference. Do not change implementations of other methods in the file. Example:
+void MethodContext::recGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn,
+ bool* requiresInstMethodTableArg,
+ CORINFO_METHOD_HANDLE result)
+{
+ // Initialize the "input - output" map if it is not already initialized
+ if (GetUnboxedEntry == nullptr)
+ {
+ GetUnboxedEntry = new LightWeightMap<DWORDLONG, DLD>();
+ }
+
+ // Create a key out of the input arguments
+ DWORDLONG key = CastHandle(ftn);
+ DLD value;
+ value.A = CastHandle(result);
+
+ // Create a value out of the return value and out parameters
+ if (requiresInstMethodTableArg != nullptr)
+ {
+ value.B = (DWORD)*requiresInstMethodTableArg ? 1 : 0;
+ }
+ else
+ {
+ value.B = 0;
+ }
+
+ // Save it to the map
+ GetUnboxedEntry->Add(key, value);
+ DEBUG_REC(dmpGetUnboxedEntry(key, value));
+}
+void MethodContext::dmpGetUnboxedEntry(DWORDLONG key, DLD value)
+{
+ // Dump key and value to the console for debug purposes.
+ printf("GetUnboxedEntry ftn-%016" PRIX64 ", result-%016" PRIX64 ", requires-inst-%u", key, value.A, value.B);
+}
+CORINFO_METHOD_HANDLE MethodContext::repGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg)
+{
+ // Create a key out of the input arguments
+ DWORDLONG key = CastHandle(ftn);
+
+ // Perform the lookup to obtain the value (output arguments and return value)
+ DLD value = LookupByKeyOrMiss(GetUnboxedEntry, key, ": key %016" PRIX64 "", key);
+ DEBUG_REP(dmpGetUnboxedEntry(key, value));
+
+ // propagate result to output arguments and return value (if exists)
+ if (requiresInstMethodTableArg != nullptr)
+ {
+ *requiresInstMethodTableArg = (value.B == 1);
+ }
+ return (CORINFO_METHOD_HANDLE)(value.A);
+}
- Add a new function to
<repo_root>/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cppthat calls therep*method. Example:
+CORINFO_METHOD_HANDLE MyICJI::getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg)
+{
+ jitInstance->mc->cr->AddCall("getUnboxedEntry");
+ CORINFO_METHOD_HANDLE result = jitInstance->mc->repGetUnboxedEntry(ftn, requiresInstMethodTableArg);
+ return result;
+}
- Add a new function to
<repo_root>/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cppthat calls therec*method. Example:
+CORINFO_METHOD_HANDLE interceptor_ICJI::getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg)
+{
+ mc->cr->AddCall("getUnboxedEntry");
+ bool localRequiresInstMethodTableArg = false;
+ CORINFO_METHOD_HANDLE result = original_ICorJitInfo->getUnboxedEntry(ftn, &localRequiresInstMethodTableArg);
+ mc->recGetUnboxedEntry(ftn, &localRequiresInstMethodTableArg, result);
+ if (requiresInstMethodTableArg != nullptr)
+ {
+ *requiresInstMethodTableArg = localRequiresInstMethodTableArg;
+ }
+ return result;
+}
4 — Definition of Done (self-check list)
- New API present in all layers.
- Each source file changed exactly once; no unrelated edits. The following files must be changed:
<repo_root>/src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt<repo_root>/src/coreclr/inc/corinfo.h<repo_root>/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs<repo_root>/src/coreclr/vm/jitinterface.cpp<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/agnostic.h[optional - only if new types are needed]<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/lwmlist.h<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.h<repo_root>/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp<repo_root>/src/coreclr/tools/superpmi/superpmi/icorjitinfo.cpp<repo_root>/src/coreclr/tools/superpmi/superpmi-shim-collector/icorjitinfo.cpp
- All TODO/UNREACHABLE markers remain for future functional implementation.
More by dotnet
View all skills by dotnet →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversGitHub Chat lets you query, analyze, and explore GitHub repositories with AI-powered insights, understanding codebases f
A2AMCP synchronizes multiple AI agents on shared codebases with Redis-powered messaging, file locking, interface sharing
Optimize your codebase for AI with Repomix—transform, compress, and secure repos for easier analysis with modern AI tool
Serena is a free AI code generator toolkit providing robust code editing and retrieval, turning LLMs into powerful artif
Uno Platform — Documentation and prompts for building cross-platform .NET apps with a single codebase. Get guides, sampl
Arize Phoenix — unified interface for managing prompts, exploring datasets, and running LLM experiments across providers
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.