Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
/corefxPublic archive

Commit5ce17d9

Browse files
authored
Expose RuntimeFeature.IsDynamicCodeSupported/Compiled (#33928)
Fixes #29258
1 parent5e932ed commit5ce17d9

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

‎src/System.Runtime/ref/System.Runtime.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ public void End() { }
128128
[System.CLSCompliantAttribute(false)]
129129
public System.TypedReference GetNextArg(System.RuntimeTypeHandle rth) { throw null; }
130130
public System.RuntimeTypeHandle GetNextArgType() { throw null; }
131-
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.InternalCall)]
132131
public int GetRemainingCount() { throw null; }
133132
}
134133
public partial class ArgumentException : System.SystemException
@@ -6756,6 +6755,8 @@ public static partial class RuntimeFeature
67566755
public const string DefaultImplementationsOfInterfaces = "DefaultImplementationsOfInterfaces";
67576756
#endif
67586757
public const string PortablePdb = "PortablePdb";
6758+
public static bool IsDynamicCodeCompiled { get { throw null; } }
6759+
public static bool IsDynamicCodeSupported { get { throw null; } }
67596760
public static bool IsSupported(string feature) { throw null; }
67606761
}
67616762
public static partial class RuntimeHelpers
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
Compat issues with assembly System.Runtime:
21
MembersMustExist : Member 'System.String System.Runtime.CompilerServices.RuntimeFeature.DefaultImplementationsOfInterfaces' does not exist in the implementation but it does exist in the contract.
3-
TypeCannotChangeClassification : Type 'System.DateTimeOffset' is marked as readonly in the contract so it must also be marked readonly in the implementation.
4-
TypeCannotChangeClassification : Type 'System.TimeSpan' is marked as readonly in the contract so it must also be marked readonly in the implementation.
5-
TypeCannotChangeClassification : Type 'System.Runtime.Serialization.SerializationEntry' is marked as readonly in the contract so it must also be marked readonly in the implementation.
62
TypesMustExist : Type 'System.ArgIterator' does not exist in the implementation but it does exist in the contract.
7-
TypesMustExist : Type 'System.Index' does not exist in the implementation but it does exist in the contract.
8-
TypesMustExist : Type 'System.Range' does not exist in the implementation but it does exist in the contract.
9-
TypesMustExist : Type 'System.Text.Rune' does not exist in the implementation but it does exist in the contract.
10-
TypesMustExist : Type 'System.Text.StringRuneEnumerator' does not exist in the implementation but it does exist in the contract.
11-
MembersMustExist : Member 'System.ReadOnlySpan<T>.Item.get(System.Index)' does not exist in the implementation but it does exist in the contract.
12-
MembersMustExist : Member 'System.ReadOnlySpan<T>.Item.get(System.Range)' does not exist in the implementation but it does exist in the contract.
13-
MembersMustExist : Member 'System.Span<T>.Item.get(System.Index)' does not exist in the implementation but it does exist in the contract.
14-
MembersMustExist : Member 'System.Span<T>.Item.get(System.Range)' does not exist in the implementation but it does exist in the contract.
3+
MembersMustExist : Member 'System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeCompiled.get()' does not exist in the implementation but it does exist in the contract.
4+
MembersMustExist : Member 'System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported.get()' does not exist in the implementation but it does exist in the contract.
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
TypesMustExist : Type 'System.ArgIterator' does not exist in the implementation but it does exist in the contract.
2-
TypesMustExist : Type 'System.Index' does not exist in the implementation but it does exist in the contract.
3-
TypesMustExist : Type 'System.Range' does not exist in the implementation but it does exist in the contract.
4-
TypesMustExist : Type 'System.Text.Rune' does not exist in the implementation but it does exist in the contract.
5-
TypesMustExist : Type 'System.Text.StringRuneEnumerator' does not exist in the implementation but it does exist in the contract.
6-
MembersMustExist : Member 'System.ReadOnlySpan<T>.Item.get(System.Index)' does not exist in the implementation but it does exist in the contract.
7-
MembersMustExist : Member 'System.ReadOnlySpan<T>.Item.get(System.Range)' does not exist in the implementation but it does exist in the contract.
8-
MembersMustExist : Member 'System.Span<T>.Item.get(System.Index)' does not exist in the implementation but it does exist in the contract.
9-
MembersMustExist : Member 'System.Span<T>.Item.get(System.Range)' does not exist in the implementation but it does exist in the contract.
2+
MembersMustExist : Member 'System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeCompiled.get()' does not exist in the implementation but it does exist in the contract.
3+
MembersMustExist : Member 'System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported.get()' does not exist in the implementation but it does exist in the contract.

‎src/System.Runtime/tests/System/Runtime/CompilerServices/RuntimeFeatureTests.netcoreapp.cs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,24 @@ public static void PortablePdb()
1515
{
1616
Assert.True(RuntimeFeature.IsSupported("PortablePdb"));
1717
}
18+
19+
[Fact]
20+
publicstaticvoidDynamicCode()
21+
{
22+
Assert.Equal(RuntimeFeature.IsDynamicCodeSupported,RuntimeFeature.IsSupported("IsDynamicCodeSupported"));
23+
Assert.Equal(RuntimeFeature.IsDynamicCodeCompiled,RuntimeFeature.IsSupported("IsDynamicCodeCompiled"));
24+
25+
if(RuntimeFeature.IsDynamicCodeCompiled)
26+
{
27+
Assert.True(RuntimeFeature.IsDynamicCodeSupported);
28+
}
29+
}
30+
31+
[ConditionalTheory(typeof(PlatformDetection),nameof(PlatformDetection.IsNotNetNative))]
32+
publicstaticvoidDynamicCode_Jit()
33+
{
34+
Assert.True(RuntimeFeature.IsDynamicCodeSupported);
35+
Assert.True(RuntimeFeature.IsDynamicCodeCompiled);
36+
}
1837
}
1938
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp