# This can be reset to 0 when Mono's version number is bumped
# since it's part of the corlib version (the prefix '1' in the full
# version number is to ensure the number isn't treated as octal in C)
-MONO_CORLIB_COUNTER=0
-MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
+MONO_CORLIB_COUNTER=1
+MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR 0 $MONO_CORLIB_COUNTER`
AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
AC_SUBST(MONO_CORLIB_VERSION)
if test "x$enable_wasm" = "xyes"; then
- CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1 -DWASM -Os"
- CPPFLAGS="$CPPFLAGS -D_REENTRANT -DUSE_MMAP -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1 -DWASM -Os"
+ CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1"
+ CPPFLAGS="$CPPFLAGS -D_REENTRANT -DUSE_MMAP -D_GNU_SOURCE -DNO_UNALIGNED_ACCESS -s WASM=1"
libdl="-ldl"
libgc_threads=pthreads
AC_CHECK_HEADERS(linux/magic.h)
# not 64 bit clean in cross-compile
- AC_CHECK_SIZEOF(void *, 4)
+ if test "x$enable_wasm" = "xyes"; then
+ AC_DEFINE(SIZEOF_VOID_P,4)
+ AC_DEFINE(SIZEOF_LONG,4)
+ ac_cv_sizeof_void_p="4"
+ ac_cv_sizeof_long="4"
+ else
+ AC_CHECK_SIZEOF(void *)
+ AC_CHECK_SIZEOF(long)
+ fi
+
+ AC_CHECK_SIZEOF(int)
+ AC_CHECK_SIZEOF(long long)
AC_CACHE_CHECK([for clang],
mono_cv_clang,[
AC_CHECK_FUNCS(getpwuid_r)
fi
+ AC_FUNC_STRERROR_R()
+
dnl ****************************************************************
dnl *** Check for sched_setaffinity from glibc versions before ***
dnl *** 2.3.4. The older versions of the function only take 2 ***
HOST=WASM
arch_target=wasm
AC_DEFINE(TARGET_WASM, 1, [Target wasm])
+ AC_DEFINE(HOST_WASM, 1, [Host wasm])
BTLS_SUPPORTED=no
with_tls=pthread
target_mach=no
AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
- AC_CHECK_SIZEOF(int)
- AC_CHECK_SIZEOF(void *)
- AC_CHECK_SIZEOF(long)
- AC_CHECK_SIZEOF(long long)
AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf strerror_r)
AC_CHECK_FUNCS(getrlimit)
AC_CHECK_FUNCS(fork execv execve)
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
AM_CONDITIONAL(ARM64, test x$TARGET = xARM64)
AM_CONDITIONAL(S390X, test x$TARGET = xS390X)
+ AM_CONDITIONAL(WASM, test x$TARGET = xWASM)
AM_CONDITIONAL(HOST_X86, test x$HOST = xX86)
AM_CONDITIONAL(HOST_AMD64, test x$HOST = xAMD64)
AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
mono_runtime=mono/mini/mono
AC_SUBST(mono_runtime)
-CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.1/tools/csc.exe
+CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.2/tools/csc.exe
if test $csc_compiler = mcs; then
CSC=$mcs_topdir/class/lib/build/mcs.exe
rc->xdomain_vtable = NULL;
rc->proxy_class_name = name;
#ifndef DISABLE_PERFCOUNTERS
- mono_perfcounters->loader_bytes += mono_string_length (MONO_HANDLE_RAW (class_name)) + 1;
+ InterlockedAdd (&mono_perfcounters->loader_bytes, mono_string_length (MONO_HANDLE_RAW (class_name)) + 1);
#endif
g_hash_table_insert (domain->proxy_vtable_hash, key, rc);
MonoVTable *vtable;
- vtable = mono_class_vtable (domain, klass);
- g_assert (vtable); /* FIXME don't swallow the error */
+ vtable = mono_class_vtable_full (domain, klass, error);
+ if (!is_ok (error))
+ return NULL;
MonoObject *o = mono_object_new_specific_checked (vtable, error);
return o;
#define MONO_ARCH_CONTEXT_DEF
#endif
-#ifndef MONO_ARCH_STACK_GROWS_UP
-#define MONO_ARCH_STACK_GROWS_UP 0
-#endif
-
/*
* Raw frame information is stored in MonoException.trace_ips as an IntPtr[].
* This structure represents one entry.
return addr;
}
-static inline int
-mini_abort_threshold_offset (gpointer threshold, gpointer sp)
-{
- intptr_t stack_threshold = (intptr_t) threshold;
- intptr_t stack_pointer = (intptr_t) sp;
-
- const int direction = MONO_ARCH_STACK_GROWS_UP ? -1 : 1;
- intptr_t magnitude = stack_pointer - stack_threshold;
-
- return direction * magnitude;
-}
-
static inline void
mini_clear_abort_threshold (void)
{
// Only move it up, to avoid thrown/caught
// exceptions lower in the stack from triggering
// a rethrow
- gboolean above_threshold = mini_abort_threshold_offset (jit_tls->abort_exc_stack_threshold, sp) >= 0;
+ gboolean above_threshold = (gsize) sp >= (gsize) jit_tls->abort_exc_stack_threshold;
if (!jit_tls->abort_exc_stack_threshold || above_threshold) {
jit_tls->abort_exc_stack_threshold = sp;
}
if (!sp)
return TRUE;
- gboolean above_threshold = mini_abort_threshold_offset (jit_tls->abort_exc_stack_threshold, sp) >= 0;
+ gboolean above_threshold = (gsize) sp >= (gsize) jit_tls->abort_exc_stack_threshold;
if (above_threshold)
jit_tls->abort_exc_stack_threshold = sp;
dynamic_methods = g_slist_prepend (dynamic_methods, method);
if (stack_overflow) {
- if (MONO_ARCH_STACK_GROWS_UP)
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (ctx));
- else
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
+ free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
} else {
free_stack = 0xffffff;
}
if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
#ifndef DISABLE_PERFCOUNTERS
- mono_perfcounters->exceptions_filters++;
+ InterlockedIncrement (&mono_perfcounters->exceptions_filters);
#endif
#ifndef MONO_CROSS_COMPILE
//printf ("M: %s %d.\n", mono_method_full_name (method, TRUE), frame_count);
if (stack_overflow) {
- if (MONO_ARCH_STACK_GROWS_UP)
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (ctx));
- else
- free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
+ free_stack = (guint8*)(MONO_CONTEXT_GET_SP (ctx)) - (guint8*)(MONO_CONTEXT_GET_SP (&initial_ctx));
} else {
free_stack = 0xffffff;
}
}
mono_set_lmf (lmf);
#ifndef DISABLE_PERFCOUNTERS
- mono_perfcounters->exceptions_depth += frame_count;
+ InterlockedAdd (&mono_perfcounters->exceptions_depth, frame_count);
#endif
if (obj == (MonoObject *)domain->stack_overflow_ex)
jit_tls->handling_stack_ovf = FALSE;
MONO_PROFILER_RAISE (exception_clause, (method, i, ei->flags, ex_obj));
jit_tls->orig_ex_ctx_set = FALSE;
#ifndef DISABLE_PERFCOUNTERS
- mono_perfcounters->exceptions_finallys++;
+ InterlockedIncrement (&mono_perfcounters->exceptions_finallys);
#endif
}
if (ei->flags == MONO_EXCEPTION_CLAUSE_FAULT || ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY) {
MONO_REQ_GC_UNSAFE_MODE;
#ifndef DISABLE_PERFCOUNTERS
- mono_perfcounters->exceptions_thrown++;
+ InterlockedIncrement (&mono_perfcounters->exceptions_thrown);
#endif
return mono_handle_exception_internal (ctx, obj, FALSE, NULL);
if (mono_ex->trace_ips) {
GList *trace_ips = NULL;
- gpointer ip = __builtin_return_address (0);
+ gpointer ip = RETURN_ADDRESS ();
size_t upper = mono_array_length (mono_ex->trace_ips);
#include <mono/utils/memcheck.h>
#include <mono/utils/mono-mmap-internals.h>
+#include <mono/utils/unlocked.h>
#undef pthread_create
#undef pthread_join
#define safe_object_get_size sgen_safe_object_get_size
- #if defined(HAVE_CONC_GC_AS_DEFAULT)
- /* Use concurrent major on deskstop platforms */
- #define DEFAULT_MAJOR SGEN_MAJOR_CONCURRENT
- #else
- #define DEFAULT_MAJOR SGEN_MAJOR_SERIAL
- #endif
-
typedef enum {
SGEN_MAJOR_DEFAULT,
SGEN_MAJOR_SERIAL,
major_collector.finish_nursery_collection ();
TV_GETTIME (last_minor_collection_end_tv);
- InterlockedAdd64 (&gc_stats.minor_gc_time, TV_ELAPSED (last_minor_collection_start_tv, last_minor_collection_end_tv));
+ UnlockedAdd64 (&gc_stats.minor_gc_time, TV_ELAPSED (last_minor_collection_start_tv, last_minor_collection_end_tv));
sgen_debug_dump_heap ("minor", InterlockedRead (&gc_stats.minor_gc_count) - 1, NULL);
sgen_gray_object_queue_dispose (&gc_thread_gray_queue);
TV_GETTIME (time_end);
- InterlockedAdd64 (&gc_stats.major_gc_time, TV_ELAPSED (time_start, time_end));
+ UnlockedAdd64 (&gc_stats.major_gc_time, TV_ELAPSED (time_start, time_end));
/* FIXME: also report this to the user, preferably in gc-end. */
if (major_collector.get_and_reset_num_major_objects_marked)
num_objects_marked = major_collector.get_and_reset_num_major_objects_marked ();
TV_GETTIME (time_end);
- InterlockedAdd64 (&gc_stats.major_gc_time, TV_ELAPSED (time_start, time_end));
+ UnlockedAdd64 (&gc_stats.major_gc_time, TV_ELAPSED (time_start, time_end));
current_collection_generation = -1;
}
sgen_los_update_cardtable_mod_union ();
TV_GETTIME (total_end);
- InterlockedAdd64 (&gc_stats.major_gc_time, TV_ELAPSED (total_start, total_end));
+ UnlockedAdd64 (&gc_stats.major_gc_time, TV_ELAPSED (total_start, total_end));
}
static void
sgen_workers_stop_all_workers (GENERATION_OLD);
SGEN_TV_GETTIME (time_major_conc_collection_end);
- InterlockedAdd64 (&gc_stats.major_gc_time_concurrent, SGEN_TV_ELAPSED (time_major_conc_collection_start, time_major_conc_collection_end));
+ UnlockedAdd64 (&gc_stats.major_gc_time_concurrent, SGEN_TV_ELAPSED (time_major_conc_collection_start, time_major_conc_collection_end));
major_collector.update_cardtable_mod_union ();
sgen_los_update_cardtable_mod_union ();
sgen_gray_object_queue_dispose (&gc_thread_gray_queue);
TV_GETTIME (total_end);
- InterlockedAdd64 (&gc_stats.major_gc_time, TV_ELAPSED (total_start, total_end));
+ UnlockedAdd64 (&gc_stats.major_gc_time, TV_ELAPSED (total_start, total_end));
current_collection_generation = -1;
}