diff options
author | Carl Shapiro <cshapiro@google.com> | 2013-02-21 12:52:26 -0800 |
---|---|---|
committer | Carl Shapiro <cshapiro@google.com> | 2013-02-21 12:52:26 -0800 |
commit | f07a10a607ade8a6f2d05428f276ed93a895a6aa (patch) | |
tree | 9ad8157f72fa138d76a67e8658eed9af9cc6d801 /src/cmd/gc | |
parent | 480f47d1626f154493084d2d505d31e5b822402f (diff) | |
download | go-f07a10a607ade8a6f2d05428f276ed93a895a6aa.tar.gz |
cmd/5g, cmd/5l, cmd/6l, cmd/8l, cmd/gc, cmd/ld, runtime: accurate args and locals information
Previously, the func structure contained an inaccurate value for
the args member and a 0 value for the locals member.
This change populates the func structure with args and locals
values computed by the compiler. The number of args was
already available in the ATEXT instruction. The number of
locals is now passed through in the new ALOCALS instruction.
This change also switches the unit of args and locals to be
bytes, just like the frame member, instead of 32-bit words.
R=golang-dev, bradfitz, cshapiro, dave, rsc
CC=golang-dev
https://codereview.appspot.com/7399045
Diffstat (limited to 'src/cmd/gc')
-rw-r--r-- | src/cmd/gc/pgen.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/gc/pgen.c b/src/cmd/gc/pgen.c index a07ad7734..23c71ae0e 100644 --- a/src/cmd/gc/pgen.c +++ b/src/cmd/gc/pgen.c @@ -14,7 +14,7 @@ compile(Node *fn) { Plist *pl; Node nod1, *n; - Prog *ptxt; + Prog *plocals, *ptxt; int32 lno; Type *t; Iter save; @@ -87,6 +87,8 @@ compile(Node *fn) ginit(); + plocals = gins(ALOCALS, N, N); + for(t=curfn->paramfld; t; t=t->down) gtrack(tracksym(t->type)); @@ -132,6 +134,9 @@ compile(Node *fn) oldstksize = stksize; allocauto(ptxt); + + plocals->to.offset = stksize; + if(0) print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize); |