Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
51b978d
Remove SPILLED JitDisasm in favor of JitDisasmSpilled
jakobbotsch Aug 23, 2022
8100597
JIT: Simplify MethodSet matching behavior
jakobbotsch Aug 23, 2022
efdc84a
Update docs, minor nits
jakobbotsch Aug 23, 2022
a2af04b
Merge branch 'main' of github.com:dotnet/runtime into jit-method-name…
jakobbotsch Aug 23, 2022
dc67a40
Apply suggestions from code review
jakobbotsch Aug 24, 2022
03a1fa7
Update docs/design/coreclr/jit/viewing-jit-dumps.md
jakobbotsch Aug 25, 2022
4ded1a9
Use appendClassName to get namespaces and generic instantiations
jakobbotsch Aug 31, 2022
4dcce2a
Format instantiations in JIT
jakobbotsch Sep 1, 2022
510e5ec
Minor adjustments
jakobbotsch Sep 1, 2022
da27ae0
Add method instantiations
jakobbotsch Sep 1, 2022
55693f3
Update docs
jakobbotsch Sep 1, 2022
e9e6e06
Go back to square brackets
jakobbotsch Sep 1, 2022
daf08e4
Congruence
jakobbotsch Sep 1, 2022
633fa76
Single quotes
jakobbotsch Sep 1, 2022
2764293
Add some SPMI error traps
jakobbotsch Sep 1, 2022
0748742
Switch vsnprintf_s -> _vsnprintf_s, move StringPrinter::Printf to cpp…
jakobbotsch Sep 1, 2022
5de9b29
Another compilation fix
jakobbotsch Sep 1, 2022
98eee9f
Change crossgen2/ILC to fill in instantiations always
jakobbotsch Sep 2, 2022
bebe9f4
Fix a couple more angle brackets, add some braces to single line ifs
jakobbotsch Sep 2, 2022
0cf37d7
Make globbing quadratic instead of exponential
jakobbotsch Sep 2, 2022
68dfcda
Use asCorInfoType instead of getTypeForPrimitiveValueClass
jakobbotsch Sep 2, 2022
a94ac52
Run jit-format
jakobbotsch Sep 2, 2022
b0d00ac
Merge branch 'main' of github.com:dotnet/runtime into jit-method-name…
jakobbotsch Sep 2, 2022
a3f01e9
SPMI: Fix getTypeInstantiationArgument
jakobbotsch Sep 2, 2022
ae673c1
Bump JIT-EE GUID
jakobbotsch Sep 2, 2022
a8737b3
Add header comments, rename some parameters
jakobbotsch Sep 2, 2022
4507256
Apply suggestions from code review
jakobbotsch Sep 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions docs/design/coreclr/jit/viewing-jit-dumps.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,31 @@ These can be set in one of three ways:

## Specifying method names

The complete syntax for specifying a single method name (for a flag that takes a method name, such as `COMPlus_JitDump`) is:
Some environment variables such as `COMPlus_JitDump` take a set of patterns specifying method names. The matching works in the following way:
* The environment variable is a space-separated list of patterns that can be quoted if they need to contain spaces.
* Patterns can contain * and ? wildcards matching respectively any characters and any 1 character.
* If the pattern contains a : character, then the string matched against is prefixed with `ClassName:`.
* If the patter ncontains a ( character, then the string matched against is suffixed with its signature.

In particular, the matching is done against strings of the following format which coincides with how the JIT displays method signatures:
```
[[<Namespace>.]<ClassName>::]<MethodName>[([<types>)]
[<ClassName>:]<MethodName>[([<types>)]
```

For example
In debug builds the class name is allowed to contain the namespace as well and the JIT will try to match both with and without the namespace.

```
System.Object::ToString(System.Object)
```

The namespace, class name, and argument types are optional, and if they are not present, default to a wildcard. Thus stating:

```
Main
```

will match all methods named Main from any class and any number of arguments.
The following are equivalent:
* `WriteLine`
* `*:WriteLine`
* `*:WriteLine(*)`

`<types>` is a comma separated list of type names. Note that presently only the number of arguments and not the types themselves are used to distinguish methods. Thus, `Main(Foo, Bar)` and `Main(int, int)` will both match any main method with two arguments.
So are the following:
* `*`
* `*:*`
* `*:*(*)`

The wildcard character `*` can be used for `<ClassName>` and `<MethodName>`. In particular `*` by itself indicates every method.
The following will only match the string overload of `Console.WriteLine`:
* `Console:WriteLine(String)`

## Useful COMPlus variables

Expand Down
7 changes: 4 additions & 3 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2879,7 +2879,7 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
opts.disAsm = true;
}

if (JitConfig.JitDisasm().contains("SPILLED", nullptr, nullptr))
if (JitConfig.JitDisasmSpilled())
{
opts.disAsmSpilled = true;
}
Expand Down Expand Up @@ -3017,8 +3017,9 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
#else // DEBUG
if (!JitConfig.JitDisasm().isEmpty())
{
const char* methodName = info.compCompHnd->getMethodName(info.compMethodHnd, nullptr);
const char* className = info.compCompHnd->getClassName(info.compClassHnd);
const char* className;
const char* methodName = info.compCompHnd->getMethodName(info.compMethodHnd, &className);

if (JitConfig.JitDisasm().contains(methodName, className, &info.compMethodInfo->args))
{
opts.disAsm = true;
Expand Down
8 changes: 8 additions & 0 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7562,6 +7562,14 @@ class Compiler

var_types eeGetFieldType(CORINFO_FIELD_HANDLE fldHnd, CORINFO_CLASS_HANDLE* pStructHnd = nullptr);

void eeFormatMethodName(char** buffer,
size_t bufferMax,
const char* className,
const char* methodName,
CORINFO_SIG_INFO* sig,
bool includeReturnType,
bool includeThis);

#if defined(DEBUG) || defined(FEATURE_JIT_METHOD_PERF) || defined(FEATURE_SIMD) || defined(TRACK_LSRA_STATS)

const char* eeGetMethodName(CORINFO_METHOD_HANDLE hnd, const char** className);
Expand Down
Loading