Skip to content

Commit e4b88f5

Browse files
committed
Two updates to RyuJIT troubleshooting
1. Add comments about NGEN and the TailCallOpt registry switch. 2. Add comments on using REG.EXE to set registry variables from the command-line.
1 parent a592859 commit e4b88f5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/testing-with-ryujit.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ existing NGEN images that have been compiled by the new JIT continue to be used.
5757
Type: DWORD (32-bit) Value (also called REG_WORD)
5858
Value: 1
5959

60+
You can use the Windows REG.EXE tool to add this value from a command-line or scripting environment. For example:
61+
62+
reg add HKLM\SOFTWARE\Microsoft\.NETFramework /v useLegacyJit /t REG_DWORD /d 1
63+
64+
In this case, `HKLM` is used instead of `HKEY_LOCAL_MACHINE`. Use `reg add /?` to see help on this syntax.
65+
6066
Disable loading NGEN Images
6167
===========================
6268

@@ -159,8 +165,10 @@ You can disable tail call optimization in RyuJIT with the following instructions
159165
Type: String Value (also known as REG_SZ)
160166
Value: "0" (Double quotes are not required while entering the string value in Registry Editor)
161167

162-
Disabling optimization of a function
163-
====================================
168+
**Note** This will disable tail call optimization of a function when the JIT is invoked to compile it. Note that if your application is NGEN compiled, the JIT is not invoked after the NGEN compilation has completed. To affect the code compiled for NGEN, you must first remove your application from the NGEN native image cache using `ngen uninstall MyApp`. Then, set the registry key shown here. Finally, optionally, you can re-NGEN your app using `ngen install MyApp.exe`.
169+
170+
Disabling all optimization of a function
171+
========================================
164172

165173
If you determine that the JIT is incorrectly optimizing a particular function, you can selectively disable JIT optimization for that function by annotating that function with `MethodImplOptions.NoOptimization`. For example, in C#:
166174

0 commit comments

Comments
 (0)