]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/5g, cmd/6g, cmd/8g: delete clearstk
authorRuss Cox <rsc@golang.org>
Fri, 1 Jun 2012 14:10:59 +0000 (10:10 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 1 Jun 2012 14:10:59 +0000 (10:10 -0400)
Dreg from https://golang.org/cl/4629042

R=ken2
CC=golang-dev
https://golang.org/cl/6259057

src/cmd/5g/gsubr.c
src/cmd/6g/gsubr.c
src/cmd/8g/gsubr.c

index 69f0cef5009dfddbfc0763e7a13dc338e259c580..e4899fc91fbfcdb007adda4137f4a0069c14eb30 100644 (file)
@@ -174,64 +174,6 @@ newplist(void)
        return pl;
 }
 
-void
-clearstk(void)
-{
-       Plist *pl;
-       Prog *p, *p1, *p2, *p3;
-       Node dst, end, zero, con;
-
-       if(plast->firstpc->to.offset <= 0)
-               return;
-
-       // reestablish context for inserting code
-       // at beginning of function.
-       pl = plast;
-       p1 = pl->firstpc;
-       p2 = p1->link;
-       pc = mal(sizeof(*pc));
-       clearp(pc);
-       p1->link = pc;
-       
-       // zero stack frame
-
-       // MOVW $4(SP), R1
-       nodreg(&dst, types[tptr], 1);
-       p = gins(AMOVW, N, &dst);
-       p->from.type = D_CONST;
-       p->from.reg = REGSP;
-       p->from.offset = 4;
-
-       // MOVW $n(R1), R2
-       nodreg(&end, types[tptr], 2);
-       p = gins(AMOVW, N, &end);
-       p->from.type = D_CONST;
-       p->from.reg = 1;
-       p->from.offset = p1->to.offset;
-       
-       // MOVW $0, R3
-       nodreg(&zero, types[TUINT32], 3);
-       nodconst(&con, types[TUINT32], 0);
-       gmove(&con, &zero);
-
-       // L:
-       //      MOVW.P R3, 0(R1) +4
-       //      CMP R1, R2
-       //      BNE L
-       p = gins(AMOVW, &zero, &dst);
-       p->to.type = D_OREG;
-       p->to.offset = 4;
-       p->scond |= C_PBIT;
-       p3 = p;
-       p = gins(ACMP, &dst, N);
-       raddr(&end, p);
-       patch(gbranch(ABNE, T, 0), p3);
-
-       // continue with original code.
-       gins(ANOP, N, N)->link = p2;
-       pc = P;
-}      
-
 void
 gused(Node *n)
 {
index 91c7f4e3ad1491416f3a5340e778672bc612d12a..d286bca2fe71bd01e0ba7989e7e74ab576ca3a4f 100644 (file)
@@ -172,44 +172,6 @@ newplist(void)
        return pl;
 }
 
-void
-clearstk(void)
-{
-       Plist *pl;
-       Prog *p1, *p2;
-       Node sp, di, cx, con, ax;
-
-       if((uint32)plast->firstpc->to.offset <= 0)
-               return;
-
-       // reestablish context for inserting code
-       // at beginning of function.
-       pl = plast;
-       p1 = pl->firstpc;
-       p2 = p1->link;
-       pc = mal(sizeof(*pc));
-       clearp(pc);
-       p1->link = pc;
-       
-       // zero stack frame
-       nodreg(&sp, types[tptr], D_SP);
-       nodreg(&di, types[tptr], D_DI);
-       nodreg(&cx, types[TUINT64], D_CX);
-       nodconst(&con, types[TUINT64], (uint32)p1->to.offset / widthptr);
-       gins(ACLD, N, N);
-       gins(AMOVQ, &sp, &di);
-       gins(AMOVQ, &con, &cx);
-       nodconst(&con, types[TUINT64], 0);
-       nodreg(&ax, types[TUINT64], D_AX);
-       gins(AMOVQ, &con, &ax);
-       gins(AREP, N, N);
-       gins(ASTOSQ, N, N);
-
-       // continue with original code.
-       gins(ANOP, N, N)->link = p2;
-       pc = P;
-}      
-
 void
 gused(Node *n)
 {
index 943d36e9b976a031abaa1263d96f583b65a1a0b0..9d504c67916a207c5389c5f142e11cf81a5c10e8 100644 (file)
@@ -173,44 +173,6 @@ newplist(void)
        return pl;
 }
 
-void
-clearstk(void)
-{
-       Plist *pl;
-       Prog *p1, *p2;
-       Node sp, di, cx, con, ax;
-
-       if(plast->firstpc->to.offset <= 0)
-               return;
-
-       // reestablish context for inserting code
-       // at beginning of function.
-       pl = plast;
-       p1 = pl->firstpc;
-       p2 = p1->link;
-       pc = mal(sizeof(*pc));
-       clearp(pc);
-       p1->link = pc;
-       
-       // zero stack frame
-       nodreg(&sp, types[tptr], D_SP);
-       nodreg(&di, types[tptr], D_DI);
-       nodreg(&cx, types[TUINT32], D_CX);
-       nodconst(&con, types[TUINT32], p1->to.offset / widthptr);
-       gins(ACLD, N, N);
-       gins(AMOVL, &sp, &di);
-       gins(AMOVL, &con, &cx);
-       nodconst(&con, types[TUINT32], 0);
-       nodreg(&ax, types[TUINT32], D_AX);
-       gins(AMOVL, &con, &ax);
-       gins(AREP, N, N);
-       gins(ASTOSL, N, N);
-
-       // continue with original code.
-       gins(ANOP, N, N)->link = p2;
-       pc = P;
-}      
-
 void
 gused(Node *n)
 {