// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-
#include "gc.h"
+#include "../../pkg/runtime/funcdata.h"
void
_cgen(Node *n, Node *nn, int inrel)
if(REGARG >= 0)
o = reg[REGARG];
gargs(r, &nod, &nod1);
+ gpcdata(PCDATA_ArgSize, curarg);
if(l->addable < INDEXED) {
reglcgen(&nod, l, Z);
gopcode(OFUNC, Z, Z, &nod);
regfree(&nod);
} else
gopcode(OFUNC, Z, Z, l);
+ gpcdata(PCDATA_ArgSize, -1);
if(REGARG >= 0)
if(o != reg[REGARG])
reg[REGARG]--;
int sval(int32);
void gpseudo(int, Sym*, Node*);
void gprefetch(Node*);
+void gpcdata(int, int);
/*
* swt.c
int32 a;
a = 0;
- if(!(textflag & NOSPLIT))
+ if(!(textflag & NOSPLIT) || !hasdotdotdot()) {
a = argsize();
+ // Change argsize 0 to 1 to be mark that
+ // the argument size is present.
+ if(a == 0)
+ a = 1;
+ }
else if(stkoff >= 128)
yyerror("stack frame too large for NOSPLIT function");
pc--;
}
+void
+gpcdata(int index, int value)
+{
+ Node n1;
+
+ n1 = *nodconst(index);
+ gins(APCDATA, &n1, nodconst(value));
+}
+
void
gprefetch(Node *n)
{
// THE SOFTWARE.
#include "gc.h"
+#include "../../pkg/runtime/funcdata.h"
/* ,x/^(print|prtree)\(/i/\/\/ */
int castup(Type*, Type*);
return;
}
gargs(r, &nod, &nod1);
+ gpcdata(PCDATA_ArgSize, curarg);
if(l->addable < INDEXED) {
reglcgen(&nod, l, nn);
nod.op = OREGISTER;
regfree(&nod);
} else
gopcode(OFUNC, n->type, Z, l);
+ gpcdata(PCDATA_ArgSize, -1);
if(REGARG >= 0 && reg[REGARG])
reg[REGARG]--;
if(nn != Z) {
int sconst(Node*);
void gpseudo(int, Sym*, Node*);
void gprefetch(Node*);
+void gpcdata(int, int);
/*
* swt.c
// THE SOFTWARE.
#include "gc.h"
+#include "../../pkg/runtime/funcdata.h"
Prog*
gtext(Sym *s, int32 stkoff)
{
vlong v;
-
+
v = 0;
- if(!(textflag & NOSPLIT))
- v |= argsize() << 32;
+ if(!(textflag & NOSPLIT) || !hasdotdotdot()) {
+ v = argsize();
+ // Change argsize 0 to 1 to be mark that
+ // the argument size is present.
+ if(v == 0)
+ v = 1;
+ v <<= 32;
+ }
v |= stkoff & 0xffffffff;
if((textflag & NOSPLIT) && stkoff >= 128)
yyerror("stack frame too large for NOSPLIT function");
pc--;
}
+void
+gpcdata(int index, int value)
+{
+ Node n1;
+
+ n1 = *nodconst(index);
+ gins(APCDATA, &n1, nodconst(value));
+}
+
void
gprefetch(Node *n)
{
// THE SOFTWARE.
#include "gc.h"
+#include "../../pkg/runtime/funcdata.h"
/* ,x/^(print|prtree)\(/i/\/\/ */
return;
}
gargs(r, &nod, &nod1);
+ gpcdata(PCDATA_ArgSize, curarg);
if(l->addable < INDEXED) {
reglcgen(&nod, l, nn);
nod.op = OREGISTER;
regfree(&nod);
} else
gopcode(OFUNC, n->type, Z, l);
+ gpcdata(PCDATA_ArgSize, -1);
if(REGARG >= 0 && reg[REGARG])
reg[REGARG]--;
if(nn != Z) {
int sconst(Node*);
void gpseudo(int, Sym*, Node*);
void gprefetch(Node*);
+void gpcdata(int, int);
/*
* swt.c
gtext(Sym *s, int32 stkoff)
{
int32 a;
-
+
a = 0;
- if(!(textflag & NOSPLIT))
+ if(!(textflag & NOSPLIT) || !hasdotdotdot()) {
a = argsize();
+ // Change argsize 0 to 1 to be mark that
+ // the argument size is present.
+ if(a == 0)
+ a = 1;
+ }
else if(stkoff >= 128)
yyerror("stack frame too large for NOSPLIT function");
pc--;
}
+void
+gpcdata(int index, int value)
+{
+ Node n1;
+
+ n1 = *nodconst(index);
+ gins(APCDATA, &n1, nodconst(value));
+}
+
void
gprefetch(Node *n)
{
int32 exreg(Type*);
int32 align(int32, Type*, int, int32*);
int32 maxround(int32, int32);
+int hasdotdotdot(void);
extern schar ewidth[];
#include "gc.h"
+int
+hasdotdotdot(void)
+{
+ Type *t;
+
+ for(t=thisfn->down; t!=T; t=t->down)
+ if(t->etype == TDOT)
+ return 1;
+ return 0;
+}
+
vlong
argsize(void)
{