Skip to content

Commit

Permalink
Initial support for Hot Reload on ARM (#51902)
Browse files Browse the repository at this point in the history
* Initial support for Hot Reload on ARM

* AssemblyExtensionsTest fix for ARM
  • Loading branch information
tommcdon authored Apr 28, 2021
1 parent a4d5889 commit 9f55689
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ if(CLR_CMAKE_HOST_WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(CLR_CMAKE_HOST_WIN32)

# Only enable edit and continue on x86 and x64, exclude arm & arm64
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:EnC_SUPPORTED>)
if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:EnC_SUPPORTED>)
if(CLR_CMAKE_TARGET_WIN32)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_ENC_SUPPORTED>)
endif(CLR_CMAKE_TARGET_WIN32)
Expand Down
4 changes: 4 additions & 0 deletions src/coreclr/vm/encee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,9 @@ HRESULT EditAndContinueModule::ResumeInUpdatedFunction(
SIZE_T newILOffset,
CONTEXT *pOrigContext)
{
#if defined(TARGET_ARM64) || defined(TARGET_ARM)
return E_NOTIMPL;
#else
LOG((LF_ENC, LL_INFO100, "EnCModule::ResumeInUpdatedFunction for %s at IL offset 0x%x, ",
pMD->m_pszDebugMethodName, newILOffset));

Expand Down Expand Up @@ -694,6 +697,7 @@ HRESULT EditAndContinueModule::ResumeInUpdatedFunction(
// Win32 handlers on the stack so cannot ever return from this function.
EEPOLICY_HANDLE_FATAL_ERROR(CORDBG_E_ENC_INTERNAL_ERROR);
return hr;
#endif // #if define(TARGET_ARM64) || defined(TARGET_ARM)
}

//---------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,9 @@ public static void ApplyUpdateInvalidParameters()
Assert.Throws<ArgumentException>(() =>
AssemblyExtensions.ApplyUpdate(new NonRuntimeAssembly(), new ReadOnlySpan<byte>(metadataDelta), new ReadOnlySpan<byte>(ilDelta), ReadOnlySpan<byte>.Empty));

if (PlatformDetection.IsNotMonoRuntime && PlatformDetection.IsArmOrArm64Process)
{
// Not implemented on .NET Core arm and arm64
Assert.Throws<NotImplementedException>(() =>
AssemblyExtensions.ApplyUpdate(typeof(AssemblyExtensions).Assembly, new ReadOnlySpan<byte>(metadataDelta), new ReadOnlySpan<byte>(ilDelta), ReadOnlySpan<byte>.Empty));
}
else
{
// Tests that this assembly isn't not editable
Assert.Throws<InvalidOperationException>(() =>
AssemblyExtensions.ApplyUpdate(typeof(AssemblyExtensions).Assembly, new ReadOnlySpan<byte>(metadataDelta), new ReadOnlySpan<byte>(ilDelta), ReadOnlySpan<byte>.Empty));
}
// Tests that this assembly isn't not editable
Assert.Throws<InvalidOperationException>(() =>
AssemblyExtensions.ApplyUpdate(typeof(AssemblyExtensions).Assembly, new ReadOnlySpan<byte>(metadataDelta), new ReadOnlySpan<byte>(ilDelta), ReadOnlySpan<byte>.Empty));
}
}
}

0 comments on commit 9f55689

Please sign in to comment.