diff options
| author | Russ Cox <rsc@golang.org> | 2013-07-19 16:04:09 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2013-07-19 16:04:09 -0400 |
| commit | 48769bf546ba7ad830c2edc05656e217d15a20c8 (patch) | |
| tree | e3110fce615f1250f56a7c68d69ade5ad3ff3bbb /src/pkg/runtime/traceback_arm.c | |
| parent | 5d340de1f682d3b2cf10b2319c25ef3799e84078 (diff) | |
| download | go-48769bf546ba7ad830c2edc05656e217d15a20c8.tar.xz | |
runtime: use funcdata to supply garbage collection information
This CL introduces a FUNCDATA number for runtime-specific
garbage collection metadata, changes the C and Go compilers
to emit that metadata, and changes the runtime to expect it.
The old pseudo-instructions that carried this information
are gone, as is the linker code to process them.
R=golang-dev, dvyukov, cshapiro
CC=golang-dev
https://golang.org/cl/11406044
Diffstat (limited to 'src/pkg/runtime/traceback_arm.c')
| -rw-r--r-- | src/pkg/runtime/traceback_arm.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/pkg/runtime/traceback_arm.c b/src/pkg/runtime/traceback_arm.c index 5aea699e34..563ba28c94 100644 --- a/src/pkg/runtime/traceback_arm.c +++ b/src/pkg/runtime/traceback_arm.c @@ -95,7 +95,9 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip, runtime·throw("unknown caller pc"); } } - + + frame.varp = (byte*)frame.fp; + // Derive size of arguments. // Most functions have a fixed-size argument block, // so we can use metadata about the function f. @@ -121,27 +123,6 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip, } } - // Derive location and size of local variables. - if(frame.fp == frame.sp) { - // Function has not created a frame for itself yet. - frame.varp = nil; - frame.varlen = 0; - } else if(f->locals == 0) { - // Assume no information, so use whole frame. - // TODO: Distinguish local==0 from local==unknown. - frame.varp = (byte*)frame.sp; - frame.varlen = frame.fp - frame.sp; - } else { - if(f->locals > frame.fp - frame.sp) { - runtime·printf("runtime: inconsistent locals=%p frame=%p fp=%p sp=%p for %s\n", (uintptr)f->locals, (uintptr)f->frame, frame.fp, frame.sp, runtime·funcname(f)); - if(callback != nil) - runtime·throw("invalid stack"); - } - frame.varp = (byte*)frame.fp - f->locals; - frame.varlen = f->locals; - } - - if(skip > 0) { skip--; goto skipped; @@ -203,7 +184,7 @@ runtime·gentraceback(uintptr pc0, uintptr sp0, uintptr lr0, G *gp, int32 skip, frame.fn = f = runtime·findfunc(frame.pc); if(f == nil) frame.pc = x; - else if (f->frame == 0) + else if(f->frame == 0) frame.lr = x; } } |
