diff options
| author | Russ Cox <rsc@golang.org> | 2010-09-07 09:57:22 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-09-07 09:57:22 -0400 |
| commit | d4cc557b0d61ac02d0ff153ecd643867e803ed1f (patch) | |
| tree | c8301a638fd5010bb90b6a6d415ec371c74ba3ce /src/pkg/runtime/linux/amd64/sys.s | |
| parent | 6f5f558c101a5948f1d90007fe93159804743bb6 (diff) | |
| download | go-d4cc557b0d61ac02d0ff153ecd643867e803ed1f.tar.xz | |
runtime: use manual stack for garbage collection
Old code was using recursion to traverse object graph.
New code uses an explicit stack, cutting the per-pointer
footprint to two words during the recursion and avoiding
the standard allocator and stack splitting code.
in test/garbage:
Reduces parser runtime by 2-3%
Reduces Peano runtime by 40%
Increases tree runtime by 4-5%
R=r
CC=golang-dev
https://golang.org/cl/2150042
Diffstat (limited to 'src/pkg/runtime/linux/amd64/sys.s')
| -rw-r--r-- | src/pkg/runtime/linux/amd64/sys.s | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pkg/runtime/linux/amd64/sys.s b/src/pkg/runtime/linux/amd64/sys.s index 20287c8d02..7e0fffc656 100644 --- a/src/pkg/runtime/linux/amd64/sys.s +++ b/src/pkg/runtime/linux/amd64/sys.s @@ -100,7 +100,7 @@ TEXT ·mmap(SB),7,$0 MOVL 32(SP), R8 MOVL 36(SP), R9 - MOVL $9, AX // syscall entry + MOVL $9, AX // mmap SYSCALL CMPQ AX, $0xfffffffffffff001 JLS 3(PC) @@ -108,6 +108,16 @@ TEXT ·mmap(SB),7,$0 INCQ AX RET +TEXT munmap(SB),7,$0 + MOVQ 8(SP), DI + MOVQ 16(SP), SI + MOVQ $11, AX // munmap + SYSCALL + CMPQ AX, $0xfffffffffffff001 + JLS 2(PC) + CALL notok(SB) + RET + TEXT notok(SB),7,$0 MOVQ $0xf1, BP MOVQ BP, (BP) |
