diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt
index 5eaaaa91b6504e..038be0cbcf7ccf 100644
--- a/src/mono/CMakeLists.txt
+++ b/src/mono/CMakeLists.txt
@@ -109,10 +109,6 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR(CMAKE_CXX_COMPILER_ID STREQUAL "Cla
set(GCC 1)
endif()
-if(DISABLE_INTERPRETER)
- unset(ENABLE_METADATA_UPDATE)
-endif()
-
add_definitions(-DHAVE_CONFIG_H)
if(GCC)
diff --git a/src/mono/Directory.Build.props b/src/mono/Directory.Build.props
index 1a1198c77bd0cb..a457800199a3a0 100644
--- a/src/mono/Directory.Build.props
+++ b/src/mono/Directory.Build.props
@@ -77,11 +77,4 @@
$([MSBuild]::NormalizeDirectory('$(RepoTasksDir)', 'AotCompilerTask'))
-
-
-
- true
- true
- false
-
diff --git a/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj
index 34dcb45c40f995..61ad598697e045 100644
--- a/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj
+++ b/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj
@@ -125,11 +125,6 @@
$(DefineConstants);FEATURE_OBJCMARSHAL
-
-
- $(DefineConstants);FEATURE_METADATA_UPDATE
-
-
true
diff --git a/src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs
index 9a69b2bb7349d4..c211c5d68f5d64 100644
--- a/src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs
+++ b/src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs
@@ -37,9 +37,6 @@ public static void ApplyUpdate(Assembly assembly, ReadOnlySpan metadataDel
if (runtimeAssembly == typeof(AssemblyExtensions).Assembly)
throw new InvalidOperationException (SR.InvalidOperation_AssemblyNotEditable);
-#if !FEATURE_METADATA_UPDATE
- throw new NotSupportedException (SR.NotSupported_MethodBodyReplacement);
-#else
unsafe
{
IntPtr monoAssembly = runtimeAssembly.GetUnderlyingNativeHandle ();
@@ -48,7 +45,6 @@ public static void ApplyUpdate(Assembly assembly, ReadOnlySpan metadataDel
ApplyUpdate_internal(monoAssembly, metadataDeltaPtr, metadataDelta.Length, ilDeltaPtr, ilDelta.Length, pdbDeltaPtr, pdbDelta.Length);
}
}
-#endif
}
private static Lazy s_ApplyUpdateCapabilities = new Lazy(() => InitializeApplyUpdateCapabilities());
@@ -57,21 +53,14 @@ public static void ApplyUpdate(Assembly assembly, ReadOnlySpan metadataDel
private static string InitializeApplyUpdateCapabilities()
{
-#if !FEATURE_METADATA_UPDATE
- return string.Empty;
-#else
return ApplyUpdateEnabled() != 0 ? "Baseline" : string.Empty ;
-#endif
}
-#if FEATURE_METADATA_UPDATE
[MethodImpl (MethodImplOptions.InternalCall)]
private static extern int ApplyUpdateEnabled ();
[MethodImpl (MethodImplOptions.InternalCall)]
private static unsafe extern void ApplyUpdate_internal (IntPtr base_assm, byte* dmeta_bytes, int dmeta_length, byte *dil_bytes, int dil_length, byte *dpdb_bytes, int dpdb_length);
-#endif
-
}
}
diff --git a/src/mono/cmake/config.h.in b/src/mono/cmake/config.h.in
index d49cbd3b9a9d53..4a76a42e1461dd 100644
--- a/src/mono/cmake/config.h.in
+++ b/src/mono/cmake/config.h.in
@@ -1070,9 +1070,6 @@
/* Enable runtime checks of mempool references between metadata images (must set env var MONO_CHECK_MODE=metadata) */
#cmakedefine ENABLE_CHECKED_BUILD_METADATA 1
-/* Enable runtime support for metadata updates */
-#cmakedefine ENABLE_METADATA_UPDATE 1
-
/* Enable static linking of mono runtime components */
#cmakedefine STATIC_COMPONENTS
diff --git a/src/mono/cmake/options.cmake b/src/mono/cmake/options.cmake
index cc0078b2385d25..fa5a2fee8797f1 100644
--- a/src/mono/cmake/options.cmake
+++ b/src/mono/cmake/options.cmake
@@ -53,7 +53,6 @@ option (ENABLE_CHECKED_BUILD_PRIVATE_TYPES "Enable compile time checking that ge
option (ENABLE_CHECKED_BUILD_GC "Enable runtime GC Safe / Unsafe mode assertion checks (must set env var MONO_CHECK_MODE=gc)")
option (ENABLE_CHECKED_BUILD_THREAD "Enable runtime history of per-thread coop state transitions (must set env var MONO_CHECK_MODE=thread)")
option (ENABLE_CHECKED_BUILD_METADATA "Enable runtime checks of mempool references between metadata images (must set env var MONO_CHECK_MODE=metadata)")
-option (ENABLE_METADATA_UPDATE "Enable runtime support for metadata updates")
option (ENABLE_MSCORDBI "Generate mscordbi to support icordbg interface")
option (STATIC_COMPONENTS "Compile mono runtime components as static (not dynamic) libraries")
@@ -63,4 +62,3 @@ set (ENABLE_MINIMAL "" CACHE STRING "Set many DISABLE_ options at once. Comma-se
set (AOT_TARGET_TRIPLE "" CACHE STRING "Target triple for AOT cross compiler")
set (AOT_OFFSETS_FILE "" CACHE STRING "Offsets file for AOT cross compiler")
set (LLVM_PREFIX "" CACHE STRING "Enable LLVM support with LLVM installed at .")
-
diff --git a/src/mono/mono.proj b/src/mono/mono.proj
index 8b17aeb85c8dcf..f0dd14c1844b17 100644
--- a/src/mono/mono.proj
+++ b/src/mono/mono.proj
@@ -8,7 +8,6 @@
- MonoAOTEnableLLVM - enable LLVM for an AOT-only Mono
- MonoAOTLLVMDir - [optional] the directory where LLVM is located, for an AOT-only Mono
- MonoVerboseBuild - enable verbose build
- - MonoMetadataUpdate - enable experimental method body replacement code (in Directory.Build.props)
- MonoThreadSuspend - coop,hybrid,preemptive - default thread suspend mode
-->
@@ -412,10 +411,6 @@
-
- <_MonoCMakeArgs Include="-DENABLE_METADATA_UPDATE=1" />
-
-
<_MonoCMakeArgs Include="-DENABLE_MSCORDBI=1" />
@@ -655,9 +650,6 @@
-
-
-
diff --git a/src/mono/mono/metadata/domain.c b/src/mono/mono/metadata/domain.c
index 3bc0e98ae62380..4a8e06d28ae2cf 100644
--- a/src/mono/mono/metadata/domain.c
+++ b/src/mono/mono/metadata/domain.c
@@ -485,10 +485,8 @@ void
mono_close_exe_image (void)
{
gboolean do_close = exe_image != NULL;
-#ifdef ENABLE_METADATA_UPDATE
/* FIXME: shutdown hack. We mess something up and try to double-close/free it. */
do_close = do_close && !exe_image->has_updates;
-#endif
if (do_close)
mono_image_close (exe_image);
}
diff --git a/src/mono/mono/metadata/icall-decl.h b/src/mono/mono/metadata/icall-decl.h
index 8131a0981a1248..b78d7c6a06d248 100644
--- a/src/mono/mono/metadata/icall-decl.h
+++ b/src/mono/mono/metadata/icall-decl.h
@@ -242,9 +242,7 @@ ICALL_EXPORT void ves_icall_System_Threading_LowLevelLifoSemaphore_ReleaseIn
ICALL_EXPORT void ves_icall_System_Runtime_Intrinsics_X86_X86Base___cpuidex (int abcd[4], int function_id, int subfunction_id);
#endif
-#ifdef ENABLE_METADATA_UPDATE
ICALL_EXPORT void ves_icall_AssemblyExtensions_ApplyUpdate (MonoAssembly *assm, gconstpointer dmeta_bytes, int32_t dmeta_len, gconstpointer dil_bytes, int32_t dil_len, gconstpointer dpdb_bytes, int32_t dpdb_len);
ICALL_EXPORT gint32 ves_icall_AssemblyExtensions_ApplyUpdateEnabled (void);
-#endif
#endif // __MONO_METADATA_ICALL_DECL_H__
diff --git a/src/mono/mono/metadata/icall-def-netcore.h b/src/mono/mono/metadata/icall-def-netcore.h
index 71e5db228d075a..6fb0ddd4712f1b 100644
--- a/src/mono/mono/metadata/icall-def-netcore.h
+++ b/src/mono/mono/metadata/icall-def-netcore.h
@@ -245,11 +245,9 @@ ICALL_TYPE(FIELDI, "System.Reflection.FieldInfo", FILEDI_1)
HANDLES(FILEDI_1, "get_marshal_info", ves_icall_System_Reflection_FieldInfo_get_marshal_info, MonoReflectionMarshalAsAttribute, 1, (MonoReflectionField))
HANDLES(FILEDI_2, "internal_from_handle_type", ves_icall_System_Reflection_FieldInfo_internal_from_handle_type, MonoReflectionField, 2, (MonoClassField_ref, MonoType_ref))
-#ifdef ENABLE_METADATA_UPDATE
ICALL_TYPE(ASSMEXT, "System.Reflection.Metadata.AssemblyExtensions", ASSMEXT_2)
NOHANDLES(ICALL(ASSMEXT_2, "ApplyUpdateEnabled", ves_icall_AssemblyExtensions_ApplyUpdateEnabled))
NOHANDLES(ICALL(ASSMEXT_1, "ApplyUpdate_internal", ves_icall_AssemblyExtensions_ApplyUpdate))
-#endif
ICALL_TYPE(MBASE, "System.Reflection.MethodBase", MBASE_1)
HANDLES(MBASE_1, "GetCurrentMethod", ves_icall_GetCurrentMethod, MonoReflectionMethod, 0, ())
diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c
index 57cfb4930aa55b..f9dacf654ddc20 100644
--- a/src/mono/mono/metadata/icall.c
+++ b/src/mono/mono/metadata/icall.c
@@ -5737,7 +5737,6 @@ ves_icall_Mono_Runtime_DumpStateTotal (guint64 *portable_hash, guint64 *unportab
return result;
}
-#ifdef ENABLE_METADATA_UPDATE
void
ves_icall_AssemblyExtensions_ApplyUpdate (MonoAssembly *assm,
gconstpointer dmeta_bytes, int32_t dmeta_len,
@@ -5759,7 +5758,6 @@ gint32 ves_icall_AssemblyExtensions_ApplyUpdateEnabled (void)
{
return mono_metadata_update_available ();
}
-#endif
MonoBoolean
ves_icall_System_Reflection_AssemblyName_ParseAssemblyName (const char *name, MonoAssemblyName *aname, MonoBoolean *is_version_defined_arg, MonoBoolean *is_token_defined_arg)
diff --git a/src/mono/mono/metadata/image.c b/src/mono/mono/metadata/image.c
index ba1d58b7bad6ed..68b7b377266ce4 100644
--- a/src/mono/mono/metadata/image.c
+++ b/src/mono/mono/metadata/image.c
@@ -599,14 +599,12 @@ load_tables (MonoImage *image)
image->idx_guid_wide = ((heap_sizes & 0x02) == 2);
image->idx_blob_wide = ((heap_sizes & 0x04) == 4);
-#ifdef ENABLE_METADATA_UPDATE
if (G_UNLIKELY (image->minimal_delta)) {
/* sanity check */
g_assert (image->idx_string_wide);
g_assert (image->idx_guid_wide);
g_assert (image->idx_blob_wide);
}
-#endif
valid_mask = read64 (heap_tables + 8);
rows = (const guint32 *) (heap_tables + 24);
@@ -1174,7 +1172,6 @@ hash_guid (const char *str)
return h;
}
-#ifdef ENABLE_METADATA_UPDATE
static void
dump_encmap (MonoImage *image)
{
@@ -1192,7 +1189,6 @@ dump_encmap (MonoImage *image)
}
}
}
-#endif
static MonoImage *
do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status,
@@ -1238,9 +1234,7 @@ do_mono_image_load (MonoImage *image, MonoImageOpenStatus *status,
if (!mono_image_load_cli_data (image))
goto invalid_image;
-#ifdef ENABLE_METADATA_UPDATE
dump_encmap (image);
-#endif
mono_image_load_names (image);
@@ -2151,9 +2145,7 @@ mono_image_close_except_pools (MonoImage *image)
mono_image_invoke_unload_hook (image);
-#ifdef ENABLE_METADATA_UPDATE
mono_metadata_update_cleanup_on_close (image);
-#endif
/*
* The caches inside a MonoImage might refer to metadata which is stored in referenced
@@ -2273,10 +2265,8 @@ mono_image_close_except_pools (MonoImage *image)
mono_image_close_except_pools_all (image->modules, image->module_count);
g_free (image->modules_loaded);
-#ifdef ENABLE_METADATA_UPDATE
if (image->has_updates)
mono_metadata_update_image_close_except_pools_all (image);
-#endif
mono_os_mutex_destroy (&image->szarray_cache_lock);
mono_os_mutex_destroy (&image->lock);
@@ -2322,9 +2312,7 @@ mono_image_close_finish (MonoImage *image)
mono_image_close_all (image->files, image->file_count);
mono_image_close_all (image->modules, image->module_count);
-#ifdef ENABLE_METADATA_UPDATE
mono_metadata_update_image_close_all (image);
-#endif
#ifndef DISABLE_PERFCOUNTERS
/* FIXME: use an explicit subtraction method as soon as it's available */
diff --git a/src/mono/mono/metadata/loader.c b/src/mono/mono/metadata/loader.c
index 3405ac05418c5d..f16c8c36f81471 100644
--- a/src/mono/mono/metadata/loader.c
+++ b/src/mono/mono/metadata/loader.c
@@ -2035,10 +2035,8 @@ mono_method_get_header_internal (MonoMethod *method, MonoError *error)
g_assert (mono_metadata_token_table (method->token) == MONO_TABLE_METHOD);
idx = mono_metadata_token_index (method->token);
-#ifdef ENABLE_METADATA_UPDATE
if (G_UNLIKELY (img->has_updates))
loc = mono_metadata_update_get_updated_method_rva (img, idx);
-#endif
if (!loc) {
rva = mono_metadata_decode_row_col (&img->tables [MONO_TABLE_METHOD], idx - 1, MONO_METHOD_RVA);
diff --git a/src/mono/mono/metadata/metadata-internals.h b/src/mono/mono/metadata/metadata-internals.h
index 30d0a5fd4c6a08..a3f56cf1f84b1c 100644
--- a/src/mono/mono/metadata/metadata-internals.h
+++ b/src/mono/mono/metadata/metadata-internals.h
@@ -793,19 +793,6 @@ struct _MonoMetadataUpdateData {
int has_updates;
};
-#ifndef ENABLE_METADATA_UPDATE
-static inline gboolean
-mono_metadata_has_updates (void)
-{
- return FALSE;
-}
-
-static inline void
-mono_image_effective_table (const MonoTableInfo **t, int *idx)
-{
-}
-#else /* ENABLE_METADATA_UPDATE */
-
extern MonoMetadataUpdateData mono_metadata_update_data_private;
/* returns TRUE if there's at least one update */
@@ -833,7 +820,6 @@ mono_image_relative_delta_index (MonoImage *image_dmeta, int token);
void
mono_image_load_enc_delta (MonoImage *base_image, gconstpointer dmeta, uint32_t dmeta_len, gconstpointer dil, uint32_t dil_len, MonoError *error);
-#endif /* ENABLE_METADATA_UPDATE */
gboolean
mono_image_load_cli_header (MonoImage *image, MonoCLIImageInfo *iinfo);
@@ -863,14 +849,6 @@ mono_metadata_get_shared_type (MonoType *type);
void
mono_metadata_clean_generic_classes_for_image (MonoImage *image);
-#ifndef ENABLE_METADATA_UPDATE
-static inline gboolean
-mono_metadata_table_bounds_check (MonoImage *image, int table_index, int token_index)
-{
- /* token_index is 1-based. TRUE means the token is out of bounds */
- return token_index > image->tables [table_index].rows_;
-}
-#else
gboolean
mono_metadata_table_bounds_check_slow (MonoImage *image, int table_index, int token_index);
@@ -885,7 +863,6 @@ mono_metadata_table_bounds_check (MonoImage *image, int table_index, int token_i
return TRUE;
return mono_metadata_table_bounds_check_slow (image, table_index, token_index);
}
-#endif
MONO_COMPONENT_API
const char * mono_meta_table_name (int table);
diff --git a/src/mono/mono/metadata/metadata-update.c b/src/mono/mono/metadata/metadata-update.c
index a5013a03ca465c..d1d646c49ba25b 100644
--- a/src/mono/mono/metadata/metadata-update.c
+++ b/src/mono/mono/metadata/metadata-update.c
@@ -20,8 +20,6 @@ mono_metadata_update_available (void)
return mono_component_hot_reload ()->component.available ();
}
-#ifdef ENABLE_METADATA_UPDATE
-
MonoMetadataUpdateData mono_metadata_update_data_private;
void
@@ -122,14 +120,4 @@ mono_metadata_update_delta_heap_lookup (MonoImage *base_image, MetadataHeapGette
return mono_component_hot_reload ()->delta_heap_lookup (base_image, get_heap, orig_index, image_out, index_out);
}
-#else /* ENABLE_METADATA_UPDATE */
-
-void
-mono_metadata_update_init (void)
-{
- MonoComponentHotReload *comp = mono_component_hot_reload ();
- comp->set_fastpath_data (NULL);
-}
-
-#endif /* ENABLE_METADATA_UPDATE */
diff --git a/src/mono/mono/metadata/metadata-update.h b/src/mono/mono/metadata/metadata-update.h
index 6ba03ac3de9b51..52bfa701e57f82 100644
--- a/src/mono/mono/metadata/metadata-update.h
+++ b/src/mono/mono/metadata/metadata-update.h
@@ -24,8 +24,6 @@ typedef MonoStreamHeader* (*MetadataHeapGetterFunc) (MonoImage*);
gboolean
mono_metadata_update_available (void);
-#ifdef ENABLE_METADATA_UPDATE
-
gboolean
mono_metadata_update_enabled (int *modifiable_assemblies_out);
@@ -56,22 +54,4 @@ mono_metadata_update_table_bounds_check (MonoImage *base_image, int table_index,
gboolean
mono_metadata_update_delta_heap_lookup (MonoImage *base_image, MetadataHeapGetterFunc get_heap, uint32_t orig_index, MonoImage **image_out, uint32_t *index_out);
-#else /* ENABLE_METADATA_UPDATE */
-
-static inline gboolean
-mono_metadata_update_enabled (int *modifiable_assemblies_out)
-{
- if (modifiable_assemblies_out)
- *modifiable_assemblies_out = 0;
- return FALSE;
-}
-
-static inline gboolean
-mono_metadata_update_no_inline (MonoMethod *caller, MonoMethod *callee)
-{
- return FALSE;
-}
-
-#endif /* ENABLE_METADATA_UPDATE */
-
#endif /*__MONO_METADATA_UPDATE_H__*/
diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c
index 480c96a5702f4c..ca8cced208a76b 100644
--- a/src/mono/mono/metadata/metadata.c
+++ b/src/mono/mono/metadata/metadata.c
@@ -986,7 +986,6 @@ mono_metadata_compute_size (MonoImage *meta, int tableindex, guint32 *result_bit
return size;
}
-#ifdef ENABLE_METADATA_UPDATE
/* returns true if given index is not in bounds with provided table/index pair */
gboolean
mono_metadata_table_bounds_check_slow (MonoImage *image, int table_index, int token_index)
@@ -999,7 +998,6 @@ mono_metadata_table_bounds_check_slow (MonoImage *image, int table_index, int to
return mono_metadata_update_table_bounds_check (image, table_index, token_index);
}
-#endif
/**
* mono_metadata_compute_table_bases:
@@ -1058,9 +1056,6 @@ mono_metadata_locate_token (MonoImage *meta, guint32 token)
return mono_metadata_locate (meta, token >> 24, token & 0xffffff);
}
-
-
-#ifdef ENABLE_METADATA_UPDATE
static MonoStreamHeader *
get_string_heap (MonoImage *image)
{
@@ -1085,8 +1080,6 @@ mono_delta_heap_lookup (MonoImage *base_image, MetadataHeapGetterFunc get_heap,
return mono_metadata_update_delta_heap_lookup (base_image, get_heap, orig_index, image_out, index_out);
}
-#endif
-
/**
* mono_metadata_string_heap:
* \param meta metadata context
@@ -1096,7 +1089,6 @@ mono_delta_heap_lookup (MonoImage *base_image, MetadataHeapGetterFunc get_heap,
const char *
mono_metadata_string_heap (MonoImage *meta, guint32 index)
{
-#ifdef ENABLE_METADATA_UPDATE
if (G_UNLIKELY (index >= meta->heap_strings.size && meta->has_updates)) {
MonoImage *dmeta;
guint32 dindex;
@@ -1105,7 +1097,6 @@ mono_metadata_string_heap (MonoImage *meta, guint32 index)
meta = dmeta;
index = dindex;
}
-#endif
g_assertf (index < meta->heap_strings.size, " index = 0x%08x size = 0x%08x meta=%s ", index, meta->heap_strings.size, meta && meta->name ? meta->name : "unknown image" );
g_return_val_if_fail (index < meta->heap_strings.size, "");
@@ -1134,7 +1125,6 @@ mono_metadata_string_heap_checked (MonoImage *meta, guint32 index, MonoError *er
return img->sheap.data + index;
}
-#ifdef ENABLE_METADATA_UPDATE
if (G_UNLIKELY (index >= meta->heap_strings.size && meta->has_updates)) {
MonoImage *dmeta;
guint32 dindex;
@@ -1148,7 +1138,6 @@ mono_metadata_string_heap_checked (MonoImage *meta, guint32 index, MonoError *er
meta = dmeta;
index = dindex;
}
-#endif
if (G_UNLIKELY (!(index < meta->heap_strings.size))) {
const char *image_name = meta && meta->name ? meta->name : "unknown image";
@@ -1167,7 +1156,6 @@ mono_metadata_string_heap_checked (MonoImage *meta, guint32 index, MonoError *er
const char *
mono_metadata_user_string (MonoImage *meta, guint32 index)
{
-#ifdef ENABLE_METADATA_UPDATE
if (G_UNLIKELY (index >= meta->heap_us.size && meta->has_updates)) {
MonoImage *dmeta;
guint32 dindex;
@@ -1176,7 +1164,6 @@ mono_metadata_user_string (MonoImage *meta, guint32 index)
meta = dmeta;
index = dindex;
}
-#endif
g_assert (index < meta->heap_us.size);
g_return_val_if_fail (index < meta->heap_us.size, "");
return meta->heap_us.data + index;
@@ -1196,7 +1183,6 @@ mono_metadata_blob_heap (MonoImage *meta, guint32 index)
* assertion is hit, consider updating caller to use
* mono_metadata_blob_heap_null_ok and handling a null return value. */
g_assert (!(index == 0 && meta->heap_blob.size == 0));
-#ifdef ENABLE_METADATA_UPDATE
if (G_UNLIKELY (index >= meta->heap_blob.size && meta->has_updates)) {
MonoImage *dmeta;
guint32 dindex;
@@ -1205,7 +1191,6 @@ mono_metadata_blob_heap (MonoImage *meta, guint32 index)
meta = dmeta;
index = dindex;
}
-#endif
g_assert (index < meta->heap_blob.size);
return meta->heap_blob.data + index;
}
@@ -1251,7 +1236,6 @@ mono_metadata_blob_heap_checked (MonoImage *meta, guint32 index, MonoError *erro
}
if (G_UNLIKELY (index == 0 && meta->heap_blob.size == 0))
return NULL;
-#ifdef ENABLE_METADATA_UPDATE
if (G_UNLIKELY (index >= meta->heap_blob.size && meta->has_updates)) {
MonoImage *dmeta;
guint32 dindex;
@@ -1264,7 +1248,6 @@ mono_metadata_blob_heap_checked (MonoImage *meta, guint32 index, MonoError *erro
meta = dmeta;
index = dindex;
}
-#endif
if (G_UNLIKELY (!(index < meta->heap_blob.size))) {
const char *image_name = meta && meta->name ? meta->name : "unknown image";
mono_error_set_bad_image_by_name (error, image_name, "blob heap index %u out of bounds %u: %s", index, meta->heap_blob.size, image_name);
diff --git a/src/mono/mono/metadata/threads.c b/src/mono/mono/metadata/threads.c
index 016f8e74b4df5c..fb43d7fab58689 100644
--- a/src/mono/mono/metadata/threads.c
+++ b/src/mono/mono/metadata/threads.c
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -839,10 +840,8 @@ mono_thread_attach_internal (MonoThread *thread, gboolean force_attach)
mono_threads_unlock ();
-#ifdef MONO_METADATA_UPDATE
/* Roll up to the latest published metadata generation */
mono_metadata_update_thread_expose_published ();
-#endif
THREAD_DEBUG (g_message ("%s: Attached thread ID %" G_GSIZE_FORMAT " (handle %p)", __func__, internal->tid, internal->handle));
diff --git a/src/mono/mono/mini/debugger-agent.c b/src/mono/mono/mini/debugger-agent.c
index 593cdff22298d1..eb0e2a248dc33c 100644
--- a/src/mono/mono/mini/debugger-agent.c
+++ b/src/mono/mono/mini/debugger-agent.c
@@ -6455,7 +6455,6 @@ get_types_for_source_file (gpointer key, gpointer value, gpointer user_data)
static gboolean
module_apply_changes (MonoImage *image, MonoArray *dmeta, MonoArray *dil, MonoArray *dpdb, MonoError *error)
{
-#ifdef ENABLE_METADATA_UPDATE
/* TODO: use dpdb */
gpointer dmeta_bytes = (gpointer)mono_array_addr_internal (dmeta, char, 0);
int32_t dmeta_len = mono_array_length_internal (dmeta);
@@ -6465,10 +6464,6 @@ module_apply_changes (MonoImage *image, MonoArray *dmeta, MonoArray *dil, MonoAr
int32_t dpdb_len G_GNUC_UNUSED = !dpdb ? 0 : mono_array_length_internal (dpdb);
mono_image_load_enc_delta (image, dmeta_bytes, dmeta_len, dil_bytes, dil_len, error);
return is_ok (error);
-#else
- mono_error_set_not_supported (error, "");
- return FALSE;
-#endif
}
diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c
index 61c5756c603853..da9bed4af1c5ec 100644
--- a/src/mono/mono/mini/interp/interp.c
+++ b/src/mono/mono/mini/interp/interp.c
@@ -7330,7 +7330,6 @@ copy_imethod_for_frame (InterpFrame *frame)
*/
}
-#ifdef ENABLE_METADATA_UPDATE
static void
metadata_update_backup_frames (MonoThreadInfo *info, InterpFrame *frame)
{
@@ -7376,12 +7375,6 @@ metadata_update_prepare_to_invalidate (void)
/* (2) invalidate all the registered imethods */
}
-#else
-static void
-metadata_update_prepare_to_invalidate (void)
-{
-}
-#endif
static void
diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c
index 3fd15c5f9ddb40..2736b645795fec 100644
--- a/src/mono/mono/mini/interp/transform.c
+++ b/src/mono/mono/mini/interp/transform.c
@@ -9603,9 +9603,7 @@ mono_interp_transform_method (InterpMethod *imethod, ThreadContext *context, Mon
error_init (error);
-#ifdef ENABLE_METADATA_UPDATE
mono_metadata_update_thread_expose_published ();
-#endif
if (mono_class_is_open_constructed_type (m_class_get_byval_arg (method->klass))) {
mono_error_set_invalid_operation (error, "%s", "Could not execute the method because the containing type is not fully instantiated.");
diff --git a/src/mono/sample/mbr/README.md b/src/mono/sample/mbr/README.md
index 6e78382e103874..f95030266bb6e9 100644
--- a/src/mono/sample/mbr/README.md
+++ b/src/mono/sample/mbr/README.md
@@ -3,26 +3,16 @@
## Prerequisites
-To run the tests you will need to:
-
-1. Build a runtime with the `MonoMetadataUpdate` property set to true: `/p:MonoMetadataUpdate=true`.
-2. Put the [hotreload-delta-gen](https://github.com/dotnet/hotreload-utils/tree/main/src/hotreload-delta-gen) command line tool somewhere on your `PATH`.
-
- Build the tool with `dotnet publish --self-contained -r ` and then add the `publish/hotreload-delta-gen` directory to your `PATH`.
- If you don't want to add it to your `PATH`, you can set the `HotReloadDeltaGenFullPath` msbuild property in `DeltaHelper.targets` to the full path name of the published executable.
-
-The tool, runtime changes and samples should work on Mac and Linux. Windows might work, but it hasn't been tested.
+To run the tests you will need to build a Mono runtime with the `hot_reload` component.
## Building
-Build the runtime with the `/p:MonoMetadataUpdate=true` option.
-
Both Debug and Release configurations should work.
For desktop:
```console
-build.sh -s Mono+Libs /p:MonoMetadataUpdate=true
+build.sh -s Mono+Libs
```
diff --git a/src/mono/wasm/wasm.proj b/src/mono/wasm/wasm.proj
index bcdf4eae40a7ae..81ce7272efebcc 100644
--- a/src/mono/wasm/wasm.proj
+++ b/src/mono/wasm/wasm.proj
@@ -12,17 +12,11 @@
$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'native'))
false
false
- true
emcc
$(ArtifactsObjDir)wasm
<_EmccDefaultsRspPath>$(NativeBinDir)src\emcc-default.rsp
-
-
- true
-
-
@@ -87,8 +81,6 @@
<_EmccFlags Include="--profiling-funcs" />
<_EmccFlags Include="@(_EmccCommonFlags)" />
-
- <_EmccFlags Include="-DENABLE_METADATA_UPDATE=1" Condition="'$(WasmEnableMetadataUpdate)' == 'true'" />
@@ -245,7 +237,7 @@