Skip to content

Commit

Permalink
[marshal] Cleanup dead ifdefs (#78435)
Browse files Browse the repository at this point in the history
1. The `DISABLE_NONBLITTABLE` define was a previous attempt at partitioning the marshaling into a simple version that just supports blittable types and the full legacy marshaller.  It was never used in production.

2. The `ENABLE_ILGEN` was used previously in configurations where runtime codegen was not available to save some space by excluding support for emitting IL at runtime (needed for marshaling, fast managed allocators in sgen, etc).  It also used to emit the ilgen support code into a separate static library that could optionallly be linked into the runtime, and enabled with an appropriate API call (`mono_marshal_ilgen_init`).  This define is now on by default and the API function is a no-op.

3. Mark a collection of `mono_win32_compat_` functions with `MONO_RT_EXTERNAL_ONLY` and move them to `external-only.c` (these were used in mono/mono dllmap support to provide some common kernel32 functions on non-Windows)

4. Remove `MonoMarshalILgenCallbacks` in `marshal-ilgen.c` - just do direct calls to the `_ilgen` helper functions

Fixes #78422
  • Loading branch information
lambdageek authored Nov 16, 2022
1 parent acba587 commit bc75946
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 842 deletions.
3 changes: 0 additions & 3 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ set(CMAKE_CXX_FLAGS_CHECKED "")
set(CMAKE_EXE_LINKER_FLAGS_CHECKED "")
set(CMAKE_SHARED_LINKER_FLAGS_CHECKED "")

# This is always enabled now, and we should go through the code to remove the case here it is not defined
set(ENABLE_ILGEN 1)

if(NOT MONO_LIB_NAME)
set(MONO_LIB_NAME "monosgen-2.0")
endif()
Expand Down
3 changes: 0 additions & 3 deletions src/mono/cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,6 @@
/* Disable the interpreter. */
#cmakedefine DISABLE_INTERPRETER 1

/* Some VES is available at runtime */
#cmakedefine ENABLE_ILGEN 1

/* Disable non-blittable marshalling */
#cmakedefine DISABLE_NONBLITTABLE

Expand Down
2 changes: 0 additions & 2 deletions src/mono/mono/component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ list(APPEND components_for_aot
set(${MONO_MARSHAL_ILGEN_COMPONENT_NAME}-sources
${MONO_COMPONENT_PATH}/marshal-ilgen.c
${MONO_COMPONENT_PATH}/marshal-ilgen.h
${MONO_COMPONENT_PATH}/marshal-ilgen-noilgen.c
${MONO_COMPONENT_PATH}/marshal-ilgen-noilgen.h
)

# For every component not build into the AOT compiler, build the stub instead
Expand Down
5 changes: 1 addition & 4 deletions src/mono/mono/component/marshal-ilgen-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@

#include "mono/component/marshal-ilgen.h"

void
mono_install_marshal_callbacks_ilgen (MonoMarshalILgenCallbacks *cb);

#endif // __MARSHAL_ILGEN_INTERNALS_H__
#endif // __MARSHAL_ILGEN_INTERNALS_H__
187 changes: 0 additions & 187 deletions src/mono/mono/component/marshal-ilgen-noilgen.c

This file was deleted.

11 changes: 0 additions & 11 deletions src/mono/mono/component/marshal-ilgen-noilgen.h

This file was deleted.

Loading

0 comments on commit bc75946

Please sign in to comment.