-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/6.0-rc1] [hot_reload] Don't look at delta method table rows (#…
…57799) * Add test case Call a method for the first time after an update has been applied to it. This will check that the interpreter or JIT does not have to rely on cached information from the baseline (about the method signature, for example) and that it can compute it from the delta. * [hot_reload] Don't look at delta method table rows The issue is that the ParamList column in EnC deltas is a "suppressed column" that has the value 0. So when a method is updated if we use the value directly, we will break, for example - `mono_metadata_get_param_attrs` which expects a non-zero index in that column. CoreCLR solves this by having a set of suppressed columns that are never updated by deltas. (CoreCLR's model is to directly mutate the tables of the baseline image). In Mono we can eventually do the same thing by writing the value from the previous generation into the current delta's row. But right now since we don't allow parameter modifications, and the only column on a Method table that we allow to be modified is the RVA - which we look up specially - we can just always return the baseline image row for the method table. Fixes #57643 Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
- Loading branch information
1 parent
236e490
commit 13b1111
Showing
8 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
.../System.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate/FirstCallAfterUpdate.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,12 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test | ||
{ | ||
public class FirstCallAfterUpdate { | ||
public FirstCallAfterUpdate() {} | ||
public string Method1 (string s) { | ||
return s + " STRING"; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...stem.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate/FirstCallAfterUpdate_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,12 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test | ||
{ | ||
public class FirstCallAfterUpdate { | ||
public FirstCallAfterUpdate() {} | ||
public string Method1(string s) { | ||
return "NEW " + s; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...stem.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate/FirstCallAfterUpdate_v2.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,12 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace System.Reflection.Metadata.ApplyUpdate.Test | ||
{ | ||
public class FirstCallAfterUpdate { | ||
public FirstCallAfterUpdate() {} | ||
public string Method1(string s) { | ||
return s + "EST STRING"; | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...stCallAfterUpdate/System.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate.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,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<RootNamespace>System.Runtime.Loader.Tests</RootNamespace> | ||
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks> | ||
<TestRuntime>true</TestRuntime> | ||
<DeltaScript>deltascript.json</DeltaScript> | ||
<SkipTestUtilitiesReference>true</SkipTestUtilitiesReference> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="FirstCallAfterUpdate.cs" /> | ||
</ItemGroup> | ||
</Project> |
7 changes: 7 additions & 0 deletions
7
...yUpdate/System.Reflection.Metadata.ApplyUpdate.Test.FirstCallAfterUpdate/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,7 @@ | ||
{ | ||
"changes": [ | ||
{"document": "FirstCallAfterUpdate.cs", "update": "FirstCallAfterUpdate_v1.cs"}, | ||
{"document": "FirstCallAfterUpdate.cs", "update": "FirstCallAfterUpdate_v2.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