void splitclean(void);
Node* ncon(uint32 i);
void gtrack(Sym*);
+void gargsize(int32);
/*
* obj.c
void
ginscall(Node *f, int proc)
{
+ int32 arg;
Prog *p;
Node n1, r, r1, con;
+ if(f->type != T)
+ setmaxarg(f->type);
+
+ arg = -1;
+ if(f->type != T && ((f->sym != S && f->sym->pkg == runtimepkg) || proc == 1 || proc == 2)) {
+ arg = f->type->argwid;
+ if(proc == 1 || proc == 2)
+ arg += 3*widthptr;
+ }
+
+ if(arg != -1)
+ gargsize(arg);
+
switch(proc) {
default:
fatal("ginscall: bad proc %d", proc);
}
break;
}
+
+ if(arg != -1)
+ gargsize(-1);
}
/*
p->from.type = D_CONST; // REG = &(20+offset(REG)) -- i.tab->fun[f]
}
- // BOTCH nodr.type = fntype;
nodr.type = n->left->type;
ginscall(&nodr, proc);
regfree(&nodr);
regfree(&nodo);
-
- setmaxarg(n->left->type);
}
/*
genlist(n->list); // assign the args
t = n->left->type;
- setmaxarg(t);
-
// call tempname pointer
if(n->left->ullman >= UINF) {
regalloc(&nod, types[tptr], N);
#include <u.h>
#include <libc.h>
#include "gg.h"
+#include "../../pkg/runtime/funcdata.h"
// TODO(rsc): Can make this bigger if we move
// the text segment up higher in 5l for all GOOS.
p->reg |= NOPTR;
}
+void
+gargsize(int32 size)
+{
+ Node n1, n2;
+
+ nodconst(&n1, types[TINT32], PCDATA_ArgSize);
+ nodconst(&n2, types[TINT32], size);
+ gins(APCDATA, &n1, &n2);
+}
+
void
ggloblsym(Sym *s, int32 width, int dupok, int rodata)
{
case ALOCALS: /* funny */
case ANPTRS:
case APTRS:
+ case APCDATA:
return 0;
}
}
void afunclit(Addr*, Node*);
void nodfconst(Node*, Type*, Mpflt*);
void gtrack(Sym*);
+void gargsize(vlong);
/*
* cplx.c
void
ginscall(Node *f, int proc)
{
+ int32 arg;
Prog *p;
Node reg, con;
Node r1;
+ if(f->type != T)
+ setmaxarg(f->type);
+
+ arg = -1;
+ if(f->type != T && ((f->sym != S && f->sym->pkg == runtimepkg) || proc == 1 || proc == 2)) {
+ arg = f->type->argwid;
+ if(proc == 1 || proc == 2)
+ arg += 2*widthptr;
+ }
+
+ if(arg != -1)
+ gargsize(arg);
+
switch(proc) {
default:
fatal("ginscall: bad proc %d", proc);
}
break;
}
+
+ if(arg != -1)
+ gargsize(-1);
}
/*
gins(ALEAQ, &nodo, &nodr); // REG = &(32+offset(REG)) -- i.tab->fun[f]
}
- // BOTCH nodr.type = fntype;
nodr.type = n->left->type;
ginscall(&nodr, proc);
regfree(&nodr);
regfree(&nodo);
-
- setmaxarg(n->left->type);
}
/*
genlist(n->list); // assign the args
t = n->left->type;
- setmaxarg(t);
-
// call tempname pointer
if(n->left->ullman >= UINF) {
regalloc(&nod, types[tptr], N);
#include <u.h>
#include <libc.h>
#include "gg.h"
+#include "../../pkg/runtime/funcdata.h"
// TODO(rsc): Can make this bigger if we move
// the text segment up higher in 6l for all GOOS.
p->from.sym = s;
}
+void
+gargsize(vlong size)
+{
+ Node n1, n2;
+
+ nodconst(&n1, types[TINT32], PCDATA_ArgSize);
+ nodconst(&n2, types[TINT32], size);
+ gins(APCDATA, &n1, &n2);
+}
+
void
ggloblsym(Sym *s, int32 width, int dupok, int rodata)
{
void splitclean(void);
void nswap(Node*, Node*);
void gtrack(Sym*);
-
+void gargsize(int32);
/*
* cplx.c
*/
void
ginscall(Node *f, int proc)
{
+ int32 arg;
Prog *p;
Node reg, r1, con;
+ if(f->type != T)
+ setmaxarg(f->type);
+
+ arg = -1;
+ if(f->type != T && ((f->sym != S && f->sym->pkg == runtimepkg) || proc == 1 || proc == 2)) {
+ arg = f->type->argwid;
+ if(proc == 1 || proc == 2)
+ arg += 2*widthptr;
+ }
+
+ if(arg != -1)
+ gargsize(arg);
+
switch(proc) {
default:
fatal("ginscall: bad proc %d", proc);
}
break;
}
+
+ if(arg != -1)
+ gargsize(-1);
}
/*
gins(ALEAL, &nodo, &nodr); // REG = &(20+offset(REG)) -- i.tab->fun[f]
}
- // BOTCH nodr.type = fntype;
nodr.type = n->left->type;
ginscall(&nodr, proc);
regfree(&nodr);
regfree(&nodo);
-
- setmaxarg(n->left->type);
}
/*
genlist(n->list); // assign the args
t = n->left->type;
- setmaxarg(t);
-
// call tempname pointer
if(n->left->ullman >= UINF) {
regalloc(&nod, types[tptr], N);
#include <u.h>
#include <libc.h>
#include "gg.h"
+#include "../../pkg/runtime/funcdata.h"
// TODO(rsc): Can make this bigger if we move
// the text segment up higher in 8l for all GOOS.
p->from.scale |= NOPTR;
}
+void
+gargsize(int32 size)
+{
+ Node n1, n2;
+
+ nodconst(&n1, types[TINT32], PCDATA_ArgSize);
+ nodconst(&n2, types[TINT32], size);
+ gins(APCDATA, &n1, &n2);
+}
+
void
ggloblsym(Sym *s, int32 width, int dupok, int rodata)
{