Skip to content

Commit

Permalink
[sgen] Remove two dead fields; fix wasm-mt AOT compilation (dotnet#75511
Browse files Browse the repository at this point in the history
)

They were only initialized, but never read.

But what they did do is change the SgenClientInfo field offsets
between the threaded and non-threaded wasm runtimes (because
emscripten only has HAVE_PTHREAD_KILL in the threaded build).  As a
result the offsets for tlab_start, tlab_next and tlab_temp_end were
different for the AOT compilers targeting threaded vs non-threaded
WASM.

This PR removes the two unused fields which will make the two wasm
configurations match again, allowing us to ship a single AOT cross
compiler for both threaded and non-threaded wasm.

Co-authored-by: Aleksey Kliger <[email protected]>
  • Loading branch information
github-actions[bot] and lambdageek authored Sep 13, 2022
1 parent 2cbaca1 commit f70fd22
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
7 changes: 0 additions & 7 deletions src/mono/mono/metadata/sgen-client-mono.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ struct _SgenClientThreadInfo {
gboolean skip, suspend_done;
volatile int in_critical_region;

#ifdef SGEN_POSIX_STW
/* This is -1 until the first suspend. */
int signal;
/* FIXME: kill this, we only use signals on systems that have rt-posix, which doesn't have issues with duplicates. */
unsigned int stop_count; /* to catch duplicate signals. */
#endif

gpointer runtime_data;

void *stack_end;
Expand Down
5 changes: 0 additions & 5 deletions src/mono/mono/metadata/sgen-mono.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,11 +2153,6 @@ sgen_client_thread_attach (SgenThreadInfo* info)

info->client_info.stack_start = NULL;

#ifdef SGEN_POSIX_STW
info->client_info.stop_count = -1;
info->client_info.signal = 0;
#endif

memset (&info->client_info.ctx, 0, sizeof (MonoContext));

if (mono_gc_get_gc_callbacks ()->thread_attach_func)
Expand Down
4 changes: 0 additions & 4 deletions src/mono/mono/sgen/sgen-gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ typedef enum {

NurseryClearPolicy sgen_get_nursery_clear_policy (void);

#if !defined(__MACH__) && !MONO_MACH_ARCH_SUPPORTED && defined(HAVE_PTHREAD_KILL)
#define SGEN_POSIX_STW 1
#endif

/*
* The nursery section uses this struct.
*/
Expand Down

0 comments on commit f70fd22

Please sign in to comment.