Commit d97d3718 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

5g, 8g: remove dead code

maxstksize is superfluous and appears to be vestigial. 6g does not use it.

c >= 4 cannot occur; c = w % 4.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/68750043
parent e6863e7d
...@@ -28,7 +28,6 @@ EXTERN Node* panicindex; ...@@ -28,7 +28,6 @@ EXTERN Node* panicindex;
EXTERN Node* panicslice; EXTERN Node* panicslice;
EXTERN Node* throwreturn; EXTERN Node* throwreturn;
extern long unmappedzero; extern long unmappedzero;
EXTERN int maxstksize;
/* /*
* gen.c * gen.c
......
...@@ -22,11 +22,8 @@ defframe(Prog *ptxt) ...@@ -22,11 +22,8 @@ defframe(Prog *ptxt)
ptxt->to.offset2 = rnd(curfn->type->argwid, widthptr); ptxt->to.offset2 = rnd(curfn->type->argwid, widthptr);
// fill in final stack size // fill in final stack size
if(stksize > maxstksize) frame = rnd(stksize+maxarg, widthptr);
maxstksize = stksize;
frame = rnd(maxstksize+maxarg, widthptr);
ptxt->to.offset = frame; ptxt->to.offset = frame;
maxstksize = 0;
p = ptxt; p = ptxt;
if(stkzerosize > 0) { if(stkzerosize > 0) {
......
...@@ -31,7 +31,6 @@ EXTERN Node* panicindex; ...@@ -31,7 +31,6 @@ EXTERN Node* panicindex;
EXTERN Node* panicslice; EXTERN Node* panicslice;
EXTERN Node* panicdiv; EXTERN Node* panicdiv;
EXTERN Node* throwreturn; EXTERN Node* throwreturn;
EXTERN int maxstksize;
extern uint32 unmappedzero; extern uint32 unmappedzero;
......
...@@ -21,11 +21,8 @@ defframe(Prog *ptxt) ...@@ -21,11 +21,8 @@ defframe(Prog *ptxt)
ptxt->to.offset2 = rnd(curfn->type->argwid, widthptr); ptxt->to.offset2 = rnd(curfn->type->argwid, widthptr);
// fill in final stack size // fill in final stack size
if(stksize > maxstksize) frame = rnd(stksize+maxarg, widthptr);
maxstksize = stksize;
frame = rnd(maxstksize+maxarg, widthptr);
ptxt->to.offset = frame; ptxt->to.offset = frame;
maxstksize = 0;
// insert code to contain ambiguously live variables // insert code to contain ambiguously live variables
// so that garbage collector only sees initialized values // so that garbage collector only sees initialized values
...@@ -137,11 +134,6 @@ clearfat(Node *nl) ...@@ -137,11 +134,6 @@ clearfat(Node *nl)
q--; q--;
} }
if(c >= 4) {
gconreg(AMOVL, c, D_CX);
gins(AREP, N, N); // repeat
gins(ASTOSB, N, N); // STOB AL,*(DI)+
} else
while(c > 0) { while(c > 0) {
gins(ASTOSB, N, N); // STOB AL,*(DI)+ gins(ASTOSB, N, N); // STOB AL,*(DI)+
c--; c--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment