Get garbage collector working on aarch64

Garbage collection will now happen on arm64 when a function returns,
rather than kicking the can down the road to when the process exits.
This change also does some code cleanup and incorporates suggestions
This commit is contained in:
Justine Tunney 2023-06-07 03:34:45 -07:00
parent 9793d3524f
commit 01fd655097
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
16 changed files with 144 additions and 323 deletions

View file

@ -164,6 +164,7 @@ static bool AppendFileLine(struct Buffer *b, const char *addr2line,
relegated void __oncrash_arm64(int sig, struct siginfo *si, void *arg) {
char buf[10000];
ucontext_t *ctx = arg;
static _Thread_local bool once;
struct Buffer b[1] = {{buf, sizeof(buf)}};
b->p[b->i++] = '\n';
@ -172,7 +173,6 @@ relegated void __oncrash_arm64(int sig, struct siginfo *si, void *arg) {
const char *kind;
const char *reset;
const char *strong;
ucontext_t *ctx = arg;
char host[64] = "unknown";
struct utsname names = {0};
once = true;
@ -320,7 +320,8 @@ relegated void __oncrash_arm64(int sig, struct siginfo *si, void *arg) {
}
}
} else {
Append(b, "got %G while crashing!\n", sig);
Append(b, "got %G while crashing! pc %lx lr %lx\n", sig,
ctx->uc_mcontext.pc, ctx->uc_mcontext.regs[30]);
}
sys_write(2, b->p, MIN(b->i, b->n));
__print_maps();