summaryrefslogtreecommitdiff
path: root/src/cmd/5g/ggen.c
diff options
context:
space:
mode:
authorTianon Gravi <admwiggin@gmail.com>2015-01-15 12:50:40 -0700
committerTianon Gravi <admwiggin@gmail.com>2015-01-15 12:50:40 -0700
commit2a0db60599fdd75b1bc3e297180fbe1282763759 (patch)
tree68d43c3e30d9ab961ddf6b7365201ca6b675b253 /src/cmd/5g/ggen.c
parentef33cba3c8de6c431df56503df51fcd3a473c89e (diff)
parentf154da9e12608589e8d5f0508f908a0c3e88a1bb (diff)
downloadgolang-2a0db60599fdd75b1bc3e297180fbe1282763759.tar.gz
Merge tag 'upstream/1.4' into debian-experimental
* tag 'upstream/1.4': Imported Upstream version 1.4
Diffstat (limited to 'src/cmd/5g/ggen.c')
-rw-r--r--src/cmd/5g/ggen.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/cmd/5g/ggen.c b/src/cmd/5g/ggen.c
index fb32c2f36..53cddb760 100644
--- a/src/cmd/5g/ggen.c
+++ b/src/cmd/5g/ggen.c
@@ -76,7 +76,7 @@ zerorange(Prog *p, vlong frame, vlong lo, vlong hi, uint32 *r0)
if(cnt < 4*widthptr) {
for(i = 0; i < cnt; i += widthptr)
p = appendpp(p, AMOVW, D_REG, 0, 0, D_OREG, REGSP, 4+frame+lo+i);
- } else if(cnt <= 128*widthptr) {
+ } else if(!nacl && (cnt <= 128*widthptr)) {
p = appendpp(p, AADD, D_CONST, NREG, 4+frame+lo, D_REG, 1, 0);
p->reg = REGSP;
p = appendpp(p, ADUFFZERO, D_NONE, NREG, 0, D_OREG, NREG, 0);
@@ -179,28 +179,12 @@ fixautoused(Prog* p)
void
ginscall(Node *f, int proc)
{
- int32 arg;
Prog *p;
Node n1, r, r1, con;
if(f->type != T)
setmaxarg(f->type);
- arg = -1;
- // Most functions have a fixed-size argument block, so traceback uses that during unwind.
- // Not all, though: there are some variadic functions in package runtime,
- // and for those we emit call-specific metadata recorded by caller.
- // Reflect generates functions with variable argsize (see reflect.methodValueCall/makeFuncStub),
- // so we do this for all indirect calls as well.
- if(f->type != T && (f->sym == S || (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);
@@ -297,9 +281,6 @@ ginscall(Node *f, int proc)
}
break;
}
-
- if(arg != -1)
- gargsize(-1);
}
/*
@@ -906,11 +887,11 @@ clearfat(Node *nl)
patch(gbranch(ABNE, T, 0), pl);
regfree(&end);
- } else if(q >= 4) {
+ } else if(q >= 4 && !nacl) {
f = sysfunc("duffzero");
p = gins(ADUFFZERO, N, f);
afunclit(&p->to, f);
- // 4 and 128 = magic constants: see ../../pkg/runtime/asm_arm.s
+ // 4 and 128 = magic constants: see ../../runtime/asm_arm.s
p->to.offset = 4*(128-q);
} else
while(q > 0) {