diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-11-01 18:25:06 +0100 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-11-01 18:25:06 +0100 |
| commit | 970ffb4684dbd88bd54e909820bbc5a66a87b18d (patch) | |
| tree | 43ad1d8438ef824deaf6d363d38f5d60f3d04645 /include/data.s | |
| parent | d1a4eb56ccf39974dd93eeb0434721acc69bbc7c (diff) | |
| download | uskel-970ffb4684dbd88bd54e909820bbc5a66a87b18d.tar.gz uskel-970ffb4684dbd88bd54e909820bbc5a66a87b18d.tar.bz2 | |
all looks ok
Diffstat (limited to 'include/data.s')
| -rw-r--r-- | include/data.s | 60 |
1 files changed, 58 insertions, 2 deletions
diff --git a/include/data.s b/include/data.s index 4a827e2..35c4c8d 100644 --- a/include/data.s +++ b/include/data.s @@ -1,7 +1,7 @@ .ifndef _data_s_file _data_s_file: - nop + nop # avoid confusing gdb # Format of the info tables: # - code @@ -64,6 +64,62 @@ IND_info: IND_code: enter 010(%rbp) +# Blackhole (contains the original thunkptr for debugging purposes) +# | ptr | orig_thunkptr | +BLE_evacuate: + jmp _gc_evacuate_ret +BLE_scavenge: + jmp _gc_scavenge_ret + +BLE_info_table: + cell BLE_evacuate + cell BLE_scavenge + cell 0 +BLE_code: + # if we hit this, we've got a pure loop in a program, and it is never + # going to actually progress. So let's just shoot it down with a + # helpful message or so. + mov 010(%rbp), %r15 + + mov $1, %rdi #stdout + + mov $14, %rdx + mov $BLE_msg, %rsi + mov $1, %rax #write + syscall + + mov $1, %rdx + BLE_loop: + mov %r15, %rcx + and $0xf, %rcx + mov $BLE_hex, %rsi + add %rcx, %rsi + mov $1, %rax + syscall + shr $4, %r15 + jnz BLE_loop + + mov $BLE_nl, %rsi + mov $1, %rax + syscall + + # shot self down (and retry if it doesn't succeed) + BLE_retry_sigkill: + mov $39, %rax + syscall # getpid + mov %rax, %rdi + mov $6, %rsi # SIGABRT + mov $62, %rax # kill + syscall + jmp BLE_retry_sigkill + +BLE_msg: + .ascii "diverged at 0x" +BLE_hex: + .ascii "0123456789abcdef" +BLE_nl: + .ascii "\n" + # List # | ptr | 0 | # [] case # | ptr | 1 | a | b | # (a:b) case @@ -86,7 +142,7 @@ LIST_scavenge: cmpq $0, 010(%rbp) je LIST_scavenge_nil mov %rbp, %r15 - + mov $LIST_scavenge1, %rsi mov 020(%r15), %rbp jmp _gc_evacuate |
