mirror of
https://github.com/golang/go
synced 2024-11-26 08:38:01 -07:00
stack allocation for the init function
R=r OCL=17063 CL=17063
This commit is contained in:
parent
99c5b2ed4d
commit
1ea5bc7533
@ -987,7 +987,7 @@ fninit(Node *n)
|
||||
// (2)
|
||||
|
||||
maxarg = 0;
|
||||
stksize = 0;
|
||||
stksize = initstksize;
|
||||
|
||||
snprint(namebuf, sizeof(namebuf), "init_%s_function", filename);
|
||||
|
||||
|
@ -451,7 +451,8 @@ EXTERN Node* lastconst;
|
||||
EXTERN int32 vargen;
|
||||
EXTERN int32 exportgen;
|
||||
EXTERN int32 maxarg;
|
||||
EXTERN int32 stksize;
|
||||
EXTERN int32 stksize; // stack size for current frame
|
||||
EXTERN int32 initstksize; // stack size for init function
|
||||
EXTERN ushort blockgen; // max block number
|
||||
EXTERN ushort block; // current block number
|
||||
|
||||
|
@ -178,7 +178,11 @@ hidden_import_list:
|
||||
* declarations
|
||||
*/
|
||||
xdcl:
|
||||
common_dcl
|
||||
{ stksize = initstksize; } common_dcl
|
||||
{
|
||||
$$ = $2;
|
||||
initstksize = stksize;
|
||||
}
|
||||
| xfndcl
|
||||
{
|
||||
$$ = N;
|
||||
@ -187,10 +191,11 @@ xdcl:
|
||||
{
|
||||
$$ = N;
|
||||
}
|
||||
| LEXPORT { exportadj = 1; } common_dcl
|
||||
| LEXPORT { exportadj = 1; stksize = initstksize; } common_dcl
|
||||
{
|
||||
$$ = $3;
|
||||
exportadj = 0;
|
||||
initstksize = stksize;
|
||||
}
|
||||
| LEXPORT '(' export_list_r ')'
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user