ruby-changes:70940
From: Yuta <ko1@a...>
Date: Wed, 19 Jan 2022 11:19:31 +0900 (JST)
Subject: [ruby-changes:70940] e7fb1fa041 (master): [wasm] gc.c: disable read signal barrier for wasi
https://git.ruby-lang.org/ruby.git/commit/?id=e7fb1fa041 From e7fb1fa0414a0c6e43796052c877f317e8e09846 Mon Sep 17 00:00:00 2001 From: Yuta Saito <kateinoigakukun@g...> Date: Sat, 15 Jan 2022 23:57:14 +0900 Subject: [wasm] gc.c: disable read signal barrier for wasi WASI currently does not yet support signal --- gc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gc.c b/gc.c index 0d5a1336b36..2fa4eabc416 100644 --- a/gc.c +++ b/gc.c @@ -5013,6 +5013,14 @@ gc_unprotect_pages(rb_objspace_t *objspace, rb_heap_t *heap) https://github.com/ruby/ruby/blob/trunk/gc.c#L5013 static void gc_update_references(rb_objspace_t * objspace); static void invalidate_moved_page(rb_objspace_t *objspace, struct heap_page *page); +#if !defined(__wasi__) +// read barrier for pages containing MOVED objects +# define GC_ENABLE_READ_SIGNAL_BARRIER 1 +#else +# define GC_ENABLE_READ_SIGNAL_BARRIER 0 +#endif + +#if GC_ENABLE_READ_SIGNAL_BARRIER static void read_barrier_handler(uintptr_t address) { @@ -5121,6 +5129,8 @@ install_handlers(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L5129 } #endif +#endif // GC_ENABLE_READ_SIGNAL_BARRIER + static void revert_stack_objects(VALUE stack_obj, void *ctx) { @@ -5167,7 +5177,9 @@ gc_compact_finish(rb_objspace_t *objspace, rb_size_pool_t *pool, rb_heap_t *heap https://github.com/ruby/ruby/blob/trunk/gc.c#L5177 gc_unprotect_pages(objspace, heap); } +#if GC_ENABLE_READ_SIGNAL_BARRIER uninstall_handlers(); +#endif /* The mutator is allowed to run during incremental sweeping. T_MOVED * objects can get pushed on the stack and when the compaction process @@ -5889,7 +5901,9 @@ gc_compact_start(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L5901 memset(objspace->rcompactor.moved_count_table, 0, T_MASK * sizeof(size_t)); /* Set up read barrier for pages containing MOVED objects */ +#if GC_ENABLE_READ_SIGNAL_BARRIER install_handlers(); +#endif } static void -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/