summaryrefslogtreecommitdiff
path: root/src/cmd/6l
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-11-23 17:08:55 -0800
committerRuss Cox <rsc@golang.org>2008-11-23 17:08:55 -0800
commitdd4aebb84ab8ee8dd11b12a7802a02373fabac6c (patch)
tree7844c561a0e97cefebaae40c6fc9e60acd59628f /src/cmd/6l
parent90aa232ac15839303847e28b1bc0747b5e9cc114 (diff)
downloadgolang-dd4aebb84ab8ee8dd11b12a7802a02373fabac6c.tar.gz
delete stack mark strings
in favor of using in-memory copy of symbol table. $ ls -l pretty pretty.big -rwxr-xr-x 1 rsc eng 439516 Nov 21 16:43 pretty -rwxr-xr-x 1 rsc eng 580984 Nov 21 16:20 pretty.big $ R=r DELTA=446 (238 added, 178 deleted, 30 changed) OCL=19851 CL=19884
Diffstat (limited to 'src/cmd/6l')
-rw-r--r--src/cmd/6l/6.out.h1
-rw-r--r--src/cmd/6l/obj.c1
-rw-r--r--src/cmd/6l/pass.c94
3 files changed, 0 insertions, 96 deletions
diff --git a/src/cmd/6l/6.out.h b/src/cmd/6l/6.out.h
index 4abbbf057..0c22944fa 100644
--- a/src/cmd/6l/6.out.h
+++ b/src/cmd/6l/6.out.h
@@ -33,7 +33,6 @@
#define NOPROF (1<<0)
#define DUPOK (1<<1)
#define NOSPLIT (1<<2)
-#define SOFmark "\xa7\xf1\xd9\x2a\x82\xc8\xd8\xfe"
/*
* amd64
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index 9777cdf42..8ecb035b4 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -402,7 +402,6 @@ main(int argc, char *argv[])
doprof1();
else
doprof2();
- addstackmark();
span();
doinit();
asmb();
diff --git a/src/cmd/6l/pass.c b/src/cmd/6l/pass.c
index 9f765e836..3ddc1e937 100644
--- a/src/cmd/6l/pass.c
+++ b/src/cmd/6l/pass.c
@@ -293,100 +293,6 @@ byteq(int v)
return p;
}
-void
-markstk(Prog *l)
-{
- Prog *p0, *p, *q, *r;
- int32 i, n, line;
- Sym *s;
-
- version++;
- s = lookup(l->from.sym->name, version);
- s->type = STEXT;
- line = l->line;
-
- // start with fake copy of ATEXT
- p0 = prg();
- p = p0;
- *p = *l; // note this gets p->pcond and p->line
-
- p->from.type = D_STATIC;
- p->from.sym = s;
- p->to.offset = 0;
-
- // put out magic sequence
- n = strlen(SOFmark);
- for(i=0; i<n; i++) {
- q = byteq(SOFmark[i]);
- q->line = line;
- p->link = q;
- p = q;
- }
-
- // put out stack offset
- n = l->to.offset;
- if(n < 0)
- n = 0;
- for(i=0; i<3; i++) {
- q = byteq(n);
- q->line = line;
- p->link = q;
- p = q;
- n = n>>8;
- }
-
- // put out null terminated name
- for(i=0;; i++) {
- n = s->name[i];
- q = byteq(n);
- q->line = line;
- p->link = q;
- p = q;
- if(n == 0)
- break;
- }
-
- // put out return instruction
- q = prg();
- q->as = ARET;
- q->line = line;
- p->link = q;
- p = q;
-
- r = l->pcond;
- l->pcond = p0;
- p->link = r;
- p0->pcond = r;
-
- // hard part is linking end of
- // the text body to my fake ATEXT
- for(p=l;; p=q) {
- q = p->link;
- if(q == r) {
- p->link = p0;
- return;
- }
- }
-}
-
-void
-addstackmark(void)
-{
- Prog *p;
-
- if(debug['v'])
- Bprint(&bso, "%5.2f stkmark\n", cputime());
- Bflush(&bso);
-
- for(p=textp; p!=P; p=p->pcond) {
- markstk(p); // splice in new body
- p = p->pcond; // skip the one we just put in
- }
-
-// for(p=textp; p!=P; p=p->pcond)
-// print("%P\n", p);
-}
-
int
relinv(int a)
{