-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hot_reload] implement param reflection (#77563)
* Add new test ReflectionAddNewMethod * FIXME: get_param_names, get_marshal_info and custom_attrs need work * WIP - add a method param reverse lookup * look up params from added methods * Remove FIXMEs and unused field * remove writelines from test * fix test on coreclr * why does coreclr have 2 attributes here?? * There should be 2 attributes on the 4th param * one more place that looks at params * A couple more places where we look at the Params table * Check default values on params on added method * fix lookup if table is empty * add a gratuitious typeof assert otherwise the CancellationToken type is trimmed on wasm * Add a single mono_metadata_get_method_params function remove duplicated code
- Loading branch information
1 parent
9a138bf
commit a27ecc5
Showing
17 changed files
with
325 additions
and
70 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...tem.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewMethod/ReflectionAddNewMethod.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System; | ||
|
||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test | ||
{ | ||
public class ReflectionAddNewMethod | ||
{ | ||
public string ExistingMethod(string u, double f) | ||
{ | ||
return u + f.ToString();; | ||
} | ||
|
||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
....Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewMethod/ReflectionAddNewMethod_v1.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
using CancellationToken = System.Threading.CancellationToken; | ||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test | ||
{ | ||
public class ReflectionAddNewMethod | ||
{ | ||
public string ExistingMethod(string u, double f) | ||
{ | ||
return u + f.ToString();; | ||
} | ||
|
||
public double AddedNewMethod(char c, float h, string w, CancellationToken ct = default, [CallerMemberName] string callerName = "") | ||
{ | ||
return ((double)Convert.ToInt32(c)) + h; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ionAddNewMethod/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewMethod.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<RootNamespace>System.Runtime.Loader.Tests</RootNamespace> | ||
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework> | ||
<TestRuntime>true</TestRuntime> | ||
<DeltaScript>deltascript.json</DeltaScript> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="ReflectionAddNewMethod.cs" /> | ||
</ItemGroup> | ||
</Project> |
6 changes: 6 additions & 0 deletions
6
...pdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewMethod/deltascript.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"changes": [ | ||
{"document": "ReflectionAddNewMethod.cs", "update": "ReflectionAddNewMethod_v1.cs"}, | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.