diff options
author | Nguyen Thai Ngoc Duy <pclouds@gmail.com> | 2021-05-12 20:34:49 +0700 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2021-06-20 10:54:10 +0300 |
commit | 1431bda1a87d66d669faab00aefe34349c54a56a (patch) | |
tree | 92eff999a82a033967fcf34a74980a7d1b1c8957 /doc | |
parent | 8fbb53983eb2229260edd6527d146ca9056f9b1a (diff) | |
download | bdwgc-1431bda1a87d66d669faab00aefe34349c54a56a.tar.gz |
Emscripten single-threaded support (detect stack base, push registers)
Issue #354 (bdwgc).
This adds a bit more in os_dep.c in order to scan the stack and
registers, which is possible if we enable ASYNCIFY (note, this adds
quite some overhead). gctest almost passes with this, except for the
test code that involves a_get().
* configure.ac (emscripten): Define (based __EMSCRIPTEN__ macro
presence).
* configure.ac [emscripten] (gc_cflags): Append ASYNCIFY[_STACK_SIZE]
(to set stack size to 128 KB).
* configure.ac [emscripten] (EMSCRIPTEN): Define AM variable.
* configure.ac [emscripten] (THREADS): Set to "no" by default.
* doc/README.emscripten: New file.
* include/private/gcconfig.h [I386 && __EMSCRIPTEN__]
(STACK_NOT_SCANNED): Remove it, along with the comment.
* include/private/gcconfig.h [I386 && __EMSCRIPTEN__] (USE_MMAP_ANON,
STACK_GROWS_DOWN): Define macro.
* mach_dep.c [!SN_TARGET_ORBIS && !SN_TARGET_PSP2 && !HAVE_PUSH_REGS
&& __EMSCRIPTEN__] (GC_with_callee_saves_pushed): Do nothing before fn
call.
* os_dep.c [__EMSCRIPTEN__]: Include emscripten.h.
* os_dep.c [__EMSCRIPTEN__] (emscripten_stack_base): New static
variable.
* os_dep.c [__EMSCRIPTEN__] (scan_stack_cb): New static function.
* os_dep.c [!THREADS && __EMSCRIPTEN__] (scan_regs_cb): Likewise.
* os_dep.c [__EMSCRIPTEN__] (GC_get_main_stack_base): Implement.
* os_dep.c [!THREADS && __EMSCRIPTEN__] (GC_default_push_other_roots):
Likewise.
* os_dep.c [__EMSCRIPTEN__] (GET_MAIN_STACKBASE_SPECIAL): Define macro.
* os_dep.c [USE_MUNMAP && !USE_WINALLOC && !SN_TARGET_PS3
&& __EMSCRIPTEN__]: Do not call mmap or mprotect.
* tests/test.c [__EMSCRIPTEN__] (reverse_test_inner): Do not call
check_ints(a_get(),1,49); add FIXME.
* tests/tests.am [EMSCRIPTEN] (check_PROGRAMS): Add gctest.html.
* tests/tests.am [EMSCRIPTEN] (gctest_html_SOURCES, gctest_html_LDADD,
gctest_html_LDFLAGS): Define variable.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/README.emscripten | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/README.emscripten b/doc/README.emscripten new file mode 100644 index 00000000..c869f19a --- /dev/null +++ b/doc/README.emscripten @@ -0,0 +1,15 @@ + +The build system (at least autotools-based) should detect and configure +emscripten correctly. + +As of now, gctest almost passes, except for the tests that involve a_get(). + +No thread support for now. No idea how to stop other threads (perhaps we need +support from JS side). + +How to build: + + # source EMSDK first + emconfigure ./configure + emmake make gctest.html + # point your browser at .libs/gctest.html |