Skip to content

Commit

Permalink
[wasm] Skeleton for wasm specific implementations of a bunch of OS st…
Browse files Browse the repository at this point in the history
…uff.

This commit is incomplete because we need to implement / investigate all missing functions that I added as comments in w32process-wasm.c.
Savings for a release build are of the order of 100kb for interp-release.

The icalls should be all implemented as throwing PSNE.

The non-icall functions require some investigation.
  • Loading branch information
kumpera committed Oct 19, 2018
1 parent 2c1e529 commit 5a4fcf5
Show file tree
Hide file tree
Showing 12 changed files with 136 additions and 0 deletions.
21 changes: 21 additions & 0 deletions mono/metadata/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,26 @@ export HOST_CC
AM_CFLAGS = -O
else

if HOST_WASM
assembliesdir = $(exec_prefix)/lib
confdir = $(sysconfdir)
wasm_sources = \
console-wasm.c \
w32mutex-wasm.c \
w32semaphore-wasm.c \
w32event-wasm.c \
w32process-wasm.c \
w32process-wasm-internals.h \
w32socket-wasm.c \
w32file-wasm.c \
w32file-wasm-glob.c \
w32file-wasm-glob.h \
w32error-wasm.c

platform_sources = $(wasm_sources)

else

assembliesdir = $(exec_prefix)/lib
confdir = $(sysconfdir)
unix_sources = \
Expand All @@ -61,6 +81,7 @@ unix_sources = \

platform_sources = $(unix_sources)
endif
endif

glib_libs = $(top_builddir)/mono/eglib/libeglib.la

Expand Down
Empty file added mono/metadata/console-wasm.c
Empty file.
Empty file added mono/metadata/w32error-wasm.c
Empty file.
Empty file added mono/metadata/w32event-wasm.c
Empty file.
Empty file.
Empty file.
Empty file added mono/metadata/w32file-wasm.c
Empty file.
Empty file added mono/metadata/w32mutex-wasm.c
Empty file.
Empty file.
115 changes: 115 additions & 0 deletions mono/metadata/w32process-wasm.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*warning: unresolved symbol: mono_console_handle_async_ops
warning: unresolved symbol: mono_console_init
warning: unresolved symbol: mono_w32error_get_last
warning: unresolved symbol: mono_w32event_close
warning: unresolved symbol: mono_w32event_create
warning: unresolved symbol: mono_w32event_init
warning: unresolved symbol: mono_w32event_set
warning: unresolved symbol: mono_w32file_cleanup
warning: unresolved symbol: mono_w32file_close
warning: unresolved symbol: mono_w32file_copy
warning: unresolved symbol: mono_w32file_create
warning: unresolved symbol: mono_w32file_create_directory
warning: unresolved symbol: mono_w32file_create_pipe
warning: unresolved symbol: mono_w32file_delete
warning: unresolved symbol: mono_w32file_find_close
warning: unresolved symbol: mono_w32file_find_first
warning: unresolved symbol: mono_w32file_find_next
warning: unresolved symbol: mono_w32file_flush
warning: unresolved symbol: mono_w32file_get_attributes
warning: unresolved symbol: mono_w32file_get_attributes_ex
warning: unresolved symbol: mono_w32file_get_console_error
warning: unresolved symbol: mono_w32file_get_console_input
warning: unresolved symbol: mono_w32file_get_console_output
warning: unresolved symbol: mono_w32file_get_cwd
warning: unresolved symbol: mono_w32file_get_disk_free_space
warning: unresolved symbol: mono_w32file_get_drive_type
warning: unresolved symbol: mono_w32file_get_file_size
warning: unresolved symbol: mono_w32file_get_logical_drive
warning: unresolved symbol: mono_w32file_get_type
warning: unresolved symbol: mono_w32file_init
warning: unresolved symbol: mono_w32file_lock
warning: unresolved symbol: mono_w32file_move
warning: unresolved symbol: mono_w32file_read
warning: unresolved symbol: mono_w32file_remove_directory
warning: unresolved symbol: mono_w32file_replace
warning: unresolved symbol: mono_w32file_seek
warning: unresolved symbol: mono_w32file_set_attributes
warning: unresolved symbol: mono_w32file_set_cwd
warning: unresolved symbol: mono_w32file_set_times
warning: unresolved symbol: mono_w32file_truncate
warning: unresolved symbol: mono_w32file_unlock
warning: unresolved symbol: mono_w32file_write
warning: unresolved symbol: mono_w32mutex_abandon
warning: unresolved symbol: mono_w32mutex_init
warning: unresolved symbol: mono_w32process_cleanup
warning: unresolved symbol: mono_w32process_get_fileversion_info
warning: unresolved symbol: mono_w32process_get_pid
warning: unresolved symbol: mono_w32process_init
warning: unresolved symbol: mono_w32process_module_get_filename
warning: unresolved symbol: mono_w32process_module_get_information
warning: unresolved symbol: mono_w32process_module_get_name
warning: unresolved symbol: mono_w32process_signal_finished
warning: unresolved symbol: mono_w32process_try_get_modules
warning: unresolved symbol: mono_w32process_ver_language_name
warning: unresolved symbol: mono_w32process_ver_query_value
warning: unresolved symbol: mono_w32semaphore_init
warning: unresolved symbol: mono_w32socket_accept
warning: unresolved symbol: mono_w32socket_bind
warning: unresolved symbol: mono_w32socket_cleanup
warning: unresolved symbol: mono_w32socket_close
warning: unresolved symbol: mono_w32socket_connect
warning: unresolved symbol: mono_w32socket_convert_error
warning: unresolved symbol: mono_w32socket_disconnect
warning: unresolved symbol: mono_w32socket_duplicate
warning: unresolved symbol: mono_w32socket_get_available
warning: unresolved symbol: mono_w32socket_get_last_error
warning: unresolved symbol: mono_w32socket_getpeername
warning: unresolved symbol: mono_w32socket_getsockname
warning: unresolved symbol: mono_w32socket_getsockopt
warning: unresolved symbol: mono_w32socket_initialize
warning: unresolved symbol: mono_w32socket_ioctl
warning: unresolved symbol: mono_w32socket_listen
warning: unresolved symbol: mono_w32socket_recv
warning: unresolved symbol: mono_w32socket_recvbuffers
warning: unresolved symbol: mono_w32socket_recvfrom
warning: unresolved symbol: mono_w32socket_send
warning: unresolved symbol: mono_w32socket_sendbuffers
warning: unresolved symbol: mono_w32socket_sendto
warning: unresolved symbol: mono_w32socket_set_blocking
warning: unresolved symbol: mono_w32socket_setsockopt
warning: unresolved symbol: mono_w32socket_shutdown
warning: unresolved symbol: mono_w32socket_socket
warning: unresolved symbol: mono_w32socket_transmit_file
warning: unresolved symbol: putchar
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_CloseProcess
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize
warning: unresolved symbol: ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess
warning: unresolved symbol: ves_icall_System_ConsoleDriver_InternalKeyAvailable
warning: unresolved symbol: ves_icall_System_ConsoleDriver_Isatty
warning: unresolved symbol: ves_icall_System_ConsoleDriver_SetBreak
warning: unresolved symbol: ves_icall_System_ConsoleDriver_SetEcho
warning: unresolved symbol: ves_icall_System_ConsoleDriver_TtySetup
warning: unresolved symbol: ves_icall_System_Diagnostics_Process_CreateProcess_internal
warning: unresolved symbol: ves_icall_System_Diagnostics_Process_GetProcess_internal
warning: unresolved symbol: ves_icall_System_Diagnostics_Process_GetProcesses_internal
warning: unresolved symbol: ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal
warning: unresolved symbol: ves_icall_System_Net_Sockets_Socket_SupportPortReuse
warning: unresolved symbol: ves_icall_System_Threading_Events_CloseEvent_internal
warning: unresolved symbol: ves_icall_System_Threading_Events_CreateEvent_internal
warning: unresolved symbol: ves_icall_System_Threading_Events_OpenEvent_internal
warning: unresolved symbol: ves_icall_System_Threading_Events_ResetEvent_internal
warning: unresolved symbol: ves_icall_System_Threading_Events_SetEvent_internal
warning: unresolved symbol: ves_icall_System_Threading_Mutex_CreateMutex_internal
warning: unresolved symbol: ves_icall_System_Threading_Mutex_OpenMutex_internal
warning: unresolved symbol: ves_icall_System_Threading_Mutex_ReleaseMutex_internal
warning: unresolved symbol: ves_icall_System_Threading_Semaphore_CreateSemaphore_internal
warning: unresolved symbol: ves_icall_System_Threading_Semaphore_OpenSemaphore_internal
warning: unresolved symbol: ves_icall_System_Threading_Semaphore_ReleaseSemaphore_internal
*/
Empty file.
Empty file added mono/metadata/w32socket-wasm.c
Empty file.

0 comments on commit 5a4fcf5

Please sign in to comment.