Skip to content

Commit 1a95ca4

Browse files
authored
Merge pull request #2709 from dotnet/arobins/func1331
Add readme and some fixes.
2 parents a357a46 + 7c0d9fc commit 1a95ca4

File tree

3 files changed

+47
-80
lines changed

3 files changed

+47
-80
lines changed

README.md

Lines changed: 29 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,45 @@
1-
# .NET Runtime
1+
# CoreCLR Interpreter
22

3-
[![Build Status](https://dev.azure.com/dnceng-public/public/_apis/build/status/dotnet/runtime/runtime?branchName=main)](https://dev.azure.com/dnceng-public/public/_build/latest?definitionId=129&branchName=main)
4-
[![Help Wanted](https://img.shields.io/github/issues/dotnet/runtime/help%20wanted?style=flat-square&color=%232EA043&label=help%20wanted)](https://github.com/dotnet/runtime/labels/help%20wanted)
5-
[![Good First Issue](https://img.shields.io/github/issues/dotnet/runtime/good%20first%20issue?style=flat-square&color=%232EA043&label=good%20first%20issue)](https://github.com/dotnet/runtime/labels/good%20first%20issue)
6-
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dotnet/runtime)
7-
[![Discord](https://img.shields.io/discord/732297728826277939?style=flat-square&label=Discord&logo=discord&logoColor=white&color=7289DA)](https://aka.ms/dotnet-discord)
3+
See official dotnet/runtime [README.md](https://github.com/dotnet/runtime/blob/main/README.md).
84

9-
* [What is .NET?](#what-is-net)
10-
* [How can I contribute?](#how-can-i-contribute)
11-
* [Reporting security issues and security bugs](#reporting-security-issues-and-security-bugs)
12-
* [Filing issues](#filing-issues)
13-
* [Useful Links](#useful-links)
14-
* [.NET Foundation](#net-foundation)
15-
* [License](#license)
5+
## Build
166

17-
This repo contains the code to build the .NET runtime, libraries and shared host (`dotnet`) installers for
18-
all supported platforms, as well as the sources to .NET runtime and libraries.
7+
Pass the following flags to the `build.cmd` or `build.sh` file depending on the target platform:
198

20-
## What is .NET?
9+
> `-s clr+libs+clr.hosts -lc Release -rc Debug`
2110
22-
Official Starting Page: <https://dotnet.microsoft.com>
11+
Construct the `CORE_ROOT` environment, including the `corerun` testing binary:
2312

24-
* [How to use .NET](https://learn.microsoft.com/dotnet/core/get-started) (with VS, VS Code, command-line CLI)
25-
* [Install official releases](https://dotnet.microsoft.com/download)
26-
* [Documentation](https://learn.microsoft.com/dotnet/core) (Get Started, Tutorials, Porting from .NET Framework, API reference, ...)
27-
* [Deploying apps](https://learn.microsoft.com/dotnet/core/deploying)
28-
* [Support](https://github.com/dotnet/core/blob/main/support.md) (Releases, OS Versions, ...)
29-
* [Roadmap](https://github.com/dotnet/core/blob/main/roadmap.md)
13+
Windows:
3014

31-
## How can I contribute?
15+
> `src\tests\build.cmd x64 Debug CoreCLR GenerateLayoutOnly /p:LibrariesConfiguration=Release`
3216
33-
We welcome contributions! Many people all over the world have helped make this project better.
17+
Linux/macOS:
3418

35-
* [Contributing](CONTRIBUTING.md) explains what kinds of contributions we welcome
36-
* [Workflow Instructions](docs/workflow/README.md) explains how to build and test
37-
* [Dogfooding .NET](docs/project/dogfooding.md) explains how to get nightly builds of the runtime and its libraries to test them in your own projects.
19+
> `./src/tests/build.sh arm64 Debug CoreCLR GenerateLayoutOnly -p:LibrariesConfiguration=Release`
3820
39-
## Reporting security issues and security bugs
21+
## Running
4022

41-
Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) <secure@microsoft.com>. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://www.microsoft.com/msrc/faqs-report-an-issue). You can also find these instructions in this repo's [Security doc](SECURITY.md).
23+
The `corerun` binary accepts a `dotenv` file format. The following environment variables are recommended to run the interpreter.
4224

43-
Also see info about related [Microsoft .NET Bounty Program](https://www.microsoft.com/msrc/bounty-dot-net-core).
25+
The following environment variables can be pasted into a file and passed to the `corerun` binary using the `-e` flag.
4426

45-
## Filing issues
27+
```
28+
DOTNET_TieredCompilation=0
29+
DOTNET_ReadyToRun=0
30+
DOTNET_InterpreterDoLoopMethods=1
31+
DOTNET_InterpreterFallback=0
32+
DOTNET_ForceInterpreter=1
33+
DOTNET_InterpreterUseCaching=0
34+
DOTNET_InterpreterHWIntrinsicsIsSupportedFalse=1
35+
```
4636

47-
This repo should contain issues that are tied to the runtime, the class libraries and frameworks, the installation of the `dotnet` binary (sometimes known as the `muxer`) and the installation of the .NET runtime and libraries.
37+
The following are helpful in debugging hangs and the "current state" of the interpreter.
4838

49-
For other issues, please file them to their appropriate sibling repos. We have links to many of them on [our new issue page](https://github.com/dotnet/runtime/issues/new/choose).
39+
```
40+
DOTNET_TraceInterpreterEntries=1
41+
DOTNET_TraceInterpreterIL=1
42+
```
5043

51-
## Useful Links
52-
53-
* [.NET source index](https://source.dot.net) / [.NET Framework source index](https://referencesource.microsoft.com)
54-
* [API Reference docs](https://learn.microsoft.com/dotnet/api)
55-
* [.NET API Catalog](https://apisof.net) (incl. APIs from daily builds and API usage info)
56-
* [API docs writing guidelines](https://github.com/dotnet/dotnet-api-docs/wiki) - useful when writing /// comments
57-
* [.NET Discord Server](https://aka.ms/dotnet-discord) - a place to discuss the development of .NET and its ecosystem
58-
59-
## .NET Foundation
60-
61-
.NET Runtime is a [.NET Foundation](https://www.dotnetfoundation.org/projects) project.
62-
63-
There are many .NET related projects on GitHub.
64-
65-
* [.NET home repo](https://github.com/Microsoft/dotnet) - links to 100s of .NET projects, from Microsoft and the community.
66-
* [ASP.NET Core home](https://learn.microsoft.com/aspnet/core) - the best place to start learning about ASP.NET Core.
67-
68-
This project has adopted the code of conduct defined by the [Contributor Covenant](https://contributor-covenant.org) to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](https://www.dotnetfoundation.org/code-of-conduct).
69-
70-
General .NET OSS discussions: [.NET Foundation Discussions](https://github.com/dotnet-foundation/Home/discussions)
71-
72-
## License
73-
74-
.NET (including the runtime repo) is licensed under the [MIT](LICENSE.TXT) license.
44+
Many verification steps assume the following is disabled.
45+
`DOTNET_InterpreterLooseRules=0`

src/coreclr/clrfeatures.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if(NOT DEFINED FEATURE_DBGIPC)
1717
endif(NOT DEFINED FEATURE_DBGIPC)
1818

1919
if(NOT DEFINED FEATURE_INTERPRETER)
20-
set(FEATURE_INTERPRETER 0)
20+
set(FEATURE_INTERPRETER 1)
2121
endif(NOT DEFINED FEATURE_INTERPRETER)
2222

2323
if(NOT DEFINED FEATURE_STANDALONE_GC)

src/coreclr/vm/interpreter.cpp

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -753,12 +753,12 @@ CorJitResult Interpreter::GenerateInterpreterStub(CEEInfo* comp,
753753
{
754754
const char* clsName;
755755
const char* methName = getMethodName(comp, info->ftn, &clsName);
756-
if ( !s_InterpretMeths.contains(methName, clsName, info->args.pSig)
757-
|| s_InterpretMethsExclude.contains(methName, clsName, info->args.pSig))
758-
{
759-
TRACE_SKIPPED(clsName, methName, "not in set of methods to interpret");
760-
return CORJIT_SKIPPED;
761-
}
756+
// if ( !s_InterpretMeths.contains(methName, clsName, info->args.pSig)
757+
// || s_InterpretMethsExclude.contains(methName, clsName, info->args.pSig))
758+
// {
759+
// TRACE_SKIPPED(clsName, methName, "not in set of methods to interpret");
760+
// return CORJIT_SKIPPED;
761+
// }
762762

763763
unsigned methHash = comp->getMethodHash(info->ftn);
764764
if ( methHash < s_InterpretMethHashMin.val(CLRConfig::INTERNAL_InterpreterMethHashMin)
@@ -9304,16 +9304,18 @@ void Interpreter::DoCallWork(bool virtualCall, void* thisArg, CORINFO_RESOLVED_T
93049304
const char* className = NULL;
93059305
const char* methodName = getMethodName(&m_interpCeeInfo, (CORINFO_METHOD_HANDLE)methToCall, &className, &namespaceName);
93069306
if (
9307-
(strcmp(namespaceName, "System.Runtime.Intrinsics") == 0 ||
9307+
(strcmp(namespaceName, "System.Runtime.Intrinsics") == 0
93089308
#if defined(TARGET_X86) || defined(TARGET_AMD64)
9309-
strcmp(namespaceName, "System.Runtime.Intrinsics.X86") == 0
9309+
|| strcmp(namespaceName, "System.Runtime.Intrinsics.X86") == 0
93109310
#elif defined(TARGET_ARM64)
9311-
strcmp(namespaceName, "System.Runtime.Intrinsics.Arm") == 0
9312-
#else
9313-
0
9311+
|| strcmp(namespaceName, "System.Runtime.Intrinsics.Arm") == 0
93149312
#endif
9315-
) &&
9316-
strcmp(methodName, "get_IsSupported") == 0
9313+
|| (strcmp(namespaceName, "") == 0
9314+
&& (strcmp(className, "V512") == 0
9315+
|| strcmp(className, "VL") == 0
9316+
|| strcmp(className, "X64") == 0))
9317+
)
9318+
&& strcmp(methodName, "get_IsSupported") == 0
93179319
)
93189320
{
93199321
GCX_COOP();
@@ -10533,21 +10535,15 @@ void Interpreter::CallI()
1053310535
{
1053410536
pMD = CoreLibBinder::GetMethod(METHOD__INTERLOCKED__COMPARE_EXCHANGE_OBJECT); // A random static method.
1053510537
}
10538+
1053610539
MethodDescCallSite mdcs(pMD, &mSig, ftnPtr);
10537-
#if 0
10540+
1053810541
// If the current method being interpreted is an IL stub, we're calling native code, so
1053910542
// change the GC mode. (We'll only do this at the call if the calling convention turns out
1054010543
// to be a managed calling convention.)
1054110544
MethodDesc* pStubContextMD = reinterpret_cast<MethodDesc*>(m_stubContext);
1054210545
bool transitionToPreemptive = (pStubContextMD != NULL && !pStubContextMD->IsIL());
1054310546
mdcs.CallTargetWorker(args, &retVal, sizeof(retVal), transitionToPreemptive);
10544-
#else
10545-
// TODO The code above triggers assertion at threads.cpp:6861:
10546-
// _ASSERTE(thread->PreemptiveGCDisabled()); // Should have been in managed code
10547-
// The workaround will likely break more things than what it is fixing:
10548-
// just do not make transition to preemptive GC for now.
10549-
mdcs.CallTargetWorker(args, &retVal, sizeof(retVal));
10550-
#endif
1055110547
}
1055210548
// retVal is now vulnerable.
1055310549
GCX_FORBID();

0 commit comments

Comments
 (0)