Skip to content

Commit 36a5835

Browse files
committed
Merge pull request microsoft#11 from Microsoft/rich-ryujit
Add instructions for using RyuJIT
2 parents 68227b4 + 8aefa79 commit 36a5835

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

docs/enabling-the-latest-ryujit.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# How to enable a RyuJIT CTP
2+
3+
Download and install the latest [RyuJIT](http://aka.ms/RyuJIT) now.
4+
5+
RyuJIT only works on 64-bit editions of Windows Vista and Windows Server 2008 and later.
6+
7+
After installation, there are two ways to turn on RyuJIT. If you just want to enable RyuJIT for one application, set an environment variable:
8+
9+
set COMPLUS_AltJit=*
10+
11+
If you want to enable RyuJIT for your entire machine, set the registry key:
12+
13+
HKLM\SOFTWARE\Microsoft\.NETFramework\AltJit
14+
Default (string) = "*"
15+
16+
Both registration methods cause the 64-bit CLR to use the latest RyuJIT instead of the built-in JIT, either JIT64 in the case of .NET Framework 4.5.1 and 4.5.2 or an earlier version of RyuJIT in the case of the .NET Framework 4.6. You can remove these settings at any time and you'll return to using the built-in JIT.
17+
18+
## Known Gotchas
19+
20+
1. **No NGen Support**. RyuJIT doesn't change NGen on your system. we wanted to keep the CTP install clean
21+
2. **No Edit & Continue**. If you enable RyuJIT while writing code, you'll find that Edit & Continue doesn't work on 64-bit. One work around is disable RyuJIT while debugging.
22+
23+
## Contact a Human
24+
25+
If you have questions or problems contact us at <ryujit@microsoft.com>.

docs/testing-with-ryujit.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# .NET Framework 4.6 - Testing with RyuJIT
2+
3+
The .NET Framework 4.6 includes new Just-In-Time (JIT) compiler for 64-bit processes, called RyuJIT. It is enabled by default. It is still a preview version, so you may discover issues that have yet to be fixed.
4+
5+
You may experience the following symptoms when you use the new JIT compiler:
6+
7+
* An application throws an `InvalidProgramException` error.
8+
* An application works on an x86-based computer but not on an x64-based
9+
computer.
10+
11+
## Workarounds for JIT Compilation
12+
13+
To work around this problem, use any one of the following methods.
14+
15+
**Important** Follow the steps in this section carefully. Serious problems might
16+
occur if you modify the registry incorrectly. Before you modify it,
17+
[back up the registry](http://support.microsoft.com/kb/322756) for restoration
18+
in case problems occur.
19+
20+
**Note** For all these methods, all dynamic compilation is performed by the older
21+
JIT64 JIT. Also, all NGEN compilation continues to use the new JIT, and all
22+
existing NGEN images that have been compiled by the new JIT continue to be used.
23+
24+
* **Method 1**. Set the following environment variable:
25+
26+
COMPLUS_useLegacyJit=1
27+
28+
* **Method 2**. In the registry, create either of the following subkeys:
29+
30+
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
31+
HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework
32+
33+
Then, specify the following:
34+
35+
Key name: useLegacyJit
36+
Type: REG_WORD
37+
Value: 1
38+
39+
* **Method 3**. Add the following text to the `<app>.exe.config file`. Create
40+
the indicated sections if they do not already exist.
41+
42+
**Note** In this file name, `<app>` represents the actual name of the
43+
application.
44+
45+
<configuration>
46+
<runtime>
47+
<useLegacyJit enabled="1">
48+
</runtime>
49+
</configuration>
50+
51+
## Workarounds for NGEN Compilation
52+
53+
If you encounter a bug when you use the new JIT, and if the bug manifests itself
54+
as an NGEN image, use any of the following methods to force certain named
55+
assemblies to be recompiled by the JIT and not use the existing native images:
56+
57+
* **Method 1**. Set the following environment variable:
58+
59+
COMPLUS_DisableNativeImageLoadList=assembly_one;assembly_two;assembly_three
60+
61+
* **Method 2**. In the registry, create either of the following subkeys:
62+
63+
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
64+
HKEY_CURRENT_USER\SOFTWARE\Microsoft\.NETFramework
65+
66+
Then, specify the following:
67+
68+
Key name: DisableNativeImageLoadList
69+
Type: REG_SZ
70+
Value: assembly_one;assembly_two;assembly_three
71+
72+
**Note** This is a semicolon-delimited or space-delimited list of simple
73+
assembly names (no public key token, no architecture, and so on). This list
74+
does not contain the `.dll` file name extension. In the examples in this
75+
method and the next method, `assembly_one` is the simple name for an assembly
76+
that is named `assembly_one.dll`.
77+
78+
* **Method 3**. Add the following text to the `<app>.exe.config` file. Create
79+
the indicated sections if they do not already exist.
80+
81+
**Note** In this file name, `<app>` represents the actual name of the
82+
application.
83+
84+
<configuration>
85+
<runtime>
86+
<disableNativeImageLoad>
87+
<assemblyIdentity name="assembly_one" />
88+
<assemblyIdentity name="assembly_two" />
89+
</disableNativeImageLoad>
90+
</runtime>
91+
</configuration>

0 commit comments

Comments
 (0)