mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: make stack frames fixed size by modifying goproc/deferproc.
Calls to goproc/deferproc used to push & pop two extra arguments, the argument size and the function to call. Now, we allocate space for those arguments in the outargs section so we don't have to modify the SP. Defers now use the stack pointer (instead of the argument pointer) to identify which frame they are associated with. A followon CL might simplify funcspdelta and some of the stack walking code. Fixes issue #8641 Change-Id: I835ec2f42f0392c5dec7cb0fe6bba6f2aed1dad8 Reviewed-on: https://go-review.googlesource.com/1601 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
005ba4db82
commit
53c5226f9f
14 changed files with 156 additions and 158 deletions
|
|
@ -499,7 +499,7 @@ func adjustdefers(gp *g, adjinfo *adjustinfo) {
|
|||
// Defer structs themselves are never on the stack.
|
||||
for d := gp._defer; d != nil; d = d.link {
|
||||
adjustpointer(adjinfo, (unsafe.Pointer)(&d.fn))
|
||||
adjustpointer(adjinfo, (unsafe.Pointer)(&d.argp))
|
||||
adjustpointer(adjinfo, (unsafe.Pointer)(&d.sp))
|
||||
adjustpointer(adjinfo, (unsafe.Pointer)(&d._panic))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue