diff options
Diffstat (limited to 'src/cmd/5g/ggen.c')
-rw-r--r-- | src/cmd/5g/ggen.c | 25 |
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) { |