diff options
Diffstat (limited to 'src/cmd/gc')
33 files changed, 2854 insertions, 2225 deletions
diff --git a/src/cmd/gc/align.c b/src/cmd/gc/align.c index b809640e4..6e5d149c7 100644 --- a/src/cmd/gc/align.c +++ b/src/cmd/gc/align.c @@ -119,8 +119,10 @@ dowidth(Type *t) if(t->width == -2) { lno = lineno; lineno = t->lineno; - if(!t->broke) + if(!t->broke) { + t->broke = 1; yyerror("invalid recursive type %T", t); + } t->width = 0; lineno = lno; return; diff --git a/src/cmd/gc/bisonerrors b/src/cmd/gc/bisonerrors index 1f97fc8ce..fa74c67c3 100755 --- a/src/cmd/gc/bisonerrors +++ b/src/cmd/gc/bisonerrors @@ -22,6 +22,7 @@ BEGIN{ bison = 1 grammar = 0 states = 0 + open = 0 } # In Grammar section of y.output, @@ -130,11 +131,26 @@ $1 == "%" { continue # No shift or reduce applied - found the error. - printf("\t%s, %s,\n", state, tok); + printf("\t{%s, %s,\n", state, tok); + open = 1; break } next } # Print other lines verbatim. +open && /,$/ { + s = $0; + sub(",", "},", s) + print s + open = 0 + next +} + +open && /"$/ { + print $0 "}" + open = 0 + next +} + {print} diff --git a/src/cmd/gc/builtin.c b/src/cmd/gc/builtin.c index 5ca5aeb77..fbca4ee5f 100644 --- a/src/cmd/gc/builtin.c +++ b/src/cmd/gc/builtin.c @@ -2,18 +2,19 @@ char *runtimeimport = "package runtime\n" "import runtime \"runtime\"\n" - "func @\"\".new (@\"\".typ·2 *byte) (? *any)\n" + "func @\"\".newobject (@\"\".typ·2 *byte) (? *any)\n" "func @\"\".panicindex ()\n" "func @\"\".panicslice ()\n" "func @\"\".panicdivide ()\n" "func @\"\".throwreturn ()\n" "func @\"\".throwinit ()\n" "func @\"\".panicwrap (? string, ? string, ? string)\n" - "func @\"\".panic (? interface {})\n" - "func @\"\".recover (? *int32) (? interface {})\n" + "func @\"\".gopanic (? interface {})\n" + "func @\"\".gorecover (? *int32) (? interface {})\n" "func @\"\".printbool (? bool)\n" "func @\"\".printfloat (? float64)\n" "func @\"\".printint (? int64)\n" + "func @\"\".printhex (? uint64)\n" "func @\"\".printuint (? uint64)\n" "func @\"\".printcomplex (? complex128)\n" "func @\"\".printstring (? string)\n" @@ -23,7 +24,6 @@ char *runtimeimport = "func @\"\".printslice (? any)\n" "func @\"\".printnl ()\n" "func @\"\".printsp ()\n" - "func @\"\".goprintf ()\n" "func @\"\".concatstring2 (? string, ? string) (? string)\n" "func @\"\".concatstring3 (? string, ? string, ? string) (? string)\n" "func @\"\".concatstring4 (? string, ? string, ? string, ? string) (? string)\n" @@ -39,7 +39,7 @@ char *runtimeimport = "func @\"\".stringtoslicerune (? string) (? []rune)\n" "func @\"\".stringiter (? string, ? int) (? int)\n" "func @\"\".stringiter2 (? string, ? int) (@\"\".retk·1 int, @\"\".retv·2 rune)\n" - "func @\"\".copy (@\"\".to·2 any, @\"\".fr·3 any, @\"\".wid·4 uintptr) (? int)\n" + "func @\"\".slicecopy (@\"\".to·2 any, @\"\".fr·3 any, @\"\".wid·4 uintptr) (? int)\n" "func @\"\".slicestringcopy (@\"\".to·2 any, @\"\".fr·3 any) (? int)\n" "func @\"\".typ2Itab (@\"\".typ·2 *byte, @\"\".typ2·3 *byte, @\"\".cache·4 **byte) (@\"\".ret·1 *byte)\n" "func @\"\".convI2E (@\"\".elem·2 any) (@\"\".ret·1 any)\n" @@ -64,7 +64,6 @@ char *runtimeimport = "func @\"\".efaceeq (@\"\".i1·2 any, @\"\".i2·3 any) (@\"\".ret·1 bool)\n" "func @\"\".ifacethash (@\"\".i1·2 any) (@\"\".ret·1 uint32)\n" "func @\"\".efacethash (@\"\".i1·2 any) (@\"\".ret·1 uint32)\n" - "func @\"\".equal (@\"\".typ·2 *byte, @\"\".x1·3 any, @\"\".x2·4 any) (@\"\".ret·1 bool)\n" "func @\"\".makemap (@\"\".mapType·2 *byte, @\"\".hint·3 int64) (@\"\".hmap·1 map[any]any)\n" "func @\"\".mapaccess1 (@\"\".mapType·2 *byte, @\"\".hmap·3 map[any]any, @\"\".key·4 *any) (@\"\".val·1 *any)\n" "func @\"\".mapaccess1_fast32 (@\"\".mapType·2 *byte, @\"\".hmap·3 map[any]any, @\"\".key·4 any) (@\"\".val·1 *any)\n" @@ -83,10 +82,18 @@ char *runtimeimport = "func @\"\".chanrecv2 (@\"\".chanType·2 *byte, @\"\".hchan·3 <-chan any, @\"\".elem·4 *any) (? bool)\n" "func @\"\".chansend1 (@\"\".chanType·1 *byte, @\"\".hchan·2 chan<- any, @\"\".elem·3 *any)\n" "func @\"\".closechan (@\"\".hchan·1 any)\n" + "func @\"\".writebarrierptr (@\"\".dst·1 *any, @\"\".src·2 any)\n" + "func @\"\".writebarrierstring (@\"\".dst·1 *any, @\"\".src·2 any)\n" + "func @\"\".writebarrierslice (@\"\".dst·1 *any, @\"\".src·2 any)\n" + "func @\"\".writebarrieriface (@\"\".dst·1 *any, @\"\".src·2 any)\n" + "func @\"\".writebarrierfat2 (@\"\".dst·1 *any, _ *byte, @\"\".src·3 any)\n" + "func @\"\".writebarrierfat3 (@\"\".dst·1 *any, _ *byte, @\"\".src·3 any)\n" + "func @\"\".writebarrierfat4 (@\"\".dst·1 *any, _ *byte, @\"\".src·3 any)\n" + "func @\"\".writebarrierfat (@\"\".typ·1 *byte, @\"\".dst·2 *any, @\"\".src·3 *any)\n" "func @\"\".selectnbsend (@\"\".chanType·2 *byte, @\"\".hchan·3 chan<- any, @\"\".elem·4 *any) (? bool)\n" "func @\"\".selectnbrecv (@\"\".chanType·2 *byte, @\"\".elem·3 *any, @\"\".hchan·4 <-chan any) (? bool)\n" "func @\"\".selectnbrecv2 (@\"\".chanType·2 *byte, @\"\".elem·3 *any, @\"\".received·4 *bool, @\"\".hchan·5 <-chan any) (? bool)\n" - "func @\"\".newselect (@\"\".size·2 int32) (@\"\".sel·1 *byte)\n" + "func @\"\".newselect (@\"\".sel·1 *byte, @\"\".selsize·2 int64, @\"\".size·3 int32)\n" "func @\"\".selectsend (@\"\".sel·2 *byte, @\"\".hchan·3 chan<- any, @\"\".elem·4 *any) (@\"\".selected·1 bool)\n" "func @\"\".selectrecv (@\"\".sel·2 *byte, @\"\".hchan·3 <-chan any, @\"\".elem·4 *any) (@\"\".selected·1 bool)\n" "func @\"\".selectrecv2 (@\"\".sel·2 *byte, @\"\".hchan·3 <-chan any, @\"\".elem·4 *any, @\"\".received·5 *bool) (@\"\".selected·1 bool)\n" @@ -96,12 +103,12 @@ char *runtimeimport = "func @\"\".makeslice (@\"\".typ·2 *byte, @\"\".nel·3 int64, @\"\".cap·4 int64) (@\"\".ary·1 []any)\n" "func @\"\".growslice (@\"\".typ·2 *byte, @\"\".old·3 []any, @\"\".n·4 int64) (@\"\".ary·1 []any)\n" "func @\"\".memmove (@\"\".to·1 *any, @\"\".frm·2 *any, @\"\".length·3 uintptr)\n" - "func @\"\".memequal (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" - "func @\"\".memequal8 (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" - "func @\"\".memequal16 (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" - "func @\"\".memequal32 (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" - "func @\"\".memequal64 (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" - "func @\"\".memequal128 (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" + "func @\"\".memequal (@\"\".x·2 *any, @\"\".y·3 *any, @\"\".size·4 uintptr) (? bool)\n" + "func @\"\".memequal8 (@\"\".x·2 *any, @\"\".y·3 *any, @\"\".size·4 uintptr) (? bool)\n" + "func @\"\".memequal16 (@\"\".x·2 *any, @\"\".y·3 *any, @\"\".size·4 uintptr) (? bool)\n" + "func @\"\".memequal32 (@\"\".x·2 *any, @\"\".y·3 *any, @\"\".size·4 uintptr) (? bool)\n" + "func @\"\".memequal64 (@\"\".x·2 *any, @\"\".y·3 *any, @\"\".size·4 uintptr) (? bool)\n" + "func @\"\".memequal128 (@\"\".x·2 *any, @\"\".y·3 *any, @\"\".size·4 uintptr) (? bool)\n" "func @\"\".int64div (? int64, ? int64) (? int64)\n" "func @\"\".uint64div (? uint64, ? uint64) (? uint64)\n" "func @\"\".int64mod (? int64, ? int64) (? int64)\n" diff --git a/src/cmd/gc/bv.c b/src/cmd/gc/bv.c index 0e8f8d473..cfd1cd281 100644 --- a/src/cmd/gc/bv.c +++ b/src/cmd/gc/bv.c @@ -108,6 +108,9 @@ bvnext(Bvec *bv, int32 i) { uint32 w; + if(i >= bv->n) + return -1; + // Jump i ahead to next word with bits. if((bv->b[i>>WORDSHIFT]>>(i&WORDMASK)) == 0) { i &= ~WORDMASK; @@ -117,7 +120,7 @@ bvnext(Bvec *bv, int32 i) } if(i >= bv->n) return -1; - + // Find 1 bit. w = bv->b[i>>WORDSHIFT]>>(i&WORDMASK); while((w&1) == 0) { diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c index 143c1730d..e418b9c56 100644 --- a/src/cmd/gc/const.c +++ b/src/cmd/gc/const.c @@ -6,6 +6,7 @@ #include <libc.h> #include "go.h" #define TUP(x,y) (((x)<<16)|(y)) +/*c2go int TUP(int, int); */ static Val tocplx(Val); static Val toflt(Val); @@ -1565,7 +1566,6 @@ isgoconst(Node *n) case ORSH: case OSUB: case OXOR: - case OCONV: case OIOTA: case OCOMPLEX: case OREAL: @@ -1573,7 +1573,12 @@ isgoconst(Node *n) if(isgoconst(n->left) && (n->right == N || isgoconst(n->right))) return 1; break; - + + case OCONV: + if(okforconst[n->type->etype] && isgoconst(n->left)) + return 1; + break; + case OLEN: case OCAP: l = n->left; diff --git a/src/cmd/gc/dcl.c b/src/cmd/gc/dcl.c index 73c2581be..dfcf47520 100644 --- a/src/cmd/gc/dcl.c +++ b/src/cmd/gc/dcl.c @@ -488,6 +488,10 @@ colasdefn(NodeList *left, Node *defn) NodeList *l; Node *n; + for(l=left; l; l=l->next) + if(l->n->sym != S) + l->n->sym->flags |= SymUniq; + nnew = 0; nerr = 0; for(l=left; l; l=l->next) { @@ -499,6 +503,13 @@ colasdefn(NodeList *left, Node *defn) nerr++; continue; } + if((n->sym->flags & SymUniq) == 0) { + yyerrorl(defn->lineno, "%S repeated on left side of :=", n->sym); + n->diag++; + nerr++; + continue; + } + n->sym->flags &= ~SymUniq; if(n->sym->block == block) continue; @@ -547,6 +558,9 @@ ifacedcl(Node *n) if(n->op != ODCLFIELD || n->right == N) fatal("ifacedcl"); + if(isblank(n->left)) + yyerror("methods must have a unique non-blank name"); + dclcontext = PPARAM; markdcl(); funcdepth++; diff --git a/src/cmd/gc/esc.c b/src/cmd/gc/esc.c index 78624d7cb..324f24fcf 100644 --- a/src/cmd/gc/esc.c +++ b/src/cmd/gc/esc.c @@ -495,7 +495,7 @@ esc(EscState *e, Node *n, Node *up) case ORANGE: // Everything but fixed array is a dereference. - if(isfixedarray(n->type) && n->list->next) + if(isfixedarray(n->type) && n->list && n->list->next) escassign(e, n->list->next->n, n->right); break; @@ -1110,6 +1110,7 @@ escflood(EscState *e, Node *dst) // pass all the tests we have written so far, which we assume matches // the level of complexity we want the escape analysis code to handle. #define MinLevel (-2) +/*c2go enum { MinLevel = -2 };*/ static void escwalk(EscState *e, int level, Node *dst, Node *src) diff --git a/src/cmd/gc/fmt.c b/src/cmd/gc/fmt.c index b5f8a834f..89d2a1404 100644 --- a/src/cmd/gc/fmt.c +++ b/src/cmd/gc/fmt.c @@ -649,7 +649,7 @@ typefmt(Fmt *fp, Type *t) if(t->funarg) { fmtstrcpy(fp, "("); - if(fmtmode == FTypeId || fmtmode == FErr) { // no argument names on function signature, and no "noescape" tags + if(fmtmode == FTypeId || fmtmode == FErr) { // no argument names on function signature, and no "noescape"/"nosplit" tags for(t1=t->type; t1!=T; t1=t1->down) if(t1->down) fmtprint(fp, "%hT, ", t1); @@ -810,6 +810,13 @@ stmtfmt(Fmt *f, Node *n) break; case OASOP: + if(n->implicit) { + if(n->etype == OADD) + fmtprint(f, "%N++", n->left); + else + fmtprint(f, "%N--", n->left); + break; + } fmtprint(f, "%N %#O= %N", n->left, n->etype, n->right); break; @@ -880,7 +887,11 @@ stmtfmt(Fmt *f, Node *n) fmtstrcpy(f, "for loop"); break; } - + + if(n->list == nil) { + fmtprint(f, "for range %N { %H }", n->right, n->nbody); + break; + } fmtprint(f, "for %,H = range %N { %H }", n->list, n->right, n->nbody); break; @@ -974,7 +985,6 @@ static int opprec[] = { [OTFUNC] = 8, [OTINTER] = 8, [OTMAP] = 8, - [OTPAREN] = 8, [OTSTRUCT] = 8, [OINDEXMAP] = 8, @@ -1105,16 +1115,11 @@ exprfmt(Fmt *f, Node *n, int prec) case ONAME: // Special case: name used as local variable in export. - switch(n->class&~PHEAP){ - case PAUTO: - case PPARAM: - case PPARAMOUT: - // _ becomes ~b%d internally; print as _ for export - if(fmtmode == FExp && n->sym && n->sym->name[0] == '~' && n->sym->name[1] == 'b') - return fmtprint(f, "_"); - if(fmtmode == FExp && n->sym && !isblank(n) && n->vargen > 0) - return fmtprint(f, "%S·%d", n->sym, n->vargen); - } + // _ becomes ~b%d internally; print as _ for export + if(fmtmode == FExp && n->sym && n->sym->name[0] == '~' && n->sym->name[1] == 'b') + return fmtprint(f, "_"); + if(fmtmode == FExp && n->sym && !isblank(n) && n->vargen > 0) + return fmtprint(f, "%S·%d", n->sym, n->vargen); // Special case: explicit name of func (*T) method(...) is turned into pkg.(*T).method, // but for export, this should be rendered as (*pkg.T).meth. @@ -1140,9 +1145,6 @@ exprfmt(Fmt *f, Node *n, int prec) return fmtprint(f, "[]%N", n->left); return fmtprint(f, "[]%N", n->right); // happens before typecheck - case OTPAREN: - return fmtprint(f, "(%N)", n->left); - case OTMAP: return fmtprint(f, "map[%N]%N", n->left, n->right); @@ -1153,7 +1155,7 @@ exprfmt(Fmt *f, Node *n, int prec) case Csend: return fmtprint(f, "chan<- %N", n->left); default: - if(n->left != N && n->left->op == TCHAN && n->left->sym == S && n->left->etype == Crecv) + if(n->left != N && n->left->op == OTCHAN && n->left->sym == S && n->left->etype == Crecv) return fmtprint(f, "chan (%N)", n->left); else return fmtprint(f, "chan %N", n->left); diff --git a/src/cmd/gc/gen.c b/src/cmd/gc/gen.c index cf630f348..c7c9fcdaf 100644 --- a/src/cmd/gc/gen.c +++ b/src/cmd/gc/gen.c @@ -54,9 +54,6 @@ addrescapes(Node *n) if(n->class == PAUTO && n->esc == EscNever) break; - if(debug['N'] && n->esc != EscUnknown) - fatal("without escape analysis, only PAUTO's should have esc: %N", n); - switch(n->class) { case PPARAMREF: addrescapes(n->defn); @@ -91,8 +88,7 @@ addrescapes(Node *n) snprint(buf, sizeof buf, "&%S", n->sym); n->heapaddr->sym = lookup(buf); n->heapaddr->orig->sym = n->heapaddr->sym; - if(!debug['N']) - n->esc = EscHeap; + n->esc = EscHeap; if(debug['m']) print("%L: moved to heap: %N\n", n->lineno, n); curfn = oldfn; @@ -584,6 +580,8 @@ cgen_dcl(Node *n) } if(!(n->class & PHEAP)) return; + if(compiling_runtime) + yyerror("%N escapes to heap, not allowed in runtime.", n); if(n->alloc == nil) n->alloc = callnew(n->type); cgen_as(n->heapaddr, n->alloc); @@ -733,14 +731,10 @@ cgen_as(Node *nl, Node *nr) return; } - if(nr == N || isnil(nr)) { - // externals and heaps should already be clear - if(nr == N) { - if(nl->class == PEXTERN) - return; - if(nl->class & PHEAP) - return; - } + if(nr == N || iszero(nr)) { + // heaps should already be clear + if(nr == N && (nl->class & PHEAP)) + return; tl = nl->type; if(tl == T) @@ -804,7 +798,8 @@ cgen_eface(Node *n, Node *res) void cgen_slice(Node *n, Node *res) { - Node src, dst, *cap, *len, *offs, *add, *base; + Node src, dst, *cap, *len, *offs, *add, *base, *tmpcap, *tmplen, *cmp, con; + Prog *p1, *p2; cap = n->list->n; len = n->list->next->n; @@ -821,6 +816,11 @@ cgen_slice(Node *n, Node *res) // garbage collector can see. base = temp(types[TUINTPTR]); + tmplen = temp(types[TINT]); + if(n->op != OSLICESTR) + tmpcap = temp(types[TINT]); + else + tmpcap = tmplen; if(isnil(n->left)) { tempname(&src, n->left->type); @@ -835,43 +835,62 @@ cgen_slice(Node *n, Node *res) fatal("slicearr is supposed to work on pointer: %+N\n", n); cgen(&src, base); cgen_checknil(base); - if(offs != N) { - add = nod(OADD, base, offs); - typecheck(&add, Erv); - cgen(add, base); - } - } else if(offs == N) { - src.type = types[tptr]; - cgen(&src, base); } else { src.type = types[tptr]; - add = nod(OADDPTR, &src, offs); - typecheck(&add, Erv); - cgen(add, base); + cgen(&src, base); } // committed to the update gvardef(res); + // compute len and cap. + // len = n-i, cap = m-i, and offs = i*width. + // computing offs last lets the multiply overwrite i. + cgen(len, tmplen); + if(n->op != OSLICESTR) + cgen(cap, tmpcap); + + // if new cap != 0 { base += add } + // This avoids advancing base past the end of the underlying array/string, + // so that it cannot point at the next object in memory. + // If cap == 0, the base doesn't matter except insofar as it is 0 or non-zero. + // In essence we are replacing x[i:j:k] where i == j == k + // or x[i:j] where i == j == cap(x) with x[0:0:0]. + if(offs != N) { + p1 = gjmp(P); + p2 = gjmp(P); + patch(p1, pc); + + nodconst(&con, tmpcap->type, 0); + cmp = nod(OEQ, tmpcap, &con); + typecheck(&cmp, Erv); + bgen(cmp, 1, -1, p2); + + add = nod(OADD, base, offs); + typecheck(&add, Erv); + cgen(add, base); + + patch(p2, pc); + } + // dst.array = src.array [ + lo *width ] dst = *res; dst.xoffset += Array_array; dst.type = types[tptr]; - cgen(base, &dst); // dst.len = hi [ - lo ] dst = *res; dst.xoffset += Array_nel; dst.type = types[simtype[TUINT]]; - cgen(len, &dst); + cgen(tmplen, &dst); if(n->op != OSLICESTR) { // dst.cap = cap [ - lo ] dst = *res; dst.xoffset += Array_cap; dst.type = types[simtype[TUINT]]; - cgen(cap, &dst); + cgen(tmpcap, &dst); } } diff --git a/src/cmd/gc/go.h b/src/cmd/gc/go.h index ee879f67f..965a0550d 100644 --- a/src/cmd/gc/go.h +++ b/src/cmd/gc/go.h @@ -269,6 +269,7 @@ struct Node uchar colas; // OAS resulting from := uchar diag; // already printed error about this uchar noescape; // func arguments do not escape + uchar nosplit; // func should not execute on separate stack uchar builtin; // built-in name, like len or close uchar walkdef; uchar typecheck; @@ -282,6 +283,7 @@ struct Node uchar addrtaken; // address taken, even if not moved to heap uchar dupok; // duplicate definitions ok (for func) uchar wrapper; // is method wrapper (for func) + uchar reslice; // this is a reslice x = x[0:y] or x = append(x, ...) schar likely; // likeliness of if statement uchar hasbreak; // has break statement uchar needzero; // if it contains pointers, needs to be zeroed on function entry @@ -380,7 +382,6 @@ enum SymExported = 1<<2, // already written out by export SymUniq = 1<<3, SymSiggen = 1<<4, - SymGcgen = 1<<5, }; struct Sym @@ -447,7 +448,6 @@ enum OSUB, // x - y OOR, // x | y OXOR, // x ^ y - OADDPTR, // ptr + uintptr, inserted by compiler only, used to avoid unsafe type changes during codegen OADDSTR, // s + "foo" OADDR, // &x OANDAND, // b0 && b1 @@ -573,7 +573,6 @@ enum OTINTER, // interface{} OTFUNC, // func() OTARRAY, // []int, [8]int, [N]int or [...]int - OTPAREN, // (T) // misc ODDD, // func f(args ...int) or f(l...) or var a = [...]int{0, 1, 2}. @@ -975,11 +974,13 @@ EXTERN int funcdepth; EXTERN int typecheckok; EXTERN int compiling_runtime; EXTERN int compiling_wrappers; +EXTERN int use_writebarrier; EXTERN int pure_go; EXTERN char* flag_installsuffix; EXTERN int flag_race; EXTERN int flag_largemodel; EXTERN int noescape; +EXTERN int nosplit; EXTERN int debuglive; EXTERN Link* ctxt; @@ -1169,6 +1170,7 @@ void cgen_callmeth(Node *n, int proc); void cgen_eface(Node* n, Node* res); void cgen_slice(Node* n, Node* res); void clearlabels(void); +void clearslim(Node*); void checklabels(void); int dotoffset(Node *n, int64 *oary, Node **nn); void gen(Node *n); @@ -1284,6 +1286,7 @@ LSym* linksym(Sym*); * order.c */ void order(Node *fn); +void orderstmtinplace(Node **stmt); /* * range.c @@ -1302,7 +1305,6 @@ Sym* typenamesym(Type *t); Sym* tracksym(Type *t); Sym* typesymprefix(char *prefix, Type *t); int haspointers(Type *t); -void usefield(Node*); Type* hiter(Type* t); /* @@ -1364,6 +1366,7 @@ int is64(Type *t); int isbadimport(Strlit *s); int isblank(Node *n); int isblanksym(Sym *s); +int isdirectiface(Type*); int isfixedarray(Type *t); int isideal(Type *t); int isinter(Type *t); @@ -1372,6 +1375,7 @@ int isnilinter(Type *t); int isptrto(Type *t, int et); int isslice(Type *t); int istype(Type *t, int et); +int iszero(Node *n); void linehist(char *file, int32 off, int relative); NodeList* list(NodeList *l, Node *n); NodeList* list1(Node *n); @@ -1464,7 +1468,9 @@ void walkstmt(Node **np); void walkstmtlist(NodeList *l); Node* conv(Node*, Type*); int candiscard(Node*); +int needwritebarrier(Node*, Node*); Node* outervalue(Node*); +void usefield(Node*); /* * arch-specific ggen.c/gsubr.c/gobj.c/pgen.c/plive.c @@ -1505,7 +1511,7 @@ void gdata(Node*, Node*, int); void gdatacomplex(Node*, Mpcplx*); void gdatastring(Node*, Strlit*); void ggloblnod(Node *nam); -void ggloblsym(Sym *s, int32 width, int dupok, int rodata); +void ggloblsym(Sym *s, int32 width, int8 flags); void gvardef(Node*); void gvarkill(Node*); Prog* gjmp(Prog*); @@ -1514,6 +1520,7 @@ void movelarge(NodeList*); int isfat(Type*); void linkarchinit(void); void liveness(Node*, Prog*, Sym*, Sym*); +void twobitwalktype1(Type*, vlong*, Bvec*); void markautoused(Prog*); Plist* newplist(void); Node* nodarg(Type*, int); diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y index 2f354f723..68fccc1ad 100644 --- a/src/cmd/gc/go.y +++ b/src/cmd/gc/go.y @@ -460,11 +460,13 @@ simple_stmt: | expr LINC { $$ = nod(OASOP, $1, nodintconst(1)); + $$->implicit = 1; $$->etype = OADD; } | expr LDEC { $$ = nod(OASOP, $1, nodintconst(1)); + $$->implicit = 1; $$->etype = OSUB; } @@ -613,6 +615,11 @@ range_stmt: $$->colas = 1; colasdefn($1, $$); } +| LRANGE expr + { + $$ = nod(ORANGE, N, $2); + $$->etype = 0; // := flag + } for_header: osimple_stmt ';' osimple_stmt ';' osimple_stmt @@ -1180,7 +1187,7 @@ ntype: | dotname | '(' ntype ')' { - $$ = nod(OTPAREN, $2, N); + $$ = $2; } non_expr_type: @@ -1199,7 +1206,7 @@ non_recvchantype: | dotname | '(' ntype ')' { - $$ = nod(OTPAREN, $2, N); + $$ = $2; } convtype: @@ -1311,6 +1318,7 @@ xfndcl: $$->nbody = $3; $$->endlineno = lineno; $$->noescape = noescape; + $$->nosplit = nosplit; funcbody($$); } @@ -1365,8 +1373,6 @@ fndcl: yyerror("bad receiver in method"); break; } - if(rcvr->right->op == OTPAREN || (rcvr->right->op == OIND && rcvr->right->left->op == OTPAREN)) - yyerror("cannot parenthesize receiver type"); t = nod(OTFUNC, rcvr, N); t->list = $6; @@ -1495,6 +1501,7 @@ xdcl_list: testdclstack(); nointerface = 0; noescape = 0; + nosplit = 0; } vardcl_list: diff --git a/src/cmd/gc/lex.c b/src/cmd/gc/lex.c index a50101c42..523ba37aa 100644 --- a/src/cmd/gc/lex.c +++ b/src/cmd/gc/lex.c @@ -45,7 +45,7 @@ static struct { }; // Debug arguments. -// These can be specified with the -d flag, as in "-d checknil" +// These can be specified with the -d flag, as in "-d nil" // to set the debug_checknil variable. In general the list passed // to -d can be comma-separated. static struct { @@ -139,6 +139,8 @@ yy_isalnum(int c) #define isalnum use_yy_isalnum_instead_of_isalnum #define DBG if(!debug['x']){}else print +/*c2go void DBG(char*, ...); */ + enum { EOF = -1, @@ -310,6 +312,8 @@ main(int argc, char *argv[]) flagcount("u", "reject unsafe code", &safemode); flagcount("v", "increase debug verbosity", &debug['v']); flagcount("w", "debug type checking", &debug['w']); + use_writebarrier = 1; + flagcount("wb", "enable write barrier", &use_writebarrier); flagcount("x", "debug lexer", &debug['x']); flagcount("y", "debug declarations in canned imports (with -d)", &debug['y']); if(thechar == '6') @@ -317,6 +321,7 @@ main(int argc, char *argv[]) flagparse(&argc, &argv, usage); ctxt->debugasm = debug['S']; + ctxt->debugvlog = debug['v']; if(argc < 1) usage(); @@ -339,8 +344,8 @@ main(int argc, char *argv[]) break; } } - if(j == nelem(debugtab)) - fatal("unknown debug information -d '%s'\n", f[i]); + if(debugtab[j].name == nil) + sysfatal("unknown debug information -d '%s'\n", f[i]); } } @@ -476,8 +481,12 @@ main(int argc, char *argv[]) } // Phase 5: Escape analysis. - if(!debug['N']) - escapes(xtop); + // Required for moving heap allocations onto stack, + // which in turn is required by the closure implementation, + // which stores the addresses of stack variables into the closure. + // If the closure does not escape, it needs to be on the stack + // or else the stack copier will not update it. + escapes(xtop); // Escape analysis moved escaped values off stack. // Move large values off stack too. @@ -516,24 +525,18 @@ saveerrors(void) nerrors = 0; } -/* - * macro to portably read/write archive header. - * 'cmd' is read/write/Bread/Bwrite, etc. - */ -#define HEADER_IO(cmd, f, h) cmd(f, h.name, sizeof(h.name)) != sizeof(h.name)\ - || cmd(f, h.date, sizeof(h.date)) != sizeof(h.date)\ - || cmd(f, h.uid, sizeof(h.uid)) != sizeof(h.uid)\ - || cmd(f, h.gid, sizeof(h.gid)) != sizeof(h.gid)\ - || cmd(f, h.mode, sizeof(h.mode)) != sizeof(h.mode)\ - || cmd(f, h.size, sizeof(h.size)) != sizeof(h.size)\ - || cmd(f, h.fmag, sizeof(h.fmag)) != sizeof(h.fmag) - static int arsize(Biobuf *b, char *name) { struct ar_hdr a; - if (HEADER_IO(Bread, b, a)) + if(Bread(b, a.name, sizeof(a.name)) != sizeof(a.name) || + Bread(b, a.date, sizeof(a.date)) != sizeof(a.date) || + Bread(b, a.uid, sizeof(a.uid)) != sizeof(a.uid) || + Bread(b, a.gid, sizeof(a.gid)) != sizeof(a.gid) || + Bread(b, a.mode, sizeof(a.mode)) != sizeof(a.mode) || + Bread(b, a.size, sizeof(a.size)) != sizeof(a.size) || + Bread(b, a.fmag, sizeof(a.fmag)) != sizeof(a.fmag)) return -1; if(strncmp(a.name, name, strlen(name)) != 0) @@ -1592,6 +1595,10 @@ go: noescape = 1; goto out; } + if(strcmp(lexbuf, "go:nosplit") == 0) { + nosplit = 1; + goto out; + } out: return c; @@ -1854,74 +1861,74 @@ static struct /* name lexical etype op */ /* basic types */ - "int8", LNAME, TINT8, OXXX, - "int16", LNAME, TINT16, OXXX, - "int32", LNAME, TINT32, OXXX, - "int64", LNAME, TINT64, OXXX, - - "uint8", LNAME, TUINT8, OXXX, - "uint16", LNAME, TUINT16, OXXX, - "uint32", LNAME, TUINT32, OXXX, - "uint64", LNAME, TUINT64, OXXX, - - "float32", LNAME, TFLOAT32, OXXX, - "float64", LNAME, TFLOAT64, OXXX, - - "complex64", LNAME, TCOMPLEX64, OXXX, - "complex128", LNAME, TCOMPLEX128, OXXX, - - "bool", LNAME, TBOOL, OXXX, - "string", LNAME, TSTRING, OXXX, - - "any", LNAME, TANY, OXXX, - - "break", LBREAK, Txxx, OXXX, - "case", LCASE, Txxx, OXXX, - "chan", LCHAN, Txxx, OXXX, - "const", LCONST, Txxx, OXXX, - "continue", LCONTINUE, Txxx, OXXX, - "default", LDEFAULT, Txxx, OXXX, - "else", LELSE, Txxx, OXXX, - "defer", LDEFER, Txxx, OXXX, - "fallthrough", LFALL, Txxx, OXXX, - "for", LFOR, Txxx, OXXX, - "func", LFUNC, Txxx, OXXX, - "go", LGO, Txxx, OXXX, - "goto", LGOTO, Txxx, OXXX, - "if", LIF, Txxx, OXXX, - "import", LIMPORT, Txxx, OXXX, - "interface", LINTERFACE, Txxx, OXXX, - "map", LMAP, Txxx, OXXX, - "package", LPACKAGE, Txxx, OXXX, - "range", LRANGE, Txxx, OXXX, - "return", LRETURN, Txxx, OXXX, - "select", LSELECT, Txxx, OXXX, - "struct", LSTRUCT, Txxx, OXXX, - "switch", LSWITCH, Txxx, OXXX, - "type", LTYPE, Txxx, OXXX, - "var", LVAR, Txxx, OXXX, - - "append", LNAME, Txxx, OAPPEND, - "cap", LNAME, Txxx, OCAP, - "close", LNAME, Txxx, OCLOSE, - "complex", LNAME, Txxx, OCOMPLEX, - "copy", LNAME, Txxx, OCOPY, - "delete", LNAME, Txxx, ODELETE, - "imag", LNAME, Txxx, OIMAG, - "len", LNAME, Txxx, OLEN, - "make", LNAME, Txxx, OMAKE, - "new", LNAME, Txxx, ONEW, - "panic", LNAME, Txxx, OPANIC, - "print", LNAME, Txxx, OPRINT, - "println", LNAME, Txxx, OPRINTN, - "real", LNAME, Txxx, OREAL, - "recover", LNAME, Txxx, ORECOVER, - - "notwithstanding", LIGNORE, Txxx, OXXX, - "thetruthofthematter", LIGNORE, Txxx, OXXX, - "despiteallobjections", LIGNORE, Txxx, OXXX, - "whereas", LIGNORE, Txxx, OXXX, - "insofaras", LIGNORE, Txxx, OXXX, + {"int8", LNAME, TINT8, OXXX}, + {"int16", LNAME, TINT16, OXXX}, + {"int32", LNAME, TINT32, OXXX}, + {"int64", LNAME, TINT64, OXXX}, + + {"uint8", LNAME, TUINT8, OXXX}, + {"uint16", LNAME, TUINT16, OXXX}, + {"uint32", LNAME, TUINT32, OXXX}, + {"uint64", LNAME, TUINT64, OXXX}, + + {"float32", LNAME, TFLOAT32, OXXX}, + {"float64", LNAME, TFLOAT64, OXXX}, + + {"complex64", LNAME, TCOMPLEX64, OXXX}, + {"complex128", LNAME, TCOMPLEX128, OXXX}, + + {"bool", LNAME, TBOOL, OXXX}, + {"string", LNAME, TSTRING, OXXX}, + + {"any", LNAME, TANY, OXXX}, + + {"break", LBREAK, Txxx, OXXX}, + {"case", LCASE, Txxx, OXXX}, + {"chan", LCHAN, Txxx, OXXX}, + {"const", LCONST, Txxx, OXXX}, + {"continue", LCONTINUE, Txxx, OXXX}, + {"default", LDEFAULT, Txxx, OXXX}, + {"else", LELSE, Txxx, OXXX}, + {"defer", LDEFER, Txxx, OXXX}, + {"fallthrough", LFALL, Txxx, OXXX}, + {"for", LFOR, Txxx, OXXX}, + {"func", LFUNC, Txxx, OXXX}, + {"go", LGO, Txxx, OXXX}, + {"goto", LGOTO, Txxx, OXXX}, + {"if", LIF, Txxx, OXXX}, + {"import", LIMPORT, Txxx, OXXX}, + {"interface", LINTERFACE, Txxx, OXXX}, + {"map", LMAP, Txxx, OXXX}, + {"package", LPACKAGE, Txxx, OXXX}, + {"range", LRANGE, Txxx, OXXX}, + {"return", LRETURN, Txxx, OXXX}, + {"select", LSELECT, Txxx, OXXX}, + {"struct", LSTRUCT, Txxx, OXXX}, + {"switch", LSWITCH, Txxx, OXXX}, + {"type", LTYPE, Txxx, OXXX}, + {"var", LVAR, Txxx, OXXX}, + + {"append", LNAME, Txxx, OAPPEND}, + {"cap", LNAME, Txxx, OCAP}, + {"close", LNAME, Txxx, OCLOSE}, + {"complex", LNAME, Txxx, OCOMPLEX}, + {"copy", LNAME, Txxx, OCOPY}, + {"delete", LNAME, Txxx, ODELETE}, + {"imag", LNAME, Txxx, OIMAG}, + {"len", LNAME, Txxx, OLEN}, + {"make", LNAME, Txxx, OMAKE}, + {"new", LNAME, Txxx, ONEW}, + {"panic", LNAME, Txxx, OPANIC}, + {"print", LNAME, Txxx, OPRINT}, + {"println", LNAME, Txxx, OPRINTN}, + {"real", LNAME, Txxx, OREAL}, + {"recover", LNAME, Txxx, ORECOVER}, + + {"notwithstanding", LIGNORE, Txxx, OXXX}, + {"thetruthofthematter", LIGNORE, Txxx, OXXX}, + {"despiteallobjections", LIGNORE, Txxx, OXXX}, + {"whereas", LIGNORE, Txxx, OXXX}, + {"insofaras", LIGNORE, Txxx, OXXX}, }; static void @@ -2171,50 +2178,50 @@ struct char* name; } lexn[] = { - LANDAND, "ANDAND", - LANDNOT, "ANDNOT", - LASOP, "ASOP", - LBREAK, "BREAK", - LCASE, "CASE", - LCHAN, "CHAN", - LCOLAS, "COLAS", - LCOMM, "<-", - LCONST, "CONST", - LCONTINUE, "CONTINUE", - LDDD, "...", - LDEC, "DEC", - LDEFAULT, "DEFAULT", - LDEFER, "DEFER", - LELSE, "ELSE", - LEQ, "EQ", - LFALL, "FALL", - LFOR, "FOR", - LFUNC, "FUNC", - LGE, "GE", - LGO, "GO", - LGOTO, "GOTO", - LGT, "GT", - LIF, "IF", - LIMPORT, "IMPORT", - LINC, "INC", - LINTERFACE, "INTERFACE", - LLE, "LE", - LLITERAL, "LITERAL", - LLSH, "LSH", - LLT, "LT", - LMAP, "MAP", - LNAME, "NAME", - LNE, "NE", - LOROR, "OROR", - LPACKAGE, "PACKAGE", - LRANGE, "RANGE", - LRETURN, "RETURN", - LRSH, "RSH", - LSELECT, "SELECT", - LSTRUCT, "STRUCT", - LSWITCH, "SWITCH", - LTYPE, "TYPE", - LVAR, "VAR", + {LANDAND, "ANDAND"}, + {LANDNOT, "ANDNOT"}, + {LASOP, "ASOP"}, + {LBREAK, "BREAK"}, + {LCASE, "CASE"}, + {LCHAN, "CHAN"}, + {LCOLAS, "COLAS"}, + {LCOMM, "<-"}, + {LCONST, "CONST"}, + {LCONTINUE, "CONTINUE"}, + {LDDD, "..."}, + {LDEC, "DEC"}, + {LDEFAULT, "DEFAULT"}, + {LDEFER, "DEFER"}, + {LELSE, "ELSE"}, + {LEQ, "EQ"}, + {LFALL, "FALL"}, + {LFOR, "FOR"}, + {LFUNC, "FUNC"}, + {LGE, "GE"}, + {LGO, "GO"}, + {LGOTO, "GOTO"}, + {LGT, "GT"}, + {LIF, "IF"}, + {LIMPORT, "IMPORT"}, + {LINC, "INC"}, + {LINTERFACE, "INTERFACE"}, + {LLE, "LE"}, + {LLITERAL, "LITERAL"}, + {LLSH, "LSH"}, + {LLT, "LT"}, + {LMAP, "MAP"}, + {LNAME, "NAME"}, + {LNE, "NE"}, + {LOROR, "OROR"}, + {LPACKAGE, "PACKAGE"}, + {LRANGE, "RANGE"}, + {LRETURN, "RETURN"}, + {LRSH, "RSH"}, + {LSELECT, "SELECT"}, + {LSTRUCT, "STRUCT"}, + {LSWITCH, "SWITCH"}, + {LTYPE, "TYPE"}, + {LVAR, "VAR"}, }; char* @@ -2236,56 +2243,56 @@ struct char *want; } yytfix[] = { - "$end", "EOF", - "LLITERAL", "literal", - "LASOP", "op=", - "LBREAK", "break", - "LCASE", "case", - "LCHAN", "chan", - "LCOLAS", ":=", - "LCONST", "const", - "LCONTINUE", "continue", - "LDDD", "...", - "LDEFAULT", "default", - "LDEFER", "defer", - "LELSE", "else", - "LFALL", "fallthrough", - "LFOR", "for", - "LFUNC", "func", - "LGO", "go", - "LGOTO", "goto", - "LIF", "if", - "LIMPORT", "import", - "LINTERFACE", "interface", - "LMAP", "map", - "LNAME", "name", - "LPACKAGE", "package", - "LRANGE", "range", - "LRETURN", "return", - "LSELECT", "select", - "LSTRUCT", "struct", - "LSWITCH", "switch", - "LTYPE", "type", - "LVAR", "var", - "LANDAND", "&&", - "LANDNOT", "&^", - "LBODY", "{", - "LCOMM", "<-", - "LDEC", "--", - "LINC", "++", - "LEQ", "==", - "LGE", ">=", - "LGT", ">", - "LLE", "<=", - "LLT", "<", - "LLSH", "<<", - "LRSH", ">>", - "LOROR", "||", - "LNE", "!=", + {"$end", "EOF"}, + {"LLITERAL", "literal"}, + {"LASOP", "op="}, + {"LBREAK", "break"}, + {"LCASE", "case"}, + {"LCHAN", "chan"}, + {"LCOLAS", ":="}, + {"LCONST", "const"}, + {"LCONTINUE", "continue"}, + {"LDDD", "..."}, + {"LDEFAULT", "default"}, + {"LDEFER", "defer"}, + {"LELSE", "else"}, + {"LFALL", "fallthrough"}, + {"LFOR", "for"}, + {"LFUNC", "func"}, + {"LGO", "go"}, + {"LGOTO", "goto"}, + {"LIF", "if"}, + {"LIMPORT", "import"}, + {"LINTERFACE", "interface"}, + {"LMAP", "map"}, + {"LNAME", "name"}, + {"LPACKAGE", "package"}, + {"LRANGE", "range"}, + {"LRETURN", "return"}, + {"LSELECT", "select"}, + {"LSTRUCT", "struct"}, + {"LSWITCH", "switch"}, + {"LTYPE", "type"}, + {"LVAR", "var"}, + {"LANDAND", "&&"}, + {"LANDNOT", "&^"}, + {"LBODY", "{"}, + {"LCOMM", "<-"}, + {"LDEC", "--"}, + {"LINC", "++"}, + {"LEQ", "=="}, + {"LGE", ">="}, + {"LGT", ">"}, + {"LLE", "<="}, + {"LLT", "<"}, + {"LLSH", "<<"}, + {"LRSH", ">>"}, + {"LOROR", "||"}, + {"LNE", "!="}, // spell out to avoid confusion with punctuation in error messages - "';'", "semicolon or newline", - "','", "comma", + {"';'", "semicolon or newline"}, + {"','", "comma"}, }; static void diff --git a/src/cmd/gc/md5.c b/src/cmd/gc/md5.c index 0051ac964..46cb6b712 100644 --- a/src/cmd/gc/md5.c +++ b/src/cmd/gc/md5.c @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // 64-bit MD5 (does full MD5 but returns 64 bits only). -// Translation of ../../pkg/crypto/md5/md5*.go. +// Translation of ../../crypto/md5/md5*.go. #include <u.h> #include <libc.h> @@ -20,7 +20,15 @@ enum { #define _Init1 0xEFCDAB89 #define _Init2 0x98BADCFE #define _Init3 0x10325476 - +/*c2go +enum { + _Init0 = 0x67452301, + _Init1 = 0xEFCDAB89, + _Init2 = 0x98BADCFE, + _Init3 = 0x10325476 +}; +*/ + void md5reset(MD5 *d) { diff --git a/src/cmd/gc/mparith1.c b/src/cmd/gc/mparith1.c index 1519caec7..d33a81e09 100644 --- a/src/cmd/gc/mparith1.c +++ b/src/cmd/gc/mparith1.c @@ -591,7 +591,7 @@ Fconv(Fmt *fp) d = mpgetflt(fvp); if(d >= 0 && (fp->flags & FmtSign)) fmtprint(fp, "+"); - return fmtprint(fp, "%g", d, exp, fvp); + return fmtprint(fp, "%g", d); } // very out of range. compute decimal approximation by hand. diff --git a/src/cmd/gc/mparith2.c b/src/cmd/gc/mparith2.c index 5cf98c62c..fd9f591ce 100644 --- a/src/cmd/gc/mparith2.c +++ b/src/cmd/gc/mparith2.c @@ -656,7 +656,7 @@ mpdivmodfixfix(Mpint *q, Mpint *r, Mpint *n, Mpint *d) } static int -iszero(Mpint *a) +mpiszero(Mpint *a) { long *a1; int i; @@ -687,7 +687,7 @@ mpdivfract(Mpint *a, Mpint *b) for(j=0; j<Mpscale; j++) { x <<= 1; if(mpcmp(&d, &n) <= 0) { - if(!iszero(&d)) + if(!mpiszero(&d)) x |= 1; mpsubfixfix(&n, &d); } diff --git a/src/cmd/gc/mparith3.c b/src/cmd/gc/mparith3.c index 95618f1c6..6afd75c02 100644 --- a/src/cmd/gc/mparith3.c +++ b/src/cmd/gc/mparith3.c @@ -251,8 +251,8 @@ mpgetfltN(Mpflt *a, int prec, int bias) s = minexp - e; if(s > prec+1) s = prec+1; - if((v & ((1<<s)-1)) != 0) - v |= 1<<s; + if((v & ((1ULL<<s)-1)) != 0) + v |= 1ULL<<s; v >>= s; e = minexp; } diff --git a/src/cmd/gc/obj.c b/src/cmd/gc/obj.c index 4eeb03aa8..b752a13ce 100644 --- a/src/cmd/gc/obj.c +++ b/src/cmd/gc/obj.c @@ -5,6 +5,7 @@ #include <u.h> #include <libc.h> #include "go.h" +#include "../ld/textflag.h" /* * architecture-independent object file output @@ -84,7 +85,7 @@ dumpobj(void) externdcl = tmp; zero = pkglookup("zerovalue", runtimepkg); - ggloblsym(zero, zerosize, 1, 1); + ggloblsym(zero, zerosize, DUPOK|RODATA); dumpdata(); writeobj(ctxt, bout); @@ -128,7 +129,7 @@ dumpglobls(void) for(l=funcsyms; l; l=l->next) { n = l->n; dsymptr(n->sym, 0, n->sym->def->shortname->sym, 0); - ggloblsym(n->sym, widthptr, 1, 1); + ggloblsym(n->sym, widthptr, DUPOK|RODATA); } // Do not reprocess funcsyms on next dumpglobls call. @@ -249,7 +250,7 @@ stringsym(char *s, int len) } off = duint8(sym, off, 0); // terminating NUL for runtime off = (off+widthptr-1)&~(widthptr-1); // round to pointer alignment - ggloblsym(sym, off, 1, 1); + ggloblsym(sym, off, DUPOK|RODATA); return sym; } @@ -272,7 +273,7 @@ slicebytes(Node *nam, char *s, int len) m = len-n; off = dsname(sym, off, s+n, m); } - ggloblsym(sym, off, 0, 0); + ggloblsym(sym, off, NOPTR); if(nam->op != ONAME) fatal("slicebytes %N", nam); diff --git a/src/cmd/gc/order.c b/src/cmd/gc/order.c index 30dbc7dac..76820fde7 100644 --- a/src/cmd/gc/order.c +++ b/src/cmd/gc/order.c @@ -317,7 +317,7 @@ orderexprinplace(Node **np, Order *outer) // Orderstmtinplace orders the side effects of the single statement *np // and replaces it with the resulting statement list. -static void +void orderstmtinplace(Node **np) { Node *n; @@ -438,6 +438,9 @@ ordercall(Node *n, Order *order) // cases they are also typically registerizable, so not much harm done. // And this only applies to the multiple-assignment form. // We could do a more precise analysis if needed, like in walk.c. +// +// Ordermapassign also inserts these temporaries if needed for +// calling writebarrierfat with a pointer to n->right. static void ordermapassign(Node *n, Order *order) { @@ -451,7 +454,8 @@ ordermapassign(Node *n, Order *order) case OAS: order->out = list(order->out, n); - if(n->left->op == OINDEXMAP && !isaddrokay(n->right)) { + // We call writebarrierfat only for values > 4 pointers long. See walk.c. + if((n->left->op == OINDEXMAP || (needwritebarrier(n->left, n->right) && n->left->type->width > 4*widthptr)) && !isaddrokay(n->right)) { m = n->left; n->left = ordertemp(m->type, order, 0); a = nod(OAS, m, n->left); @@ -593,7 +597,10 @@ orderstmt(Node *n, Order *order) orderexpr(&n->rlist->n->left, order); // arg to recv ch = n->rlist->n->left->type; tmp1 = ordertemp(ch->type, order, haspointers(ch->type)); - tmp2 = ordertemp(types[TBOOL], order, 0); + if(!isblank(n->list->next->n)) + tmp2 = ordertemp(n->list->next->n->type, order, 0); + else + tmp2 = ordertemp(types[TBOOL], order, 0); order->out = list(order->out, n); r = nod(OAS, n->list->n, tmp1); typecheck(&r, Etop); @@ -768,6 +775,12 @@ orderstmt(Node *n, Order *order) // Special: clean case temporaries in each block entry. // Select must enter one of its blocks, so there is no // need for a cleaning at the end. + // Doubly special: evaluation order for select is stricter + // than ordinary expressions. Even something like p.c + // has to be hoisted into a temporary, so that it cannot be + // reordered after the channel evaluation for a different + // case (if p were nil, then the timing of the fault would + // give this away). t = marktemp(order); for(l=n->list; l; l=l->next) { if(l->n->op != OXCASE) @@ -810,6 +823,8 @@ orderstmt(Node *n, Order *order) // r->left == N means 'case <-c'. // c is always evaluated; x and ok are only evaluated when assigned. orderexpr(&r->right->left, order); + if(r->right->left->op != ONAME) + r->right->left = ordercopyexpr(r->right->left, r->right->left->type, order, 0); // Introduce temporary for receive and move actual copy into case body. // avoids problems with target being addressed, as usual. @@ -1017,11 +1032,21 @@ orderexpr(Node **np, Order *order) orderexprinplace(&n->right, order); break; + case OAPPEND: case OCALLFUNC: - case OCALLMETH: case OCALLINTER: - case OAPPEND: + case OCALLMETH: + case OCAP: case OCOMPLEX: + case OCOPY: + case OIMAG: + case OLEN: + case OMAKECHAN: + case OMAKEMAP: + case OMAKESLICE: + case ONEW: + case OREAL: + case ORECOVER: ordercall(n, order); n = ordercopyexpr(n, n->type, order, 0); break; @@ -1055,6 +1080,19 @@ orderexpr(Node **np, Order *order) orderexpr(&n->left, order); n = ordercopyexpr(n, n->type, order, 1); break; + + case OEQ: + case ONE: + orderexpr(&n->left, order); + orderexpr(&n->right, order); + t = n->left->type; + if(t->etype == TSTRUCT || isfixedarray(t)) { + // for complex comparisons, we need both args to be + // addressable so we can pass them to the runtime. + orderaddrtemp(&n->left, order); + orderaddrtemp(&n->right, order); + } + break; } lineno = lno; diff --git a/src/cmd/gc/pgen.c b/src/cmd/gc/pgen.c index 40620c3da..39028e3f8 100644 --- a/src/cmd/gc/pgen.c +++ b/src/cmd/gc/pgen.c @@ -11,9 +11,10 @@ #include "md5.h" #include "gg.h" #include "opt.h" -#include "../../pkg/runtime/funcdata.h" +#include "../../runtime/funcdata.h" static void allocauto(Prog* p); +static void emitptrargsmap(void); static Sym* makefuncdatasym(char *namefmt, int64 funcdatakind) @@ -173,9 +174,17 @@ compile(Node *fn) lno = setlineno(fn); + curfn = fn; + dowidth(curfn->type); + if(fn->nbody == nil) { - if(pure_go || strncmp(fn->nname->sym->name, "init·", 6) == 0) + if(pure_go || strncmp(fn->nname->sym->name, "init·", 6) == 0) { yyerror("missing function body", fn); + goto ret; + } + if(debug['A']) + goto ret; + emitptrargsmap(); goto ret; } @@ -184,9 +193,6 @@ compile(Node *fn) // set up domain for labels clearlabels(); - curfn = fn; - dowidth(curfn->type); - if(curfn->type->outnamed) { // add clearing of the output parameters t = structfirst(&save, getoutarg(curfn->type)); @@ -229,9 +235,11 @@ compile(Node *fn) ptxt->TEXTFLAG |= WRAPPER; if(fn->needctxt) ptxt->TEXTFLAG |= NEEDCTXT; + if(fn->nosplit) + ptxt->TEXTFLAG |= NOSPLIT; // Clumsy but important. - // See test/recover.go for test cases and src/pkg/reflect/value.go + // See test/recover.go for test cases and src/reflect/value.go // for the actual functions being considered. if(myimportpath != nil && strcmp(myimportpath, "reflect") == 0) { if(strcmp(curfn->nname->sym->name, "callReflect") == 0 || strcmp(curfn->nname->sym->name, "callMethod") == 0) @@ -327,6 +335,43 @@ ret: lineno = lno; } +static void +emitptrargsmap(void) +{ + int nptr, nbitmap, j, off; + vlong xoffset; + Bvec *bv; + Sym *sym; + + sym = lookup(smprint("%s.args_stackmap", curfn->nname->sym->name)); + + nptr = curfn->type->argwid / widthptr; + bv = bvalloc(nptr*2); + nbitmap = 1; + if(curfn->type->outtuple > 0) + nbitmap = 2; + off = duint32(sym, 0, nbitmap); + off = duint32(sym, off, bv->n); + if(curfn->type->thistuple > 0) { + xoffset = 0; + twobitwalktype1(getthisx(curfn->type), &xoffset, bv); + } + if(curfn->type->intuple > 0) { + xoffset = 0; + twobitwalktype1(getinargx(curfn->type), &xoffset, bv); + } + for(j = 0; j < bv->n; j += 32) + off = duint32(sym, off, bv->b[j/32]); + if(curfn->type->outtuple > 0) { + xoffset = 0; + twobitwalktype1(getoutargx(curfn->type), &xoffset, bv); + for(j = 0; j < bv->n; j += 32) + off = duint32(sym, off, bv->b[j/32]); + } + ggloblsym(sym, off, RODATA); + free(bv); +} + // Sort the list of stack variables. Autos after anything else, // within autos, unused after used, within used, things with // pointers first, zeroed things first, and then decreasing size. diff --git a/src/cmd/gc/plive.c b/src/cmd/gc/plive.c index 7a40ab559..0feb2c710 100644 --- a/src/cmd/gc/plive.c +++ b/src/cmd/gc/plive.c @@ -17,9 +17,9 @@ #include <libc.h> #include "gg.h" #include "opt.h" -#include "../../pkg/runtime/funcdata.h" - -enum { BitsPerPointer = 2 }; +#include "../ld/textflag.h" +#include "../../runtime/funcdata.h" +#include "../../runtime/mgc0.h" enum { UNVISITED = 0, @@ -674,8 +674,8 @@ static void progeffects(Prog *prog, Array *vars, Bvec *uevar, Bvec *varkill, Bvec *avarinit) { ProgInfo info; - Adr *from; - Adr *to; + Addr *from; + Addr *to; Node *node; int32 i; int32 pos; @@ -1063,7 +1063,7 @@ checkptxt(Node *fn, Prog *firstp) // and then simply copied into bv at the correct offset on future calls with // the same type t. On https://rsc.googlecode.com/hg/testdata/slow.go, twobitwalktype1 // accounts for 40% of the 6g execution time. -static void +void twobitwalktype1(Type *t, vlong *xoffset, Bvec *bv) { vlong fieldoffset; @@ -1113,8 +1113,7 @@ twobitwalktype1(Type *t, vlong *xoffset, Bvec *bv) // struct { byte *str; intgo len; } if((*xoffset & (widthptr-1)) != 0) fatal("twobitwalktype1: invalid alignment, %T", t); - bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 0); - bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 3:0 = multiword:string + bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr in first slot *xoffset += t->width; break; @@ -1145,9 +1144,7 @@ twobitwalktype1(Type *t, vlong *xoffset, Bvec *bv) // struct { byte *array; uintgo len; uintgo cap; } if((*xoffset & (widthptr-1)) != 0) fatal("twobitwalktype1: invalid TARRAY alignment, %T", t); - bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 0); - bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); - bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 2); // 3:1 = multiword/slice + bvset(bv, (*xoffset / widthptr) * BitsPerPointer + 1); // 2 = live ptr in first slot *xoffset += t->width; } else for(i = 0; i < t->bound; i++) @@ -1683,6 +1680,13 @@ livenessepilogue(Liveness *lv) // FNV-1 hash function constants. #define H0 2166136261UL #define Hp 16777619UL +/*c2go +enum +{ + H0 = 2166136261, + Hp = 16777619, +}; +*/ static uint32 hashbitmap(uint32 h, Bvec *bv) @@ -1932,11 +1936,15 @@ twobitwritesymbol(Array *arr, Sym *sym) break; for(j = 0; j < bv->n; j += 32) { word = bv->b[j/32]; - off = duint32(sym, off, word); + // Runtime reads the bitmaps as byte arrays. Oblige. + off = duint8(sym, off, word); + off = duint8(sym, off, word>>8); + off = duint8(sym, off, word>>16); + off = duint8(sym, off, word>>24); } } duint32(sym, 0, i); // number of bitmaps - ggloblsym(sym, off, 0, 1); + ggloblsym(sym, off, RODATA); } static void diff --git a/src/cmd/gc/popt.c b/src/cmd/gc/popt.c index ea88b94db..993bb2482 100644 --- a/src/cmd/gc/popt.c +++ b/src/cmd/gc/popt.c @@ -49,7 +49,7 @@ noreturn(Prog *p) symlist[0] = pkglookup("panicindex", runtimepkg); symlist[1] = pkglookup("panicslice", runtimepkg); symlist[2] = pkglookup("throwinit", runtimepkg); - symlist[3] = pkglookup("panic", runtimepkg); + symlist[3] = pkglookup("gopanic", runtimepkg); symlist[4] = pkglookup("panicwrap", runtimepkg); symlist[5] = pkglookup("throwreturn", runtimepkg); symlist[6] = pkglookup("selectgo", runtimepkg); @@ -98,6 +98,10 @@ chasejmp(Prog *p, int *jmploop) */ #define alive ((void*)0) #define dead ((void*)1) +/*c2go +extern void *alive; +extern void *dead; +*/ /* mark all code reachable from firstp as alive */ static void diff --git a/src/cmd/gc/racewalk.c b/src/cmd/gc/racewalk.c index 285bd78a2..c9e27fe56 100644 --- a/src/cmd/gc/racewalk.c +++ b/src/cmd/gc/racewalk.c @@ -208,6 +208,26 @@ racewalknode(Node **np, NodeList **init, int wr, int skip) goto ret; case OCALLFUNC: + // Instrument dst argument of runtime.writebarrier* calls + // as we do not instrument runtime code. + if(n->left->sym != S && n->left->sym->pkg == runtimepkg && strncmp(n->left->sym->name, "writebarrier", 12) == 0) { + // Find the dst argument. + // The list can be reordered, so it's not necessary just the first or the second element. + for(l = n->list; l; l = l->next) { + if(strcmp(n->left->sym->name, "writebarrierfat") == 0) { + if(l->n->left->xoffset == widthptr) + break; + } else { + if(l->n->left->xoffset == 0) + break; + } + } + if(l == nil) + fatal("racewalk: writebarrier no arg"); + if(l->n->right->op != OADDR) + fatal("racewalk: writebarrier bad arg"); + callinstr(&l->n->right->left, init, 1, 0); + } racewalknode(&n->left, init, 0, 0); goto ret; @@ -419,8 +439,10 @@ racewalknode(Node **np, NodeList **init, int wr, int skip) ret: if(n->op != OBLOCK) // OBLOCK is handled above in a special way. racewalklist(n->list, init); - racewalknode(&n->ntest, &n->ntest->ninit, 0, 0); - racewalknode(&n->nincr, &n->nincr->ninit, 0, 0); + if(n->ntest != N) + racewalknode(&n->ntest, &n->ntest->ninit, 0, 0); + if(n->nincr != N) + racewalknode(&n->nincr, &n->nincr->ninit, 0, 0); racewalklist(n->nbody, nil); racewalklist(n->nelse, nil); racewalklist(n->rlist, nil); diff --git a/src/cmd/gc/range.c b/src/cmd/gc/range.c index 45aa521b3..4ed452832 100644 --- a/src/cmd/gc/range.c +++ b/src/cmd/gc/range.c @@ -67,9 +67,11 @@ typecheckrange(Node *n) yyerror("too many variables in range"); } - v1 = n->list->n; + v1 = N; + if(n->list) + v1 = n->list->n; v2 = N; - if(n->list->next) + if(n->list && n->list->next) v2 = n->list->next->n; // this is not only a optimization but also a requirement in the spec. @@ -77,14 +79,17 @@ typecheckrange(Node *n) // clause is equivalent to the same clause with only the first variable // present." if(isblank(v2)) { - n->list = list1(v1); + if(v1 != N) + n->list = list1(v1); v2 = N; } - if(v1->defn == n) - v1->type = t1; - else if(v1->type != T && assignop(t1, v1->type, &why) == 0) - yyerror("cannot assign type %T to %lN in range%s", t1, v1, why); + if(v1) { + if(v1->defn == n) + v1->type = t1; + else if(v1->type != T && assignop(t1, v1->type, &why) == 0) + yyerror("cannot assign type %T to %lN in range%s", t1, v1, why); + } if(v2) { if(v2->defn == n) v2->type = t2; @@ -123,9 +128,11 @@ walkrange(Node *n) a = n->right; lno = setlineno(a); - v1 = n->list->n; + v1 = N; + if(n->list) + v1 = n->list->n; v2 = N; - if(n->list->next && !isblank(n->list->next->n)) + if(n->list && n->list->next && !isblank(n->list->next->n)) v2 = n->list->next->n; // n->list has no meaning anymore, clear it // to avoid erroneous processing by racewalk. @@ -154,7 +161,9 @@ walkrange(Node *n) n->ntest = nod(OLT, hv1, hn); n->nincr = nod(OAS, hv1, nod(OADD, hv1, nodintconst(1))); - if(v2 == N) + if(v1 == N) + body = nil; + else if(v2 == N) body = list1(nod(OAS, v1, hv1)); else { a = nod(OAS2, N, N); @@ -205,16 +214,18 @@ walkrange(Node *n) key = nod(ODOT, hit, keyname); key = nod(OIND, key, N); - if(v2 == N) { - a = nod(OAS, v1, key); + if(v1 == N) + body = nil; + else if(v2 == N) { + body = list1(nod(OAS, v1, key)); } else { val = nod(ODOT, hit, valname); val = nod(OIND, val, N); a = nod(OAS2, N, N); a->list = list(list1(v1), v2); a->rlist = list(list1(key), val); + body = list1(a); } - body = list1(a); break; case TCHAN: @@ -223,6 +234,7 @@ walkrange(Node *n) n->ntest = N; hv1 = temp(t->type); + hv1->typecheck = 1; if(haspointers(t->type)) init = list(init, nod(OAS, hv1, N)); hb = temp(types[TBOOL]); @@ -233,7 +245,10 @@ walkrange(Node *n) a->list = list(list1(hv1), hb); a->rlist = list1(nod(ORECV, ha, N)); n->ntest->ninit = list1(a); - body = list1(nod(OAS, v1, hv1)); + if(v1 == N) + body = nil; + else + body = list1(nod(OAS, v1, hv1)); break; case TSTRING: @@ -257,7 +272,10 @@ walkrange(Node *n) n->ntest = nod(ONE, hv1, nodintconst(0)); n->ntest->ninit = list(list1(nod(OAS, ohv1, hv1)), a); - body = list1(nod(OAS, v1, ohv1)); + + body = nil; + if(v1 != N) + body = list1(nod(OAS, v1, ohv1)); if(v2 != N) body = list(body, nod(OAS, v2, hv2)); break; diff --git a/src/cmd/gc/reflect.c b/src/cmd/gc/reflect.c index dbb447e4e..b2ff2fbc5 100644 --- a/src/cmd/gc/reflect.c +++ b/src/cmd/gc/reflect.c @@ -5,7 +5,9 @@ #include <u.h> #include <libc.h> #include "go.h" -#include "../../pkg/runtime/mgc0.h" +#include "../ld/textflag.h" +#include "../../runtime/mgc0.h" +#include "../../runtime/typekind.h" /* * runtime interface and reflection data structures @@ -15,7 +17,9 @@ static NodeList* signatlist; static Sym* dtypesym(Type*); static Sym* weaktypesym(Type*); static Sym* dalgsym(Type*); -static Sym* dgcsym(Type*); +static int usegcprog(Type*); +static void gengcprog(Type*, Sym**, Sym**); +static void gengcmask(Type*, uint8[16]); static int sigcmp(Sig *a, Sig *b) @@ -105,7 +109,7 @@ lsort(Sig *l, int(*f)(Sig*, Sig*)) // the given map type. This type is not visible to users - // we include only enough information to generate a correct GC // program for it. -// Make sure this stays in sync with ../../pkg/runtime/hashmap.c! +// Make sure this stays in sync with ../../runtime/hashmap.c! enum { BUCKETSIZE = 8, MAXKEYSIZE = 128, @@ -188,7 +192,7 @@ mapbucket(Type *t) // the given map type. This type is not visible to users - // we include only enough information to generate a correct GC // program for it. -// Make sure this stays in sync with ../../pkg/runtime/hashmap.c! +// Make sure this stays in sync with ../../runtime/hashmap.go! static Type* hmap(Type *t) { @@ -207,10 +211,6 @@ hmap(Type *t) offset += 4; // flags offset += 4; // hash0 offset += 1; // B - offset += 1; // keysize - offset += 1; // valuesize - offset = (offset + 1) / 2 * 2; - offset += 2; // bucketsize offset = (offset + widthptr - 1) / widthptr * widthptr; bucketsfield = typ(TFIELD); @@ -261,7 +261,7 @@ hiter(Type *t) // bptr *Bucket // other [4]uintptr // } - // must match ../../pkg/runtime/hashmap.c:hash_iter. + // must match ../../runtime/hashmap.c:hash_iter. field[0] = typ(TFIELD); field[0]->type = ptrto(t->down); field[0]->sym = mal(sizeof(Sym)); @@ -378,7 +378,7 @@ methods(Type *t) // type stored in interface word it = t; - if(it->width > widthptr) + if(!isdirectiface(it)) it = ptrto(t); // make list of methods for t, @@ -524,7 +524,7 @@ dimportpath(Pkg *p) p->pathsym = n->sym; gdatastring(n, p->path); - ggloblsym(n->sym, types[TSTRING]->width, 1, 1); + ggloblsym(n->sym, types[TSTRING]->width, DUPOK|RODATA); } static int @@ -550,7 +550,7 @@ dgopkgpath(Sym *s, int ot, Pkg *pkg) /* * uncommonType - * ../../pkg/runtime/type.go:/uncommonType + * ../../runtime/type.go:/uncommonType */ static int dextratype(Sym *sym, int off, Type *t, int ptroff) @@ -564,6 +564,7 @@ dextratype(Sym *sym, int off, Type *t, int ptroff) return off; // fill in *extraType pointer in header + off = rnd(off, widthptr); dsymptr(sym, ptroff, sym, off); n = 0; @@ -593,7 +594,7 @@ dextratype(Sym *sym, int off, Type *t, int ptroff) // methods for(a=m; a; a=a->link) { // method - // ../../pkg/runtime/type.go:/method + // ../../runtime/type.go:/method ot = dgostringptr(s, ot, a->name); ot = dgopkgpath(s, ot, a->pkg); ot = dsymptr(s, ot, dtypesym(a->mtype), 0); @@ -611,37 +612,6 @@ dextratype(Sym *sym, int off, Type *t, int ptroff) return ot; } -enum { - KindBool = 1, - KindInt, - KindInt8, - KindInt16, - KindInt32, - KindInt64, - KindUint, - KindUint8, - KindUint16, - KindUint32, - KindUint64, - KindUintptr, - KindFloat32, - KindFloat64, - KindComplex64, - KindComplex128, - KindArray, - KindChan, - KindFunc, - KindInterface, - KindMap, - KindPtr, - KindSlice, - KindString, - KindStruct, - KindUnsafePointer, - - KindNoPointers = 1<<7, -}; - static int kinds[] = { @@ -740,28 +710,30 @@ haspointers(Type *t) /* * commonType - * ../../pkg/runtime/type.go:/commonType + * ../../runtime/type.go:/commonType */ static int dcommontype(Sym *s, int ot, Type *t) { - int i, alg, sizeofAlg; - Sym *sptr, *algsym, *zero; + int i, alg, sizeofAlg, gcprog; + Sym *sptr, *algsym, *zero, *gcprog0, *gcprog1, *sbits; + uint8 gcmask[16]; static Sym *algarray; + uint64 x1, x2; char *p; if(ot != 0) fatal("dcommontype %d", ot); - sizeofAlg = 4*widthptr; + sizeofAlg = 2*widthptr; if(algarray == nil) algarray = pkglookup("algarray", runtimepkg); + dowidth(t); alg = algtype(t); algsym = S; if(alg < 0) algsym = dalgsym(t); - dowidth(t); if(t->sym != nil && !isptr[t->etype]) sptr = dtypesym(ptrto(t)); else @@ -808,17 +780,52 @@ dcommontype(Sym *s, int ot, Type *t) ot = duint8(s, ot, t->align); // align ot = duint8(s, ot, t->align); // fieldAlign + gcprog = usegcprog(t); i = kinds[t->etype]; if(t->etype == TARRAY && t->bound < 0) i = KindSlice; if(!haspointers(t)) i |= KindNoPointers; + if(isdirectiface(t)) + i |= KindDirectIface; + if(gcprog) + i |= KindGCProg; ot = duint8(s, ot, i); // kind if(alg >= 0) ot = dsymptr(s, ot, algarray, alg*sizeofAlg); else ot = dsymptr(s, ot, algsym, 0); - ot = dsymptr(s, ot, dgcsym(t), 0); // gc + // gc + if(gcprog) { + gengcprog(t, &gcprog0, &gcprog1); + if(gcprog0 != S) + ot = dsymptr(s, ot, gcprog0, 0); + else + ot = duintptr(s, ot, 0); + ot = dsymptr(s, ot, gcprog1, 0); + } else { + gengcmask(t, gcmask); + x1 = 0; + for(i=0; i<8; i++) + x1 = x1<<8 | gcmask[i]; + if(widthptr == 4) { + p = smprint("gcbits.%#016llux", x1); + } else { + x2 = 0; + for(i=0; i<8; i++) + x2 = x2<<8 | gcmask[i+8]; + p = smprint("gcbits.%#016llux%016llux", x1, x2); + } + sbits = pkglookup(p, runtimepkg); + if((sbits->flags & SymUniq) == 0) { + sbits->flags |= SymUniq; + for(i = 0; i < 2*widthptr; i++) + duint8(sbits, i, gcmask[i]); + ggloblsym(sbits, 2*widthptr, DUPOK|RODATA); + } + ot = dsymptr(s, ot, sbits, 0); + ot = duintptr(s, ot, 0); + } p = smprint("%-uT", t); //print("dcommontype: %s\n", p); ot = dgostringptr(s, ot, p); // string @@ -975,7 +982,9 @@ dtypesym(Type *t) tbase = t; if(isptr[t->etype] && t->sym == S && t->type->sym != S) tbase = t->type; - dupok = tbase->sym == S; + dupok = 0; + if(tbase->sym == S) + dupok = DUPOK; if(compiling_runtime && (tbase == types[tbase->etype] || @@ -1002,7 +1011,7 @@ ok: case TARRAY: if(t->bound >= 0) { - // ../../pkg/runtime/type.go:/ArrayType + // ../../runtime/type.go:/ArrayType s1 = dtypesym(t->type); t2 = typ(TARRAY); t2->type = t->type; @@ -1014,7 +1023,7 @@ ok: ot = dsymptr(s, ot, s2, 0); ot = duintptr(s, ot, t->bound); } else { - // ../../pkg/runtime/type.go:/SliceType + // ../../runtime/type.go:/SliceType s1 = dtypesym(t->type); ot = dcommontype(s, ot, t); xt = ot - 3*widthptr; @@ -1023,7 +1032,7 @@ ok: break; case TCHAN: - // ../../pkg/runtime/type.go:/ChanType + // ../../runtime/type.go:/ChanType s1 = dtypesym(t->type); ot = dcommontype(s, ot, t); xt = ot - 3*widthptr; @@ -1073,14 +1082,14 @@ ok: n++; } - // ../../pkg/runtime/type.go:/InterfaceType + // ../../runtime/type.go:/InterfaceType ot = dcommontype(s, ot, t); xt = ot - 3*widthptr; ot = dsymptr(s, ot, s, ot+widthptr+2*widthint); ot = duintxx(s, ot, n, widthint); ot = duintxx(s, ot, n, widthint); for(a=m; a; a=a->link) { - // ../../pkg/runtime/type.go:/imethod + // ../../runtime/type.go:/imethod ot = dgostringptr(s, ot, a->name); ot = dgopkgpath(s, ot, a->pkg); ot = dsymptr(s, ot, dtypesym(a->type), 0); @@ -1088,7 +1097,7 @@ ok: break; case TMAP: - // ../../pkg/runtime/type.go:/MapType + // ../../runtime/type.go:/MapType s1 = dtypesym(t->down); s2 = dtypesym(t->type); s3 = dtypesym(mapbucket(t)); @@ -1099,16 +1108,31 @@ ok: ot = dsymptr(s, ot, s2, 0); ot = dsymptr(s, ot, s3, 0); ot = dsymptr(s, ot, s4, 0); + if(t->down->width > MAXKEYSIZE) { + ot = duint8(s, ot, widthptr); + ot = duint8(s, ot, 1); // indirect + } else { + ot = duint8(s, ot, t->down->width); + ot = duint8(s, ot, 0); // not indirect + } + if(t->type->width > MAXVALSIZE) { + ot = duint8(s, ot, widthptr); + ot = duint8(s, ot, 1); // indirect + } else { + ot = duint8(s, ot, t->type->width); + ot = duint8(s, ot, 0); // not indirect + } + ot = duint16(s, ot, mapbucket(t)->width); break; case TPTR32: case TPTR64: if(t->type->etype == TANY) { - // ../../pkg/runtime/type.go:/UnsafePointerType + // ../../runtime/type.go:/UnsafePointerType ot = dcommontype(s, ot, t); break; } - // ../../pkg/runtime/type.go:/PtrType + // ../../runtime/type.go:/PtrType s1 = dtypesym(t->type); ot = dcommontype(s, ot, t); xt = ot - 3*widthptr; @@ -1116,7 +1140,7 @@ ok: break; case TSTRUCT: - // ../../pkg/runtime/type.go:/StructType + // ../../runtime/type.go:/StructType // for security, only the exported fields. n = 0; for(t1=t->type; t1!=T; t1=t1->down) { @@ -1129,7 +1153,7 @@ ok: ot = duintxx(s, ot, n, widthint); ot = duintxx(s, ot, n, widthint); for(t1=t->type; t1!=T; t1=t1->down) { - // ../../pkg/runtime/type.go:/structField + // ../../runtime/type.go:/structField if(t1->sym && !t1->embedded) { ot = dgostringptr(s, ot, t1->sym->name); if(exportname(t1->sym->name)) @@ -1150,7 +1174,7 @@ ok: break; } ot = dextratype(s, ot, t, xt); - ggloblsym(s, ot, dupok, 1); + ggloblsym(s, ot, dupok|RODATA); // generate typelink.foo pointing at s = type.foo. // The linker will leave a table of all the typelinks for @@ -1164,7 +1188,7 @@ ok: case TMAP: slink = typelinksym(t); dsymptr(slink, 0, s, 0); - ggloblsym(slink, widthptr, dupok, 1); + ggloblsym(slink, widthptr, dupok|RODATA); } } @@ -1236,8 +1260,7 @@ static Sym* dalgsym(Type *t) { int ot; - Sym *s, *hash, *eq; - char buf[100]; + Sym *s, *hash, *hashfunc, *eq, *eqfunc; // dalgsym is only called for a type that needs an algorithm table, // which implies that the type is comparable (or else it would use ANOEQ). @@ -1248,55 +1271,225 @@ dalgsym(Type *t) eq = typesymprefix(".eq", t); geneq(eq, t); - // ../../pkg/runtime/runtime.h:/Alg + // make Go funcs (closures) for calling hash and equal from Go + hashfunc = typesymprefix(".hashfunc", t); + dsymptr(hashfunc, 0, hash, 0); + ggloblsym(hashfunc, widthptr, DUPOK|RODATA); + eqfunc = typesymprefix(".eqfunc", t); + dsymptr(eqfunc, 0, eq, 0); + ggloblsym(eqfunc, widthptr, DUPOK|RODATA); + + // ../../runtime/alg.go:/typeAlg ot = 0; - ot = dsymptr(s, ot, hash, 0); - ot = dsymptr(s, ot, eq, 0); - ot = dsymptr(s, ot, pkglookup("memprint", runtimepkg), 0); - switch(t->width) { - default: - ot = dsymptr(s, ot, pkglookup("memcopy", runtimepkg), 0); - break; - case 1: - case 2: - case 4: - case 8: - case 16: - snprint(buf, sizeof buf, "memcopy%d", (int)t->width*8); - ot = dsymptr(s, ot, pkglookup(buf, runtimepkg), 0); - break; - } + ot = dsymptr(s, ot, hashfunc, 0); + ot = dsymptr(s, ot, eqfunc, 0); - ggloblsym(s, ot, 1, 1); + ggloblsym(s, ot, DUPOK|RODATA); return s; } static int -gcinline(Type *t) +usegcprog(Type *t) { - switch(t->etype) { - case TARRAY: - if(t->bound == 1) - return 1; - if(t->width <= 4*widthptr) - return 1; - break; + vlong size, nptr; + + if(!haspointers(t)) + return 0; + if(t->width == BADWIDTH) + dowidth(t); + // Calculate size of the unrolled GC mask. + nptr = (t->width+widthptr-1)/widthptr; + size = nptr; + if(size%2) + size *= 2; // repeated + size = size*gcBits/8; // 4 bits per word + // Decide whether to use unrolled GC mask or GC program. + // We could use a more elaborate condition, but this seems to work well in practice. + // For small objects GC program can't give significant reduction. + // While large objects usually contain arrays; and even if it don't + // the program uses 2-bits per word while mask uses 4-bits per word, + // so the program is still smaller. + return size > 2*widthptr; +} + +// Generates sparse GC bitmask (4 bits per word). +static void +gengcmask(Type *t, uint8 gcmask[16]) +{ + Bvec *vec; + vlong xoffset, nptr, i, j; + int half, mw; + uint8 bits, *pos; + + memset(gcmask, 0, 16); + if(!haspointers(t)) + return; + + // Generate compact mask as stacks use. + xoffset = 0; + vec = bvalloc(2*widthptr*8); + twobitwalktype1(t, &xoffset, vec); + + // Unfold the mask for the GC bitmap format: + // 4 bits per word, 2 high bits encode pointer info. + pos = (uint8*)gcmask; + nptr = (t->width+widthptr-1)/widthptr; + half = 0; + mw = 0; + // If number of words is odd, repeat the mask. + // This makes simpler handling of arrays in runtime. + for(j=0; j<=(nptr%2); j++) { + for(i=0; i<nptr; i++) { + bits = bvget(vec, i*BitsPerPointer) | bvget(vec, i*BitsPerPointer+1)<<1; + // Some fake types (e.g. Hmap) has missing fileds. + // twobitwalktype1 generates BitsDead for that holes, + // replace BitsDead with BitsScalar. + if(!mw && bits == BitsDead) + bits = BitsScalar; + mw = !mw && bits == BitsMultiWord; + bits <<= 2; + if(half) + bits <<= 4; + *pos |= bits; + half = !half; + if(!half) + pos++; + } } - return 0; } -static int -dgcsym1(Sym *s, int ot, Type *t, vlong *off, int stack_size) +// Helper object for generation of GC programs. +typedef struct ProgGen ProgGen; +struct ProgGen { - Type *t1; - vlong o, off2, fieldoffset, i; + Sym* s; + int32 datasize; + uint8 data[256/PointersPerByte]; + vlong ot; +}; - if(t->align > 0 && (*off % t->align) != 0) - fatal("dgcsym1: invalid initial alignment, %T", t); +static void +proggeninit(ProgGen *g, Sym *s) +{ + g->s = s; + g->datasize = 0; + g->ot = 0; + memset(g->data, 0, sizeof(g->data)); +} + +static void +proggenemit(ProgGen *g, uint8 v) +{ + g->ot = duint8(g->s, g->ot, v); +} + +// Emits insData block from g->data. +static void +proggendataflush(ProgGen *g) +{ + int32 i, s; + + if(g->datasize == 0) + return; + proggenemit(g, insData); + proggenemit(g, g->datasize); + s = (g->datasize + PointersPerByte - 1)/PointersPerByte; + for(i = 0; i < s; i++) + proggenemit(g, g->data[i]); + g->datasize = 0; + memset(g->data, 0, sizeof(g->data)); +} + +static void +proggendata(ProgGen *g, uint8 d) +{ + g->data[g->datasize/PointersPerByte] |= d << ((g->datasize%PointersPerByte)*BitsPerPointer); + g->datasize++; + if(g->datasize == 255) + proggendataflush(g); +} + +// Skip v bytes due to alignment, etc. +static void +proggenskip(ProgGen *g, vlong off, vlong v) +{ + vlong i; + + for(i = off; i < off+v; i++) { + if((i%widthptr) == 0) + proggendata(g, BitsScalar); + } +} + +// Emit insArray instruction. +static void +proggenarray(ProgGen *g, vlong len) +{ + int32 i; + + proggendataflush(g); + proggenemit(g, insArray); + for(i = 0; i < widthptr; i++, len >>= 8) + proggenemit(g, len); +} + +static void +proggenarrayend(ProgGen *g) +{ + proggendataflush(g); + proggenemit(g, insArrayEnd); +} + +static vlong +proggenfini(ProgGen *g) +{ + proggendataflush(g); + proggenemit(g, insEnd); + return g->ot; +} + +static void gengcprog1(ProgGen *g, Type *t, vlong *xoffset); + +// Generates GC program for large types. +static void +gengcprog(Type *t, Sym **pgc0, Sym **pgc1) +{ + Sym *gc0, *gc1; + vlong nptr, size, ot, xoffset; + ProgGen g; + + nptr = (t->width+widthptr-1)/widthptr; + size = nptr; + if(size%2) + size *= 2; // repeated twice + size = size*PointersPerByte/8; // 4 bits per word + size++; // unroll flag in the beginning, used by runtime (see runtime.markallocated) + // emity space in BSS for unrolled program + *pgc0 = S; + // Don't generate it if it's too large, runtime will unroll directly into GC bitmap. + if(size <= MaxGCMask) { + gc0 = typesymprefix(".gc", t); + ggloblsym(gc0, size, DUPOK|NOPTR); + *pgc0 = gc0; + } + + // program in RODATA + gc1 = typesymprefix(".gcprog", t); + proggeninit(&g, gc1); + xoffset = 0; + gengcprog1(&g, t, &xoffset); + ot = proggenfini(&g); + ggloblsym(gc1, ot, DUPOK|RODATA); + *pgc1 = gc1; +} + +// Recursively walks type t and writes GC program into g. +static void +gengcprog1(ProgGen *g, Type *t, vlong *xoffset) +{ + vlong fieldoffset, i, o, n; + Type *t1; - if(t->width == BADWIDTH) - dowidth(t); - switch(t->etype) { case TINT8: case TUINT8: @@ -1314,187 +1507,71 @@ dgcsym1(Sym *s, int ot, Type *t, vlong *off, int stack_size) case TFLOAT64: case TCOMPLEX64: case TCOMPLEX128: - *off += t->width; + proggenskip(g, *xoffset, t->width); + *xoffset += t->width; break; - case TPTR32: case TPTR64: - // NOTE: Any changes here need to be made to reflect.PtrTo as well. - if(*off % widthptr != 0) - fatal("dgcsym1: invalid alignment, %T", t); - - // NOTE(rsc): Emitting GC_APTR here for *nonptrtype - // (pointer to non-pointer-containing type) means that - // we do not record 'nonptrtype' and instead tell the - // garbage collector to look up the type of the memory in - // type information stored in the heap. In effect we are telling - // the collector "we don't trust our information - use yours". - // It's not completely clear why we want to do this. - // It does have the effect that if you have a *SliceHeader and a *[]int - // pointing at the same actual slice header, *SliceHeader will not be - // used as an authoritative type for the memory, which is good: - // if the collector scanned the memory as type *SliceHeader, it would - // see no pointers inside but mark the block as scanned, preventing - // the seeing of pointers when we followed the *[]int pointer. - // Perhaps that kind of situation is the rationale. - if(!haspointers(t->type)) { - ot = duintptr(s, ot, GC_APTR); - ot = duintptr(s, ot, *off); - } else { - ot = duintptr(s, ot, GC_PTR); - ot = duintptr(s, ot, *off); - ot = dsymptr(s, ot, dgcsym(t->type), 0); - } - *off += t->width; - break; - case TUNSAFEPTR: case TFUNC: - if(*off % widthptr != 0) - fatal("dgcsym1: invalid alignment, %T", t); - ot = duintptr(s, ot, GC_APTR); - ot = duintptr(s, ot, *off); - *off += t->width; - break; - - // struct Hchan* case TCHAN: - // NOTE: Any changes here need to be made to reflect.ChanOf as well. - if(*off % widthptr != 0) - fatal("dgcsym1: invalid alignment, %T", t); - ot = duintptr(s, ot, GC_CHAN_PTR); - ot = duintptr(s, ot, *off); - ot = dsymptr(s, ot, dtypesym(t), 0); - *off += t->width; - break; - - // struct Hmap* case TMAP: - // NOTE: Any changes here need to be made to reflect.MapOf as well. - if(*off % widthptr != 0) - fatal("dgcsym1: invalid alignment, %T", t); - ot = duintptr(s, ot, GC_PTR); - ot = duintptr(s, ot, *off); - ot = dsymptr(s, ot, dgcsym(hmap(t)), 0); - *off += t->width; + proggendata(g, BitsPointer); + *xoffset += t->width; break; - - // struct { byte *str; int32 len; } case TSTRING: - if(*off % widthptr != 0) - fatal("dgcsym1: invalid alignment, %T", t); - ot = duintptr(s, ot, GC_STRING); - ot = duintptr(s, ot, *off); - *off += t->width; + proggendata(g, BitsPointer); + proggendata(g, BitsScalar); + *xoffset += t->width; break; - - // struct { Itab* tab; void* data; } - // struct { Type* type; void* data; } // When isnilinter(t)==true case TINTER: - if(*off % widthptr != 0) - fatal("dgcsym1: invalid alignment, %T", t); - if(isnilinter(t)) { - ot = duintptr(s, ot, GC_EFACE); - ot = duintptr(s, ot, *off); - } else { - ot = duintptr(s, ot, GC_IFACE); - ot = duintptr(s, ot, *off); - } - *off += t->width; + proggendata(g, BitsMultiWord); + if(isnilinter(t)) + proggendata(g, BitsEface); + else + proggendata(g, BitsIface); + *xoffset += t->width; break; - case TARRAY: - if(t->bound < -1) - fatal("dgcsym1: invalid bound, %T", t); - if(t->type->width == BADWIDTH) - dowidth(t->type); if(isslice(t)) { - // NOTE: Any changes here need to be made to reflect.SliceOf as well. - // struct { byte* array; uint32 len; uint32 cap; } - if(*off % widthptr != 0) - fatal("dgcsym1: invalid alignment, %T", t); - if(t->type->width != 0) { - ot = duintptr(s, ot, GC_SLICE); - ot = duintptr(s, ot, *off); - ot = dsymptr(s, ot, dgcsym(t->type), 0); - } else { - ot = duintptr(s, ot, GC_APTR); - ot = duintptr(s, ot, *off); - } - *off += t->width; + proggendata(g, BitsPointer); + proggendata(g, BitsScalar); + proggendata(g, BitsScalar); } else { - // NOTE: Any changes here need to be made to reflect.ArrayOf as well, - // at least once ArrayOf's gc info is implemented and ArrayOf is exported. - // struct { byte* array; uint32 len; uint32 cap; } - if(t->bound < 1 || !haspointers(t->type)) { - *off += t->width; - } else if(gcinline(t)) { - for(i=0; i<t->bound; i++) - ot = dgcsym1(s, ot, t->type, off, stack_size); // recursive call of dgcsym1 + t1 = t->type; + if(t1->width == 0) { + // ignore + } if(t->bound <= 1 || t->bound*t1->width < 32*widthptr) { + for(i = 0; i < t->bound; i++) + gengcprog1(g, t1, xoffset); + } else if(!haspointers(t1)) { + n = t->width; + n -= -*xoffset&(widthptr-1); // skip to next ptr boundary + proggenarray(g, (n+widthptr-1)/widthptr); + proggendata(g, BitsScalar); + proggenarrayend(g); + *xoffset -= (n+widthptr-1)/widthptr*widthptr - t->width; } else { - if(stack_size < GC_STACK_CAPACITY) { - ot = duintptr(s, ot, GC_ARRAY_START); // a stack push during GC - ot = duintptr(s, ot, *off); - ot = duintptr(s, ot, t->bound); - ot = duintptr(s, ot, t->type->width); - off2 = 0; - ot = dgcsym1(s, ot, t->type, &off2, stack_size+1); // recursive call of dgcsym1 - ot = duintptr(s, ot, GC_ARRAY_NEXT); // a stack pop during GC - } else { - ot = duintptr(s, ot, GC_REGION); - ot = duintptr(s, ot, *off); - ot = duintptr(s, ot, t->width); - ot = dsymptr(s, ot, dgcsym(t), 0); - } - *off += t->width; + proggenarray(g, t->bound); + gengcprog1(g, t1, xoffset); + *xoffset += (t->bound-1)*t1->width; + proggenarrayend(g); } } break; - case TSTRUCT: o = 0; - for(t1=t->type; t1!=T; t1=t1->down) { + for(t1 = t->type; t1 != T; t1 = t1->down) { fieldoffset = t1->width; - *off += fieldoffset - o; - ot = dgcsym1(s, ot, t1->type, off, stack_size); // recursive call of dgcsym1 + proggenskip(g, *xoffset, fieldoffset - o); + *xoffset += fieldoffset - o; + gengcprog1(g, t1->type, xoffset); o = fieldoffset + t1->type->width; } - *off += t->width - o; + proggenskip(g, *xoffset, t->width - o); + *xoffset += t->width - o; break; - default: - fatal("dgcsym1: unexpected type %T", t); + fatal("gengcprog1: unexpected type, %T", t); } - - return ot; -} - -static Sym* -dgcsym(Type *t) -{ - int ot; - vlong off; - Sym *s; - - s = typesymprefix(".gc", t); - if(s->flags & SymGcgen) - return s; - s->flags |= SymGcgen; - - if(t->width == BADWIDTH) - dowidth(t); - - ot = 0; - off = 0; - ot = duintptr(s, ot, t->width); - ot = dgcsym1(s, ot, t, &off, 0); - ot = duintptr(s, ot, GC_END); - ggloblsym(s, ot, 1, 1); - - if(t->align > 0) - off = rnd(off, t->align); - if(off != t->width) - fatal("dgcsym: off=%lld, size=%lld, type %T", off, t->width, t); - - return s; } diff --git a/src/cmd/gc/runtime.go b/src/cmd/gc/runtime.go index fb5c2a150..0fb15c265 100644 --- a/src/cmd/gc/runtime.go +++ b/src/cmd/gc/runtime.go @@ -12,7 +12,7 @@ package PACKAGE // emitted by compiler, not referred to by go programs -func new(typ *byte) *any +func newobject(typ *byte) *any func panicindex() func panicslice() func panicdivide() @@ -20,12 +20,13 @@ func throwreturn() func throwinit() func panicwrap(string, string, string) -func panic(interface{}) -func recover(*int32) interface{} +func gopanic(interface{}) +func gorecover(*int32) interface{} func printbool(bool) func printfloat(float64) func printint(int64) +func printhex(uint64) func printuint(uint64) func printcomplex(complex128) func printstring(string) @@ -35,7 +36,6 @@ func printeface(any) func printslice(any) func printnl() func printsp() -func goprintf() func concatstring2(string, string) string func concatstring3(string, string, string) string @@ -53,7 +53,7 @@ func stringtoslicebyte(string) []byte func stringtoslicerune(string) []rune func stringiter(string, int) int func stringiter2(string, int) (retk int, retv rune) -func copy(to any, fr any, wid uintptr) int +func slicecopy(to any, fr any, wid uintptr) int func slicestringcopy(to any, fr any) int // interface conversions @@ -84,8 +84,6 @@ func efaceeq(i1 any, i2 any) (ret bool) func ifacethash(i1 any) (ret uint32) func efacethash(i1 any) (ret uint32) -func equal(typ *byte, x1, x2 any) (ret bool) - // *byte is really *runtime.Type func makemap(mapType *byte, hint int64) (hmap map[any]any) func mapaccess1(mapType *byte, hmap map[any]any, key *any) (val *any) @@ -108,11 +106,25 @@ func chanrecv2(chanType *byte, hchan <-chan any, elem *any) bool func chansend1(chanType *byte, hchan chan<- any, elem *any) func closechan(hchan any) +// *byte is really *runtime.Type +func writebarrierptr(dst *any, src any) +func writebarrierstring(dst *any, src any) +func writebarrierslice(dst *any, src any) +func writebarrieriface(dst *any, src any) + +// The unused *byte argument makes sure that src is 2-pointer-aligned, +// which is the maximum alignment on NaCl amd64p32 +// (and possibly on 32-bit systems if we start 64-bit aligning uint64s). +func writebarrierfat2(dst *any, _ *byte, src any) +func writebarrierfat3(dst *any, _ *byte, src any) +func writebarrierfat4(dst *any, _ *byte, src any) +func writebarrierfat(typ *byte, dst *any, src *any) + func selectnbsend(chanType *byte, hchan chan<- any, elem *any) bool func selectnbrecv(chanType *byte, elem *any, hchan <-chan any) bool func selectnbrecv2(chanType *byte, elem *any, received *bool, hchan <-chan any) bool -func newselect(size int32) (sel *byte) +func newselect(sel *byte, selsize int64, size int32) func selectsend(sel *byte, hchan chan<- any, elem *any) (selected bool) func selectrecv(sel *byte, hchan <-chan any, elem *any) (selected bool) func selectrecv2(sel *byte, hchan <-chan any, elem *any, received *bool) (selected bool) @@ -124,12 +136,12 @@ func makeslice(typ *byte, nel int64, cap int64) (ary []any) func growslice(typ *byte, old []any, n int64) (ary []any) func memmove(to *any, frm *any, length uintptr) -func memequal(eq *bool, size uintptr, x, y *any) -func memequal8(eq *bool, size uintptr, x, y *any) -func memequal16(eq *bool, size uintptr, x, y *any) -func memequal32(eq *bool, size uintptr, x, y *any) -func memequal64(eq *bool, size uintptr, x, y *any) -func memequal128(eq *bool, size uintptr, x, y *any) +func memequal(x, y *any, size uintptr) bool +func memequal8(x, y *any, size uintptr) bool +func memequal16(x, y *any, size uintptr) bool +func memequal32(x, y *any, size uintptr) bool +func memequal64(x, y *any, size uintptr) bool +func memequal128(x, y *any, size uintptr) bool // only used on 32-bit func int64div(int64, int64) int64 diff --git a/src/cmd/gc/select.c b/src/cmd/gc/select.c index 58a120674..965ad277f 100644 --- a/src/cmd/gc/select.c +++ b/src/cmd/gc/select.c @@ -10,6 +10,8 @@ #include <libc.h> #include "go.h" +static Type* selecttype(int32 size); + void typecheckselect(Node *sel) { @@ -95,7 +97,7 @@ void walkselect(Node *sel) { int lno, i; - Node *n, *r, *a, *var, *cas, *dflt, *ch; + Node *n, *r, *a, *var, *selv, *cas, *dflt, *ch; NodeList *l, *init; if(sel->list == nil && sel->xoffset != 0) @@ -257,8 +259,12 @@ walkselect(Node *sel) // generate sel-struct setlineno(sel); - var = temp(ptrto(types[TUINT8])); - r = nod(OAS, var, mkcall("newselect", var->type, nil, nodintconst(sel->xoffset))); + selv = temp(selecttype(sel->xoffset)); + r = nod(OAS, selv, N); + typecheck(&r, Etop); + init = list(init, r); + var = conv(conv(nod(OADDR, selv, N), types[TUNSAFEPTR]), ptrto(types[TUINT8])); + r = mkcall("newselect", T, nil, var, nodintconst(selv->type->width), nodintconst(sel->xoffset)); typecheck(&r, Etop); init = list(init, r); @@ -301,6 +307,8 @@ walkselect(Node *sel) break; } } + // selv is no longer alive after use. + r->nbody = list(r->nbody, nod(OVARKILL, selv, N)); r->nbody = concat(r->nbody, cas->nbody); r->nbody = list(r->nbody, nod(OBREAK, N, N)); init = list(init, r); @@ -316,3 +324,54 @@ out: walkstmtlist(sel->nbody); lineno = lno; } + +// Keep in sync with src/runtime/chan.h. +static Type* +selecttype(int32 size) +{ + Node *sel, *sudog, *scase, *arr; + + // TODO(dvyukov): it's possible to generate SudoG and Scase only once + // and then cache; and also cache Select per size. + sudog = nod(OTSTRUCT, N, N); + sudog->list = list(sudog->list, nod(ODCLFIELD, newname(lookup("g")), typenod(ptrto(types[TUINT8])))); + sudog->list = list(sudog->list, nod(ODCLFIELD, newname(lookup("selectdone")), typenod(ptrto(types[TUINT8])))); + sudog->list = list(sudog->list, nod(ODCLFIELD, newname(lookup("link")), typenod(ptrto(types[TUINT8])))); + sudog->list = list(sudog->list, nod(ODCLFIELD, newname(lookup("prev")), typenod(ptrto(types[TUINT8])))); + sudog->list = list(sudog->list, nod(ODCLFIELD, newname(lookup("elem")), typenod(ptrto(types[TUINT8])))); + sudog->list = list(sudog->list, nod(ODCLFIELD, newname(lookup("releasetime")), typenod(types[TUINT64]))); + sudog->list = list(sudog->list, nod(ODCLFIELD, newname(lookup("nrelease")), typenod(types[TINT32]))); + sudog->list = list(sudog->list, nod(ODCLFIELD, newname(lookup("waitlink")), typenod(ptrto(types[TUINT8])))); + typecheck(&sudog, Etype); + sudog->type->noalg = 1; + sudog->type->local = 1; + + scase = nod(OTSTRUCT, N, N); + scase->list = list(scase->list, nod(ODCLFIELD, newname(lookup("elem")), typenod(ptrto(types[TUINT8])))); + scase->list = list(scase->list, nod(ODCLFIELD, newname(lookup("chan")), typenod(ptrto(types[TUINT8])))); + scase->list = list(scase->list, nod(ODCLFIELD, newname(lookup("pc")), typenod(types[TUINTPTR]))); + scase->list = list(scase->list, nod(ODCLFIELD, newname(lookup("kind")), typenod(types[TUINT16]))); + scase->list = list(scase->list, nod(ODCLFIELD, newname(lookup("so")), typenod(types[TUINT16]))); + scase->list = list(scase->list, nod(ODCLFIELD, newname(lookup("receivedp")), typenod(ptrto(types[TUINT8])))); + scase->list = list(scase->list, nod(ODCLFIELD, newname(lookup("releasetime")), typenod(types[TUINT64]))); + typecheck(&scase, Etype); + scase->type->noalg = 1; + scase->type->local = 1; + + sel = nod(OTSTRUCT, N, N); + sel->list = list(sel->list, nod(ODCLFIELD, newname(lookup("tcase")), typenod(types[TUINT16]))); + sel->list = list(sel->list, nod(ODCLFIELD, newname(lookup("ncase")), typenod(types[TUINT16]))); + sel->list = list(sel->list, nod(ODCLFIELD, newname(lookup("pollorder")), typenod(ptrto(types[TUINT8])))); + sel->list = list(sel->list, nod(ODCLFIELD, newname(lookup("lockorder")), typenod(ptrto(types[TUINT8])))); + arr = nod(OTARRAY, nodintconst(size), scase); + sel->list = list(sel->list, nod(ODCLFIELD, newname(lookup("scase")), arr)); + arr = nod(OTARRAY, nodintconst(size), typenod(ptrto(types[TUINT8]))); + sel->list = list(sel->list, nod(ODCLFIELD, newname(lookup("lockorderarr")), arr)); + arr = nod(OTARRAY, nodintconst(size), typenod(types[TUINT16])); + sel->list = list(sel->list, nod(ODCLFIELD, newname(lookup("pollorderarr")), arr)); + typecheck(&sel, Etype); + sel->type->noalg = 1; + sel->type->local = 1; + + return sel->type; +} diff --git a/src/cmd/gc/sinit.c b/src/cmd/gc/sinit.c index 59804cd8d..8ad7ae7ab 100644 --- a/src/cmd/gc/sinit.c +++ b/src/cmd/gc/sinit.c @@ -17,7 +17,6 @@ enum InitPending = 2, }; -static int iszero(Node*); static void initplan(Node*); static NodeList *initlist; static void init2(Node*, NodeList**); @@ -207,7 +206,7 @@ init2(Node *n, NodeList **out) if(n->op == OCLOSURE) init2list(n->closure->nbody, out); - if(n->op == ODOTMETH) + if(n->op == ODOTMETH || n->op == OCALLPART) init2(n->type->nname, out); } @@ -633,11 +632,14 @@ structlit(int ctxt, int pass, Node *n, Node *var, NodeList **init) a = nod(ODOT, var, newname(index->sym)); a = nod(OAS, a, value); typecheck(&a, Etop); - walkexpr(&a, init); if(pass == 1) { + walkexpr(&a, init); // add any assignments in r to top if(a->op != OAS) fatal("structlit: not as"); a->dodata = 2; + } else { + orderstmtinplace(&a); + walkstmt(&a); } *init = list(*init, a); } @@ -693,11 +695,14 @@ arraylit(int ctxt, int pass, Node *n, Node *var, NodeList **init) a = nod(OINDEX, var, index); a = nod(OAS, a, value); typecheck(&a, Etop); - walkexpr(&a, init); // add any assignments in r to top if(pass == 1) { + walkexpr(&a, init); if(a->op != OAS) - fatal("structlit: not as"); + fatal("arraylit: not as"); a->dodata = 2; + } else { + orderstmtinplace(&a); + walkstmt(&a); } *init = list(*init, a); } @@ -807,7 +812,8 @@ slicelit(int ctxt, Node *n, Node *var, NodeList **init) // make slice out of heap (5) a = nod(OAS, var, nod(OSLICE, vauto, nod(OKEY, N, N))); typecheck(&a, Etop); - walkexpr(&a, init); + orderstmtinplace(&a); + walkstmt(&a); *init = list(*init, a); // put dynamics into slice (6) @@ -839,7 +845,8 @@ slicelit(int ctxt, Node *n, Node *var, NodeList **init) // build list of var[c] = expr a = nod(OAS, a, value); typecheck(&a, Etop); - walkexpr(&a, init); + orderstmtinplace(&a); + walkstmt(&a); *init = list(*init, a); } } @@ -1060,7 +1067,7 @@ anylit(int ctxt, Node *n, Node *var, NodeList **init) if(t->etype != TSTRUCT) fatal("anylit: not struct"); - if(simplename(var)) { + if(simplename(var) && count(n->list) > 4) { if(ctxt == 0) { // lay out static data @@ -1083,7 +1090,7 @@ anylit(int ctxt, Node *n, Node *var, NodeList **init) } // initialize of not completely specified - if(count(n->list) < structcount(t)) { + if(simplename(var) || count(n->list) < structcount(t)) { a = nod(OAS, var, N); typecheck(&a, Etop); walkexpr(&a, init); @@ -1100,7 +1107,7 @@ anylit(int ctxt, Node *n, Node *var, NodeList **init) break; } - if(simplename(var)) { + if(simplename(var) && count(n->list) > 4) { if(ctxt == 0) { // lay out static data @@ -1123,7 +1130,7 @@ anylit(int ctxt, Node *n, Node *var, NodeList **init) } // initialize of not completely specified - if(count(n->list) < t->bound) { + if(simplename(var) || count(n->list) < t->bound) { a = nod(OAS, var, N); typecheck(&a, Etop); walkexpr(&a, init); @@ -1348,7 +1355,6 @@ no: return 0; } -static int iszero(Node*); static int isvaluelit(Node*); static InitEntry* entry(InitPlan*); static void addvalue(InitPlan*, vlong, Node*, Node*); @@ -1432,7 +1438,7 @@ addvalue(InitPlan *p, vlong xoffset, Node *key, Node *n) e->expr = n; } -static int +int iszero(Node *n) { NodeList *l; diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index 72a9ac20c..c3bc5af3b 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -529,7 +529,8 @@ algtype1(Type *t, Type **bad) if(bad) *bad = T; - + if(t->broke) + return AMEM; if(t->noalg) return ANOEQ; @@ -656,11 +657,15 @@ maptype(Type *key, Type *val) { Type *t; Type *bad; - int atype; + int atype, mtype; if(key != nil) { atype = algtype1(key, &bad); - switch(bad == T ? key->etype : bad->etype) { + if(bad == T) + mtype = key->etype; + else + mtype = bad->etype; + switch(mtype) { default: if(atype == ANOEQ) yyerror("invalid map key type %T", key); @@ -2625,9 +2630,10 @@ hashmem(Type *t) n = newname(sym); n->class = PFUNC; tfn = nod(OTFUNC, N, N); - tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(ptrto(types[TUINTPTR])))); - tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(ptrto(t)))); + tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); + tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); + tfn->rlist = list(tfn->rlist, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); typecheck(&tfn, Etype); n->type = tfn->type; return n; @@ -2673,9 +2679,10 @@ hashfor(Type *t) n = newname(sym); n->class = PFUNC; tfn = nod(OTFUNC, N, N); - tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(ptrto(types[TUINTPTR])))); - tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(ptrto(t)))); + tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); + tfn->list = list(tfn->list, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); + tfn->rlist = list(tfn->rlist, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); typecheck(&tfn, Etype); n->type = tfn->type; return n; @@ -2687,7 +2694,7 @@ hashfor(Type *t) void genhash(Sym *sym, Type *t) { - Node *n, *fn, *np, *nh, *ni, *call, *nx, *na, *tfn; + Node *n, *fn, *np, *nh, *ni, *call, *nx, *na, *tfn, *r; Node *hashel; Type *first, *t1; int old_safemode; @@ -2700,21 +2707,23 @@ genhash(Sym *sym, Type *t) dclcontext = PEXTERN; markdcl(); - // func sym(h *uintptr, s uintptr, p *T) + // func sym(p *T, s uintptr, h uintptr) uintptr fn = nod(ODCLFUNC, N, N); fn->nname = newname(sym); fn->nname->class = PFUNC; tfn = nod(OTFUNC, N, N); fn->nname->ntype = tfn; - n = nod(ODCLFIELD, newname(lookup("h")), typenod(ptrto(types[TUINTPTR]))); + n = nod(ODCLFIELD, newname(lookup("p")), typenod(ptrto(t))); tfn->list = list(tfn->list, n); - nh = n->left; + np = n->left; n = nod(ODCLFIELD, newname(lookup("s")), typenod(types[TUINTPTR])); tfn->list = list(tfn->list, n); - n = nod(ODCLFIELD, newname(lookup("p")), typenod(ptrto(t))); + n = nod(ODCLFIELD, newname(lookup("h")), typenod(types[TUINTPTR])); tfn->list = list(tfn->list, n); - np = n->left; + nh = n->left; + n = nod(ODCLFIELD, N, typenod(types[TUINTPTR])); // return value + tfn->rlist = list(tfn->rlist, n); funchdr(fn); typecheck(&fn->nname->ntype, Etype); @@ -2740,15 +2749,17 @@ genhash(Sym *sym, Type *t) colasdefn(n->list, n); ni = n->list->n; - // *h = *h<<3 | *h>>61 + // TODO: with aeshash we don't need these shift/mul parts + + // h = h<<3 | h>>61 n->nbody = list(n->nbody, nod(OAS, - nod(OIND, nh, N), + nh, nod(OOR, - nod(OLSH, nod(OIND, nh, N), nodintconst(3)), - nod(ORSH, nod(OIND, nh, N), nodintconst(widthptr*8-3))))); + nod(OLSH, nh, nodintconst(3)), + nod(ORSH, nh, nodintconst(widthptr*8-3))))); - // *h *= mul + // h *= mul // Same multipliers as in runtime.memhash. if(widthptr == 4) mul = 3267000013LL; @@ -2756,19 +2767,19 @@ genhash(Sym *sym, Type *t) mul = 23344194077549503LL; n->nbody = list(n->nbody, nod(OAS, - nod(OIND, nh, N), - nod(OMUL, nod(OIND, nh, N), nodintconst(mul)))); + nh, + nod(OMUL, nh, nodintconst(mul)))); - // hashel(h, sizeof(p[i]), &p[i]) + // h = hashel(&p[i], sizeof(p[i]), h) call = nod(OCALL, hashel, N); - call->list = list(call->list, nh); - call->list = list(call->list, nodintconst(t->type->width)); nx = nod(OINDEX, np, ni); nx->bounded = 1; na = nod(OADDR, nx, N); na->etype = 1; // no escape to heap call->list = list(call->list, na); - n->nbody = list(n->nbody, call); + call->list = list(call->list, nodintconst(t->type->width)); + call->list = list(call->list, nh); + n->nbody = list(n->nbody, nod(OAS, nh, call)); fn->nbody = list(fn->nbody, n); break; @@ -2793,15 +2804,15 @@ genhash(Sym *sym, Type *t) if(first != T) { size = offend - first->width; // first->width is offset hashel = hashmem(first->type); - // hashel(h, size, &p.first) + // h = hashel(&p.first, size, h) call = nod(OCALL, hashel, N); - call->list = list(call->list, nh); - call->list = list(call->list, nodintconst(size)); nx = nod(OXDOT, np, newname(first->sym)); // TODO: fields from other packages? na = nod(OADDR, nx, N); na->etype = 1; // no escape to heap call->list = list(call->list, na); - fn->nbody = list(fn->nbody, call); + call->list = list(call->list, nodintconst(size)); + call->list = list(call->list, nh); + fn->nbody = list(fn->nbody, nod(OAS, nh, call)); first = T; } @@ -2812,20 +2823,21 @@ genhash(Sym *sym, Type *t) // Run hash for this field. hashel = hashfor(t1->type); - // hashel(h, size, &p.t1) + // h = hashel(&p.t1, size, h) call = nod(OCALL, hashel, N); - call->list = list(call->list, nh); - call->list = list(call->list, nodintconst(t1->type->width)); nx = nod(OXDOT, np, newname(t1->sym)); // TODO: fields from other packages? na = nod(OADDR, nx, N); na->etype = 1; // no escape to heap call->list = list(call->list, na); - fn->nbody = list(fn->nbody, call); + call->list = list(call->list, nodintconst(t1->type->width)); + call->list = list(call->list, nh); + fn->nbody = list(fn->nbody, nod(OAS, nh, call)); } - // make sure body is not empty. - fn->nbody = list(fn->nbody, nod(ORETURN, N, N)); break; } + r = nod(ORETURN, N, N); + r->list = list(r->list, nh); + fn->nbody = list(fn->nbody, r); if(debug['r']) dumplist("genhash body", fn->nbody); @@ -2849,18 +2861,19 @@ genhash(Sym *sym, Type *t) } // Return node for -// if p.field != q.field { *eq = false; return } +// if p.field != q.field { return false } static Node* -eqfield(Node *p, Node *q, Node *field, Node *eq) +eqfield(Node *p, Node *q, Node *field) { - Node *nif, *nx, *ny; + Node *nif, *nx, *ny, *r; nx = nod(OXDOT, p, field); ny = nod(OXDOT, q, field); nif = nod(OIF, N, N); nif->ntest = nod(ONE, nx, ny); - nif->nbody = list(nif->nbody, nod(OAS, nod(OIND, eq, N), nodbool(0))); - nif->nbody = list(nif->nbody, nod(ORETURN, N, N)); + r = nod(ORETURN, N, N); + r->list = list(r->list, nodbool(0)); + nif->nbody = list(nif->nbody, r); return nif; } @@ -2889,11 +2902,11 @@ eqmemfunc(vlong size, Type *type) } // Return node for -// if memequal(size, &p.field, &q.field, eq); !*eq { return } +// if !memequal(&p.field, &q.field, size) { return false } static Node* -eqmem(Node *p, Node *q, Node *field, vlong size, Node *eq) +eqmem(Node *p, Node *q, Node *field, vlong size) { - Node *nif, *nx, *ny, *call; + Node *nif, *nx, *ny, *call, *r; nx = nod(OADDR, nod(OXDOT, p, field), N); nx->etype = 1; // does not escape @@ -2903,15 +2916,16 @@ eqmem(Node *p, Node *q, Node *field, vlong size, Node *eq) typecheck(&ny, Erv); call = nod(OCALL, eqmemfunc(size, nx->type->type), N); - call->list = list(call->list, eq); - call->list = list(call->list, nodintconst(size)); call->list = list(call->list, nx); call->list = list(call->list, ny); + call->list = list(call->list, nodintconst(size)); nif = nod(OIF, N, N); nif->ninit = list(nif->ninit, call); - nif->ntest = nod(ONOT, nod(OIND, eq, N), N); - nif->nbody = list(nif->nbody, nod(ORETURN, N, N)); + nif->ntest = nod(ONOT, call, N); + r = nod(ORETURN, N, N); + r->list = list(r->list, nodbool(0)); + nif->nbody = list(nif->nbody, r); return nif; } @@ -2921,7 +2935,7 @@ eqmem(Node *p, Node *q, Node *field, vlong size, Node *eq) void geneq(Sym *sym, Type *t) { - Node *n, *fn, *np, *neq, *nq, *tfn, *nif, *ni, *nx, *ny, *nrange; + Node *n, *fn, *np, *nq, *tfn, *nif, *ni, *nx, *ny, *nrange, *r; Type *t1, *first; int old_safemode; int64 size; @@ -2934,24 +2948,23 @@ geneq(Sym *sym, Type *t) dclcontext = PEXTERN; markdcl(); - // func sym(eq *bool, s uintptr, p, q *T) + // func sym(p, q *T, s uintptr) bool fn = nod(ODCLFUNC, N, N); fn->nname = newname(sym); fn->nname->class = PFUNC; tfn = nod(OTFUNC, N, N); fn->nname->ntype = tfn; - n = nod(ODCLFIELD, newname(lookup("eq")), typenod(ptrto(types[TBOOL]))); - tfn->list = list(tfn->list, n); - neq = n->left; - n = nod(ODCLFIELD, newname(lookup("s")), typenod(types[TUINTPTR])); - tfn->list = list(tfn->list, n); n = nod(ODCLFIELD, newname(lookup("p")), typenod(ptrto(t))); tfn->list = list(tfn->list, n); np = n->left; n = nod(ODCLFIELD, newname(lookup("q")), typenod(ptrto(t))); tfn->list = list(tfn->list, n); nq = n->left; + n = nod(ODCLFIELD, newname(lookup("s")), typenod(types[TUINTPTR])); + tfn->list = list(tfn->list, n); + n = nod(ODCLFIELD, N, typenod(types[TBOOL])); + tfn->rlist = list(tfn->rlist, n); funchdr(fn); @@ -2977,7 +2990,7 @@ geneq(Sym *sym, Type *t) colasdefn(nrange->list, nrange); ni = nrange->list->n; - // if p[i] != q[i] { *eq = false; return } + // if p[i] != q[i] { return false } nx = nod(OINDEX, np, ni); nx->bounded = 1; ny = nod(OINDEX, nq, ni); @@ -2985,13 +2998,11 @@ geneq(Sym *sym, Type *t) nif = nod(OIF, N, N); nif->ntest = nod(ONE, nx, ny); - nif->nbody = list(nif->nbody, nod(OAS, nod(OIND, neq, N), nodbool(0))); - nif->nbody = list(nif->nbody, nod(ORETURN, N, N)); + r = nod(ORETURN, N, N); + r->list = list(r->list, nodbool(0)); + nif->nbody = list(nif->nbody, r); nrange->nbody = list(nrange->nbody, nif); fn->nbody = list(fn->nbody, nrange); - - // *eq = true; - fn->nbody = list(fn->nbody, nod(OAS, nod(OIND, neq, N), nodbool(1))); break; case TSTRUCT: @@ -3016,16 +3027,16 @@ geneq(Sym *sym, Type *t) // cross-package unexported fields. if(first != T) { if(first->down == t1) { - fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym), neq)); + fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym))); } else if(first->down->down == t1) { - fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym), neq)); + fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym))); first = first->down; if(!isblanksym(first->sym)) - fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym), neq)); + fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym))); } else { // More than two fields: use memequal. size = offend - first->width; // first->width is offset - fn->nbody = list(fn->nbody, eqmem(np, nq, newname(first->sym), size, neq)); + fn->nbody = list(fn->nbody, eqmem(np, nq, newname(first->sym), size)); } first = T; } @@ -3035,14 +3046,17 @@ geneq(Sym *sym, Type *t) continue; // Check this field, which is not just memory. - fn->nbody = list(fn->nbody, eqfield(np, nq, newname(t1->sym), neq)); + fn->nbody = list(fn->nbody, eqfield(np, nq, newname(t1->sym))); } - // *eq = true; - fn->nbody = list(fn->nbody, nod(OAS, nod(OIND, neq, N), nodbool(1))); break; } + // return true + r = nod(ORETURN, N, N); + r->list = list(r->list, nodbool(1)); + fn->nbody = list(fn->nbody, r); + if(debug['r']) dumplist("geneq body", fn->nbody); @@ -3445,7 +3459,7 @@ smagic(Magic *m) mask = 0xffffffffLL; break; case 64: - mask = 0xffffffffffffffffLL; + mask = 0xffffffffffffffffULL; break; } two31 = mask ^ (mask>>1); @@ -3453,7 +3467,7 @@ smagic(Magic *m) p = m->w-1; ad = m->sd; if(m->sd < 0) - ad = -m->sd; + ad = -(uvlong)m->sd; // bad denominators if(ad == 0 || ad == 1 || ad == two31) { @@ -3543,7 +3557,7 @@ umagic(Magic *m) mask = 0xffffffffLL; break; case 64: - mask = 0xffffffffffffffffLL; + mask = 0xffffffffffffffffULL; break; } two31 = mask ^ (mask>>1); @@ -3628,7 +3642,7 @@ ngotype(Node *n) * users if we escape that as little as possible. * * If you edit this, edit ../ld/lib.c:/^pathtoprefix too. - * If you edit this, edit ../../pkg/debug/goobj/read.go:/importPathToPrefix too. + * If you edit this, edit ../../debug/goobj/read.go:/importPathToPrefix too. */ static char* pathtoprefix(char *s) @@ -3785,3 +3799,42 @@ checknil(Node *x, NodeList **init) n->typecheck = 1; *init = list(*init, n); } + +/* + * Can this type be stored directly in an interface word? + */ +int +isdirectiface(Type *t) +{ + // Setting IfacePointerOnly = 1 changes the + // interface representation so that the data word + // in an interface value must always be a pointer. + // Setting it to 0 uses the original representation, + // where the data word can hold a pointer or any + // non-pointer value no bigger than a pointer. + enum { + IfacePointerOnly = 1, + }; + + if(IfacePointerOnly) { + switch(t->etype) { + case TPTR32: + case TPTR64: + case TCHAN: + case TMAP: + case TFUNC: + case TUNSAFEPTR: + return 1; + case TARRAY: + // Array of 1 direct iface type can be direct. + return t->bound == 1 && isdirectiface(t->type); + case TSTRUCT: + // Struct with 1 field of direct iface type can be direct. + return t->type != T && t->type->down == T && isdirectiface(t->type->type); + } + return 0; + } + + dowidth(t); + return t->width <= widthptr; +} diff --git a/src/cmd/gc/swt.c b/src/cmd/gc/swt.c index ce0190507..e1d8af878 100644 --- a/src/cmd/gc/swt.c +++ b/src/cmd/gc/swt.c @@ -34,6 +34,7 @@ struct Case Case* link; // linked list to link }; #define C ((Case*)nil) +/*c2go Case *C; */ void dumpcase(Case *c0) diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c index c50b2285b..714c66268 100644 --- a/src/cmd/gc/typecheck.c +++ b/src/cmd/gc/typecheck.c @@ -33,7 +33,7 @@ static void stringtoarraylit(Node**); static Node* resolve(Node*); static void checkdefergo(Node*); static int checkmake(Type*, char*, Node*); -static int checksliceindex(Node*, Type*); +static int checksliceindex(Node*, Node*, Type*); static int checksliceconst(Node*, Node*); static NodeList* typecheckdefstack; @@ -311,6 +311,7 @@ typecheck1(Node **np, int top) Type *t, *tp, *missing, *have, *badtype; Val v; char *why, *desc, descbuf[64]; + vlong x; n = *np; @@ -382,16 +383,6 @@ reswitch: if(n->type == T) goto error; break; - - case OTPAREN: - ok |= Etype; - l = typecheck(&n->left, Etype); - if(l->type == T) - goto error; - n->op = OTYPE; - n->type = l->type; - n->left = N; - break; case OTARRAY: ok |= Etype; @@ -418,7 +409,10 @@ reswitch: v = toint(l->val); break; default: - yyerror("invalid array bound %N", l); + if(l->type != T && isint[l->type->etype] && l->op != OLITERAL) + yyerror("non-constant array bound %N", l); + else + yyerror("invalid array bound %N", l); goto error; } t->bound = mpgetfix(v.u.xval); @@ -535,19 +529,6 @@ reswitch: op = n->etype; goto arith; - case OADDPTR: - ok |= Erv; - l = typecheck(&n->left, Erv); - r = typecheck(&n->right, Erv); - if(l->type == T || r->type == T) - goto error; - if(l->type->etype != tptr) - fatal("bad OADDPTR left type %E for %N", l->type->etype, n->left); - if(r->type->etype != TUINTPTR) - fatal("bad OADDPTR right type %E for %N", r->type->etype, n->right); - n->type = types[tptr]; - goto ret; - case OADD: case OAND: case OANDAND: @@ -620,6 +601,10 @@ reswitch: } if(t->etype != TIDEAL && !eqtype(l->type, r->type)) { defaultlit2(&l, &r, 1); + if(n->op == OASOP && n->implicit) { + yyerror("invalid operation: %N (non-numeric type %T)", n, l->type); + goto error; + } yyerror("invalid operation: %N (mismatched types %T and %T)", n, l->type, r->type); goto error; } @@ -756,10 +741,6 @@ reswitch: l = n->left; if((t = l->type) == T) goto error; - // top&Eindir means this is &x in *&x. (or the arg to built-in print) - // n->etype means code generator flagged it as non-escaping. - if(debug['N'] && !(top & Eindir) && !n->etype) - addrescapes(n->left); n->type = ptrto(t); goto ret; @@ -915,11 +896,12 @@ reswitch: break; } if(isconst(n->right, CTINT)) { - if(mpgetfix(n->right->val.u.xval) < 0) + x = mpgetfix(n->right->val.u.xval); + if(x < 0) yyerror("invalid %s index %N (index must be non-negative)", why, n->right); - else if(isfixedarray(t) && t->bound > 0 && mpgetfix(n->right->val.u.xval) >= t->bound) + else if(isfixedarray(t) && t->bound > 0 && x >= t->bound) yyerror("invalid array index %N (out of bounds for %d-element array)", n->right, t->bound); - else if(isconst(n->left, CTSTR) && mpgetfix(n->right->val.u.xval) >= n->left->val.u.sval->len) + else if(isconst(n->left, CTSTR) && x >= n->left->val.u.sval->len) yyerror("invalid string index %N (out of bounds for %d-byte string)", n->right, n->left->val.u.sval->len); else if(mpcmpfixfix(n->right->val.u.xval, maxintval[TINT]) > 0) yyerror("invalid %s index %N (index too large)", why, n->right); @@ -1019,9 +1001,9 @@ reswitch: yyerror("cannot slice %N (type %T)", l, t); goto error; } - if((lo = n->right->left) != N && checksliceindex(lo, tp) < 0) + if((lo = n->right->left) != N && checksliceindex(l, lo, tp) < 0) goto error; - if((hi = n->right->right) != N && checksliceindex(hi, tp) < 0) + if((hi = n->right->right) != N && checksliceindex(l, hi, tp) < 0) goto error; if(checksliceconst(lo, hi) < 0) goto error; @@ -1068,11 +1050,11 @@ reswitch: yyerror("cannot slice %N (type %T)", l, t); goto error; } - if((lo = n->right->left) != N && checksliceindex(lo, tp) < 0) + if((lo = n->right->left) != N && checksliceindex(l, lo, tp) < 0) goto error; - if((mid = n->right->right->left) != N && checksliceindex(mid, tp) < 0) + if((mid = n->right->right->left) != N && checksliceindex(l, mid, tp) < 0) goto error; - if((hi = n->right->right->right) != N && checksliceindex(hi, tp) < 0) + if((hi = n->right->right->right) != N && checksliceindex(l, hi, tp) < 0) goto error; if(checksliceconst(lo, hi) < 0 || checksliceconst(lo, mid) < 0 || checksliceconst(mid, hi) < 0) goto error; @@ -1842,7 +1824,7 @@ out: } static int -checksliceindex(Node *r, Type *tp) +checksliceindex(Node *l, Node *r, Type *tp) { Type *t; @@ -1859,6 +1841,9 @@ checksliceindex(Node *r, Type *tp) } else if(tp != nil && tp->bound > 0 && mpgetfix(r->val.u.xval) > tp->bound) { yyerror("invalid slice index %N (out of bounds for %d-element array)", r, tp->bound); return -1; + } else if(isconst(l, CTSTR) && mpgetfix(r->val.u.xval) > l->val.u.sval->len) { + yyerror("invalid slice index %N (out of bounds for %d-byte string)", r, l->val.u.sval->len); + return -1; } else if(mpcmpfixfix(r->val.u.xval, maxintval[TINT]) > 0) { yyerror("invalid slice index %N (index too large)", r); return -1; @@ -2139,18 +2124,19 @@ lookdot(Node *n, Type *t, int dostrcmp) if(!eqtype(rcvr, tt)) { if(rcvr->etype == tptr && eqtype(rcvr->type, tt)) { checklvalue(n->left, "call pointer method on"); - if(debug['N']) - addrescapes(n->left); n->left = nod(OADDR, n->left, N); n->left->implicit = 1; typecheck(&n->left, Etype|Erv); - } else if(tt->etype == tptr && eqtype(tt->type, rcvr)) { + } else if(tt->etype == tptr && rcvr->etype != tptr && eqtype(tt->type, rcvr)) { n->left = nod(OIND, n->left, N); n->left->implicit = 1; typecheck(&n->left, Etype|Erv); - } else if(tt->etype == tptr && tt->type->etype == tptr && eqtype(derefall(tt), rcvr)) { + } else if(tt->etype == tptr && tt->type->etype == tptr && eqtype(derefall(tt), derefall(rcvr))) { yyerror("calling method %N with receiver %lN requires explicit dereference", n->right, n->left); while(tt->etype == tptr) { + // Stop one level early for method with pointer receiver. + if(rcvr->etype == tptr && tt->type->etype != tptr) + break; n->left = nod(OIND, n->left, N); n->left->implicit = 1; typecheck(&n->left, Etype|Erv); @@ -2831,6 +2817,33 @@ checkassignlist(NodeList *l) checkassign(l->n); } +// Check whether l and r are the same side effect-free expression, +// so that it is safe to reuse one instead of computing both. +static int +samesafeexpr(Node *l, Node *r) +{ + if(l->op != r->op || !eqtype(l->type, r->type)) + return 0; + + switch(l->op) { + case ONAME: + case OCLOSUREVAR: + return l == r; + + case ODOT: + case ODOTPTR: + return l->right != nil && r->right != nil && l->right->sym == r->right->sym && samesafeexpr(l->left, r->left); + + case OIND: + return samesafeexpr(l->left, r->left); + + case OINDEX: + return samesafeexpr(l->left, r->left) && samesafeexpr(l->right, r->right); + } + + return 0; +} + /* * type check assignment. * if this assignment is the definition of a var on the left side, @@ -2868,6 +2881,29 @@ typecheckas(Node *n) n->typecheck = 1; if(n->left->typecheck == 0) typecheck(&n->left, Erv | Easgn); + + // Recognize slices being updated in place, for better code generation later. + // Don't rewrite if using race detector, to avoid needing to teach race detector + // about this optimization. + if(n->left && n->left->op != OINDEXMAP && n->right && !flag_race) { + switch(n->right->op) { + case OSLICE: + case OSLICE3: + case OSLICESTR: + // For x = x[0:y], x can be updated in place, without touching pointer. + if(samesafeexpr(n->left, n->right->left) && (n->right->right->left == N || iszero(n->right->right->left))) + n->right->reslice = 1; + break; + + case OAPPEND: + // For x = append(x, ...), x can be updated in place when there is capacity, + // without touching the pointer; otherwise the emitted code to growslice + // can take care of updating the pointer, and only in that case. + if(n->right->list != nil && samesafeexpr(n->left, n->right->list->n)) + n->right->reslice = 1; + break; + } + } } static void @@ -2975,7 +3011,7 @@ typecheckas2(Node *n) if(l->defn == n) l->type = r->type; l = n->list->next->n; - if(l->type != T) + if(l->type != T && l->type->etype != TBOOL) checkassignto(types[TBOOL], l); if(l->defn == n && l->ntype == N) l->type = types[TBOOL]; diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index 1cb25512e..ff9b36208 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -5,8 +5,11 @@ #include <u.h> #include <libc.h> #include "go.h" +#include "../ld/textflag.h" -static Node* walkprint(Node*, NodeList**, int); +static Node* walkprint(Node*, NodeList**); +static Node* writebarrierfn(char*, Type*, Type*); +static Node* applywritebarrier(Node*, NodeList**); static Node* mapfn(char*, Type*); static Node* mapfndel(char*, Type*); static Node* ascompatee1(int, Node*, Node*, NodeList**); @@ -29,6 +32,7 @@ static void walkmul(Node**, NodeList**); static void walkdiv(Node**, NodeList**); static int bounded(Node*, int64); static Mpint mpzero; +static void walkprintfunc(Node**, NodeList**); void walk(Node *fn) @@ -134,6 +138,8 @@ walkstmt(Node **np) n = *np; if(n == N) return; + if(n->dodata == 2) // don't walk, generated by anylit. + return; setlineno(n); @@ -221,8 +227,7 @@ walkstmt(Node **np) switch(n->left->op) { case OPRINT: case OPRINTN: - walkexprlist(n->left->list, &n->ninit); - n->left = walkprint(n->left, &n->ninit, 1); + walkprintfunc(&n->left, &n->ninit); break; case OCOPY: n->left = copyany(n->left, &n->ninit, 1); @@ -255,8 +260,7 @@ walkstmt(Node **np) switch(n->left->op) { case OPRINT: case OPRINTN: - walkexprlist(n->left->list, &n->ninit); - n->left = walkprint(n->left, &n->ninit, 1); + walkprintfunc(&n->left, &n->ninit); break; case OCOPY: n->left = copyany(n->left, &n->ninit, 1); @@ -538,15 +542,15 @@ walkexpr(Node **np, NodeList **init) case OPRINT: case OPRINTN: walkexprlist(n->list, init); - n = walkprint(n, init, 0); + n = walkprint(n, init); goto ret; case OPANIC: - n = mkcall("panic", T, init, n->left); + n = mkcall("gopanic", T, init, n->left); goto ret; case ORECOVER: - n = mkcall("recover", n->type, init, nod(OADDR, nodfp, N)); + n = mkcall("gorecover", n->type, init, nod(OADDR, nodfp, N)); goto ret; case OLITERAL: @@ -609,7 +613,7 @@ walkexpr(Node **np, NodeList **init) if(oaslit(n, init)) goto ret; - if(n->right == N) + if(n->right == N || iszero(n->right) && !flag_race) goto ret; switch(n->right->op) { @@ -632,6 +636,7 @@ walkexpr(Node **np, NodeList **init) r = convas(nod(OAS, n->left, n->right), init); r->dodata = n->dodata; n = r; + n = applywritebarrier(n, init); } goto ret; @@ -643,6 +648,8 @@ walkexpr(Node **np, NodeList **init) walkexprlistsafe(n->rlist, init); ll = ascompatee(OAS, n->list, n->rlist, init); ll = reorder3(ll); + for(lr = ll; lr != nil; lr = lr->next) + lr->n = applywritebarrier(lr->n, init); n = liststmt(ll); goto ret; @@ -655,6 +662,8 @@ walkexpr(Node **np, NodeList **init) walkexpr(&r, init); ll = ascompatet(n->op, n->list, &r->type, 0, init); + for(lr = ll; lr != nil; lr = lr->next) + lr->n = applywritebarrier(lr->n, init); n = liststmt(concat(list1(r), ll)); goto ret; @@ -672,7 +681,7 @@ walkexpr(Node **np, NodeList **init) n1 = nod(OADDR, n->list->n, N); n1->etype = 1; // addr does not escape fn = chanfn("chanrecv2", 2, r->left->type); - r = mkcall1(fn, types[TBOOL], init, typename(r->left->type), r->left, n1); + r = mkcall1(fn, n->list->next->n->type, init, typename(r->left->type), r->left, n1); n = nod(OAS, n->list->next->n, r); typecheck(&n, Etop); goto ret; @@ -687,7 +696,7 @@ walkexpr(Node **np, NodeList **init) walkexpr(&r->right, init); t = r->left->type; p = nil; - if(t->type->width <= 128) { // Check ../../pkg/runtime/hashmap.c:MAXVALUESIZE before changing. + if(t->type->width <= 128) { // Check ../../runtime/hashmap.c:MAXVALUESIZE before changing. switch(simsimtype(t->down)) { case TINT32: case TUINT32: @@ -722,6 +731,12 @@ walkexpr(Node **np, NodeList **init) var->typecheck = 1; fn = mapfn(p, t); r = mkcall1(fn, getoutargx(fn->type), init, typename(t), r->left, key); + + // mapaccess2* returns a typed bool, but due to spec changes, + // the boolean result of i.(T) is now untyped so we make it the + // same type as the variable on the lhs. + if(!isblank(n->list->next->n)) + r->type->type->down->type = n->list->next->n->type; n->rlist = list1(r); n->op = OAS2FUNC; n->list->n = var; @@ -769,6 +784,12 @@ walkexpr(Node **np, NodeList **init) *p = '\0'; fn = syslook(buf, 1); + + // runtime.assert(E|I)2TOK returns a typed bool, but due + // to spec changes, the boolean result of i.(T) is now untyped + // so we make it the same type as the variable on the lhs. + if(!isblank(n->list->next->n)) + fn->type->type->down->type->type = n->list->next->n->type; ll = list1(typename(r->type)); ll = list(ll, r->left); argtype(fn, r->left->type); @@ -821,9 +842,7 @@ walkexpr(Node **np, NodeList **init) walkexpr(&n->left, init); // Optimize convT2E as a two-word copy when T is uintptr-shaped. - if(!isinter(n->left->type) && isnilinter(n->type) && - (n->left->type->width == widthptr) && - isint[simsimtype(n->left->type)]) { + if(isnilinter(n->type) && isdirectiface(n->left->type) && n->left->type->width == widthptr && isint[simsimtype(n->left->type)]) { l = nod(OEFACE, typename(n->left->type), n->left); l->type = n->type; l->typecheck = n->typecheck; @@ -865,14 +884,13 @@ walkexpr(Node **np, NodeList **init) l->class = PEXTERN; l->xoffset = 0; sym->def = l; - ggloblsym(sym, widthptr, 1, 0); + ggloblsym(sym, widthptr, DUPOK|NOPTR); } l = nod(OADDR, sym->def, N); l->addable = 1; ll = list(ll, l); - if(n->left->type->width == widthptr && - isint[simsimtype(n->left->type)]) { + if(isdirectiface(n->left->type) && n->left->type->width == widthptr && isint[simsimtype(n->left->type)]) { /* For pointer types, we can make a special form of optimization * * These statements are put onto the expression init list: @@ -1073,7 +1091,7 @@ walkexpr(Node **np, NodeList **init) t = n->left->type; p = nil; - if(t->type->width <= 128) { // Check ../../pkg/runtime/hashmap.c:MAXVALUESIZE before changing. + if(t->type->width <= 128) { // Check ../../runtime/hashmap.c:MAXVALUESIZE before changing. switch(simsimtype(t->down)) { case TINT32: case TUINT32: @@ -1371,7 +1389,6 @@ walkexpr(Node **np, NodeList **init) case OMAPLIT: case OSTRUCTLIT: case OPTRLIT: - // XXX TODO do we need to clear var? var = temp(n->type); anylit(0, n, var, init); n = var; @@ -1471,8 +1488,13 @@ ascompatee(int op, NodeList *nl, NodeList *nr, NodeList **init) static int fncall(Node *l, Type *rt) { + Node r; + if(l->ullman >= UINF || l->op == OINDEXMAP) return 1; + memset(&r, 0, sizeof r); + if(needwritebarrier(l, &r)) + return 1; if(eqtype(l->type, rt)) return 0; return 1; @@ -1523,8 +1545,10 @@ ascompatet(int op, NodeList *nl, Type **nr, int fp, NodeList **init) a = nod(OAS, l, nodarg(r, fp)); a = convas(a, init); ullmancalc(a); - if(a->ullman >= UINF) + if(a->ullman >= UINF) { + dump("ascompatet ucount", a); ucount++; + } nn = list(nn, a); r = structnext(&saver); } @@ -1732,7 +1756,7 @@ ret: // generate code for print static Node* -walkprint(Node *nn, NodeList **init, int defer) +walkprint(Node *nn, NodeList **init) { Node *r; Node *n; @@ -1740,31 +1764,17 @@ walkprint(Node *nn, NodeList **init, int defer) Node *on; Type *t; int notfirst, et, op; - NodeList *calls, *intypes, *args; - Fmt fmt; + NodeList *calls; on = nil; op = nn->op; all = nn->list; calls = nil; notfirst = 0; - intypes = nil; - args = nil; - - memset(&fmt, 0, sizeof fmt); - if(defer) { - // defer print turns into defer printf with format string - fmtstrinit(&fmt); - intypes = list(intypes, nod(ODCLFIELD, N, typenod(types[TSTRING]))); - args = list1(nod(OXXX, N, N)); - } for(l=all; l; l=l->next) { if(notfirst) { - if(defer) - fmtprint(&fmt, " "); - else - calls = list(calls, mkcall("printsp", T, init)); + calls = list(calls, mkcall("printsp", T, init)); } notfirst = op == OPRINTN; @@ -1792,119 +1802,63 @@ walkprint(Node *nn, NodeList **init, int defer) t = n->type; et = n->type->etype; if(isinter(n->type)) { - if(defer) { - if(isnilinter(n->type)) - fmtprint(&fmt, "%%e"); - else - fmtprint(&fmt, "%%i"); - } else { - if(isnilinter(n->type)) - on = syslook("printeface", 1); - else - on = syslook("printiface", 1); - argtype(on, n->type); // any-1 - } + if(isnilinter(n->type)) + on = syslook("printeface", 1); + else + on = syslook("printiface", 1); + argtype(on, n->type); // any-1 } else if(isptr[et] || et == TCHAN || et == TMAP || et == TFUNC || et == TUNSAFEPTR) { - if(defer) { - fmtprint(&fmt, "%%p"); - } else { - on = syslook("printpointer", 1); - argtype(on, n->type); // any-1 - } + on = syslook("printpointer", 1); + argtype(on, n->type); // any-1 } else if(isslice(n->type)) { - if(defer) { - fmtprint(&fmt, "%%a"); - } else { - on = syslook("printslice", 1); - argtype(on, n->type); // any-1 - } + on = syslook("printslice", 1); + argtype(on, n->type); // any-1 } else if(isint[et]) { - if(defer) { - if(et == TUINT64) - fmtprint(&fmt, "%%U"); - else { - fmtprint(&fmt, "%%D"); - t = types[TINT64]; - } - } else { - if(et == TUINT64) - on = syslook("printuint", 0); + if(et == TUINT64) { + if((t->sym->pkg == runtimepkg || compiling_runtime) && strcmp(t->sym->name, "hex") == 0) + on = syslook("printhex", 0); else - on = syslook("printint", 0); - } - } else if(isfloat[et]) { - if(defer) { - fmtprint(&fmt, "%%f"); - t = types[TFLOAT64]; + on = syslook("printuint", 0); } else - on = syslook("printfloat", 0); + on = syslook("printint", 0); + } else if(isfloat[et]) { + on = syslook("printfloat", 0); } else if(iscomplex[et]) { - if(defer) { - fmtprint(&fmt, "%%C"); - t = types[TCOMPLEX128]; - } else - on = syslook("printcomplex", 0); + on = syslook("printcomplex", 0); } else if(et == TBOOL) { - if(defer) - fmtprint(&fmt, "%%t"); - else - on = syslook("printbool", 0); + on = syslook("printbool", 0); } else if(et == TSTRING) { - if(defer) - fmtprint(&fmt, "%%S"); - else - on = syslook("printstring", 0); + on = syslook("printstring", 0); } else { badtype(OPRINT, n->type, T); continue; } - if(!defer) { - t = *getinarg(on->type); - if(t != nil) - t = t->type; - if(t != nil) - t = t->type; - } + t = *getinarg(on->type); + if(t != nil) + t = t->type; + if(t != nil) + t = t->type; if(!eqtype(t, n->type)) { n = nod(OCONV, n, N); n->type = t; } - if(defer) { - intypes = list(intypes, nod(ODCLFIELD, N, typenod(t))); - args = list(args, n); - } else { - r = nod(OCALL, on, N); - r->list = list1(n); - calls = list(calls, r); - } + r = nod(OCALL, on, N); + r->list = list1(n); + calls = list(calls, r); } - if(defer) { - if(op == OPRINTN) - fmtprint(&fmt, "\n"); - on = syslook("goprintf", 1); - on->type = functype(nil, intypes, nil); - args->n = nod(OLITERAL, N, N); - args->n->val.ctype = CTSTR; - args->n->val.u.sval = strlit(fmtstrflush(&fmt)); - r = nod(OCALL, on, N); - r->list = args; - typecheck(&r, Etop); - walkexpr(&r, init); - } else { - if(op == OPRINTN) - calls = list(calls, mkcall("printnl", T, nil)); - typechecklist(calls, Etop); - walkexprlist(calls, init); + if(op == OPRINTN) + calls = list(calls, mkcall("printnl", T, nil)); + typechecklist(calls, Etop); + walkexprlist(calls, init); - r = nod(OEMPTY, N, N); - typecheck(&r, Etop); - walkexpr(&r, init); - r->ninit = calls; - } + r = nod(OEMPTY, N, N); + typecheck(&r, Etop); + walkexpr(&r, init); + r->ninit = calls; return r; } @@ -1914,11 +1868,166 @@ callnew(Type *t) Node *fn; dowidth(t); - fn = syslook("new", 1); + fn = syslook("newobject", 1); argtype(fn, t); return mkcall1(fn, ptrto(t), nil, typename(t)); } +static int +isstack(Node *n) +{ + while(n->op == ODOT || n->op == OPAREN || n->op == OCONVNOP || n->op == OINDEX && isfixedarray(n->left->type)) + n = n->left; + + switch(n->op) { + case OINDREG: + // OINDREG only ends up in walk if it's indirect of SP. + return 1; + + case ONAME: + switch(n->class) { + case PAUTO: + case PPARAM: + case PPARAMOUT: + return 1; + } + break; + } + + return 0; +} + +static int +isglobal(Node *n) +{ + while(n->op == ODOT || n->op == OPAREN || n->op == OCONVNOP || n->op == OINDEX && isfixedarray(n->left->type)) + n = n->left; + + switch(n->op) { + case ONAME: + switch(n->class) { + case PEXTERN: + return 1; + } + break; + } + + return 0; +} + +// Do we need a write barrier for the assignment l = r? +int +needwritebarrier(Node *l, Node *r) +{ + if(!use_writebarrier) + return 0; + + if(l == N || isblank(l)) + return 0; + + // No write barrier for write of non-pointers. + dowidth(l->type); + if(!haspointers(l->type)) + return 0; + + // No write barrier for write to stack. + if(isstack(l)) + return 0; + + // No write barrier for implicit or explicit zeroing. + if(r == N || iszero(r)) + return 0; + + // No write barrier for initialization to constant. + if(r->op == OLITERAL) + return 0; + + // No write barrier for storing static (read-only) data. + if(r->op == ONAME && strncmp(r->sym->name, "statictmp_", 10) == 0) + return 0; + + // No write barrier for storing address of stack values, + // which are guaranteed only to be written to the stack. + if(r->op == OADDR && isstack(r->left)) + return 0; + + // No write barrier for storing address of global, which + // is live no matter what. + if(r->op == OADDR && isglobal(r->left)) + return 0; + + // No write barrier for reslice: x = x[0:y] or x = append(x, ...). + // Both are compiled to modify x directly. + // In the case of append, a write barrier may still be needed + // if the underlying array grows, but the append code can + // generate the write barrier directly in that case. + // (It does not yet, but the cost of the write barrier will be + // small compared to the cost of the allocation.) + if(r->reslice) { + switch(r->op) { + case OSLICE: + case OSLICE3: + case OSLICESTR: + case OAPPEND: + break; + default: + dump("bad reslice-l", l); + dump("bad reslice-r", r); + break; + } + return 0; + } + + // Otherwise, be conservative and use write barrier. + return 1; +} + +// TODO(rsc): Perhaps componentgen should run before this. +static Node* +applywritebarrier(Node *n, NodeList **init) +{ + Node *l, *r; + Type *t; + + if(n->left && n->right && needwritebarrier(n->left, n->right)) { + t = n->left->type; + l = nod(OADDR, n->left, N); + l->etype = 1; // addr does not escape + if(t->width == widthptr) { + n = mkcall1(writebarrierfn("writebarrierptr", t, n->right->type), T, init, + l, n->right); + } else if(t->etype == TSTRING) { + n = mkcall1(writebarrierfn("writebarrierstring", t, n->right->type), T, init, + l, n->right); + } else if(isslice(t)) { + n = mkcall1(writebarrierfn("writebarrierslice", t, n->right->type), T, init, + l, n->right); + } else if(isinter(t)) { + n = mkcall1(writebarrierfn("writebarrieriface", t, n->right->type), T, init, + l, n->right); + } else if(t->width == 2*widthptr) { + n = mkcall1(writebarrierfn("writebarrierfat2", t, n->right->type), T, init, + l, nodnil(), n->right); + } else if(t->width == 3*widthptr) { + n = mkcall1(writebarrierfn("writebarrierfat3", t, n->right->type), T, init, + l, nodnil(), n->right); + } else if(t->width == 4*widthptr) { + n = mkcall1(writebarrierfn("writebarrierfat4", t, n->right->type), T, init, + l, nodnil(), n->right); + } else { + r = n->right; + while(r->op == OCONVNOP) + r = r->left; + r = nod(OADDR, r, N); + r->etype = 1; // addr does not escape + //warnl(n->lineno, "writebarrierfat %T %N", t, r); + n = mkcall1(writebarrierfn("writebarrierfat", t, r->left->type), T, init, + typename(t), l, r); + } + } + return n; +} + static Node* convas(Node *n, NodeList **init) { @@ -1958,11 +2067,10 @@ convas(Node *n, NodeList **init) goto out; } - if(eqtype(lt, rt)) - goto out; - - n->right = assignconv(n->right, lt, "assignment"); - walkexpr(&n->right, init); + if(!eqtype(lt, rt)) { + n->right = assignconv(n->right, lt, "assignment"); + walkexpr(&n->right, init); + } out: ullmancalc(n); @@ -2355,6 +2463,8 @@ paramstoheap(Type **argin, int out) continue; // generate allocation & copying code + if(compiling_runtime) + yyerror("%N escapes to heap, not allowed in runtime.", v); if(v->alloc == nil) v->alloc = callnew(v->type); nn = list(nn, nod(OAS, v->heapaddr, v->alloc)); @@ -2512,6 +2622,17 @@ mapfndel(char *name, Type *t) } static Node* +writebarrierfn(char *name, Type *l, Type *r) +{ + Node *fn; + + fn = syslook(name, 1); + argtype(fn, l); + argtype(fn, r); + return fn; +} + +static Node* addstr(Node *n, NodeList **init) { Node *r, *cat, *slice; @@ -2620,7 +2741,7 @@ appendslice(Node *n, NodeList **init) if(l2->type->etype == TSTRING) fn = syslook("slicestringcopy", 1); else - fn = syslook("copy", 1); + fn = syslook("slicecopy", 1); argtype(fn, l1->type); argtype(fn, l2->type); nt = mkcall1(fn, types[TINT], &l, @@ -2758,7 +2879,7 @@ copyany(Node *n, NodeList **init, int runtimecall) if(n->right->type->etype == TSTRING) fn = syslook("slicestringcopy", 1); else - fn = syslook("copy", 1); + fn = syslook("slicecopy", 1); argtype(fn, n->left->type); argtype(fn, n->right->type); return mkcall1(fn, n->type, init, @@ -2863,14 +2984,14 @@ sliceany(Node* n, NodeList **init) lb = N; } - // dynamic checks convert all bounds to unsigned to save us the bound < 0 comparison - // generate - // if hb > bound || lb > hb { panicslice() } + // Checking src[lb:hb:cb] or src[lb:hb]. + // if chk0 || chk1 || chk2 { panicslice() } chk = N; - chk0 = N; - chk1 = N; - chk2 = N; + chk0 = N; // cap(src) < cb + chk1 = N; // cb < hb for src[lb:hb:cb]; cap(src) < hb for src[lb:hb] + chk2 = N; // hb < lb + // All comparisons are unsigned to avoid testing < 0. bt = types[simtype[TUINT]]; if(cb != N && cb->type->width > 4) bt = types[TUINT64]; @@ -3010,10 +3131,10 @@ eqfor(Type *t) n = newname(sym); n->class = PFUNC; ntype = nod(OTFUNC, N, N); - ntype->list = list(ntype->list, nod(ODCLFIELD, N, typenod(ptrto(types[TBOOL])))); - ntype->list = list(ntype->list, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); ntype->list = list(ntype->list, nod(ODCLFIELD, N, typenod(ptrto(t)))); ntype->list = list(ntype->list, nod(ODCLFIELD, N, typenod(ptrto(t)))); + ntype->list = list(ntype->list, nod(ODCLFIELD, N, typenod(types[TUINTPTR]))); + ntype->rlist = list(ntype->rlist, nod(ODCLFIELD, N, typenod(types[TBOOL]))); typecheck(&ntype, Etype); n->type = ntype->type; return n; @@ -3034,10 +3155,9 @@ countfield(Type *t) static void walkcompare(Node **np, NodeList **init) { - Node *n, *l, *r, *fn, *call, *a, *li, *ri, *expr; + Node *n, *l, *r, *call, *a, *li, *ri, *expr, *cmpl, *cmpr; int andor, i; Type *t, *t1; - static Node *tempbool; n = *np; @@ -3055,17 +3175,25 @@ walkcompare(Node **np, NodeList **init) break; } - if(!islvalue(n->left) || !islvalue(n->right)) - goto hard; + cmpl = n->left; + while(cmpl != N && cmpl->op == OCONVNOP) + cmpl = cmpl->left; + cmpr = n->right; + while(cmpr != N && cmpr->op == OCONVNOP) + cmpr = cmpr->left; + + if(!islvalue(cmpl) || !islvalue(cmpr)) { + fatal("arguments of comparison must be lvalues - %N %N", cmpl, cmpr); + } l = temp(ptrto(t)); - a = nod(OAS, l, nod(OADDR, n->left, N)); + a = nod(OAS, l, nod(OADDR, cmpl, N)); a->right->etype = 1; // addr does not escape typecheck(&a, Etop); *init = list(*init, a); r = temp(ptrto(t)); - a = nod(OAS, r, nod(OADDR, n->right, N)); + a = nod(OAS, r, nod(OADDR, cmpr, N)); a->right->etype = 1; // addr does not escape typecheck(&a, Etop); *init = list(*init, a); @@ -3115,57 +3243,16 @@ walkcompare(Node **np, NodeList **init) goto ret; } - // Chose not to inline, but still have addresses. - // Call equality function directly. - // The equality function requires a bool pointer for - // storing its address, because it has to be callable - // from C, and C can't access an ordinary Go return value. - // To avoid creating many temporaries, cache one per function. - if(tempbool == N || tempbool->curfn != curfn) - tempbool = temp(types[TBOOL]); - + // Chose not to inline. Call equality function directly. call = nod(OCALL, eqfor(t), N); - a = nod(OADDR, tempbool, N); - a->etype = 1; // does not escape - call->list = list(call->list, a); - call->list = list(call->list, nodintconst(t->width)); call->list = list(call->list, l); call->list = list(call->list, r); - typecheck(&call, Etop); - walkstmt(&call); - *init = list(*init, call); - - // tempbool cannot be used directly as multiple comparison - // expressions may exist in the same statement. Create another - // temporary to hold the value (its address is not taken so it can - // be optimized away). - r = temp(types[TBOOL]); - a = nod(OAS, r, tempbool); - typecheck(&a, Etop); - walkstmt(&a); - *init = list(*init, a); - + call->list = list(call->list, nodintconst(t->width)); + r = call; if(n->op != OEQ) r = nod(ONOT, r, N); goto ret; -hard: - // Cannot take address of one or both of the operands. - // Instead, pass directly to runtime helper function. - // Easier on the stack than passing the address - // of temporary variables, because we are better at reusing - // the argument space than temporary variable space. - fn = syslook("equal", 1); - l = n->left; - r = n->right; - argtype(fn, n->left->type); - argtype(fn, n->left->type); - r = mkcall1(fn, n->type, init, typename(n->left->type), l, r); - if(n->op == ONE) { - r = nod(ONOT, r, N); - } - goto ret; - ret: typecheck(&r, Erv); walkexpr(&r, init); @@ -3780,3 +3867,71 @@ candiscard(Node *n) return 1; } + +// rewrite +// print(x, y, z) +// into +// func(a1, a2, a3) { +// print(a1, a2, a3) +// }(x, y, z) +// and same for println. +static void +walkprintfunc(Node **np, NodeList **init) +{ + Node *n; + Node *a, *fn, *t, *oldfn; + NodeList *l, *printargs; + int num; + char buf[100]; + static int prgen; + + n = *np; + + if(n->ninit != nil) { + walkstmtlist(n->ninit); + *init = concat(*init, n->ninit); + n->ninit = nil; + } + + t = nod(OTFUNC, N, N); + num = 0; + printargs = nil; + for(l=n->list; l != nil; l=l->next) { + snprint(buf, sizeof buf, "a%d", num++); + a = nod(ODCLFIELD, newname(lookup(buf)), typenod(l->n->type)); + t->list = list(t->list, a); + printargs = list(printargs, a->left); + } + + fn = nod(ODCLFUNC, N, N); + snprint(buf, sizeof buf, "print·%d", ++prgen); + fn->nname = newname(lookup(buf)); + fn->nname->defn = fn; + fn->nname->ntype = t; + declare(fn->nname, PFUNC); + + oldfn = curfn; + curfn = nil; + funchdr(fn); + + a = nod(n->op, N, N); + a->list = printargs; + typecheck(&a, Etop); + walkstmt(&a); + + fn->nbody = list1(a); + + funcbody(fn); + + typecheck(&fn, Etop); + typechecklist(fn->nbody, Etop); + xtop = list(xtop, fn); + curfn = oldfn; + + a = nod(OCALL, N, N); + a->left = fn->nname; + a->list = n->list; + typecheck(&a, Etop); + walkexpr(&a, init); + *np = a; +} diff --git a/src/cmd/gc/y.tab.c b/src/cmd/gc/y.tab.c index 08d8ecff2..f464126ac 100644 --- a/src/cmd/gc/y.tab.c +++ b/src/cmd/gc/y.tab.c @@ -440,16 +440,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 2270 +#define YYLAST 2201 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 76 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 142 /* YYNRULES -- Number of rules. */ -#define YYNRULES 351 +#define YYNRULES 352 /* YYNRULES -- Number of states. */ -#define YYNSTATES 667 +#define YYNSTATES 669 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -506,35 +506,35 @@ static const yytype_uint16 yyprhs[] = 129, 132, 137, 141, 146, 150, 152, 155, 157, 159, 162, 164, 168, 172, 176, 179, 182, 186, 192, 198, 201, 202, 207, 208, 212, 213, 216, 217, 222, 227, - 232, 238, 240, 242, 245, 246, 250, 252, 256, 257, - 258, 259, 268, 269, 275, 276, 279, 280, 283, 284, - 285, 293, 294, 300, 302, 306, 310, 314, 318, 322, - 326, 330, 334, 338, 342, 346, 350, 354, 358, 362, - 366, 370, 374, 378, 382, 384, 387, 390, 393, 396, - 399, 402, 405, 408, 412, 418, 425, 427, 429, 433, - 439, 445, 450, 457, 466, 468, 474, 480, 486, 494, - 496, 497, 501, 503, 508, 510, 515, 517, 521, 523, - 525, 527, 529, 531, 533, 535, 536, 538, 540, 542, - 544, 549, 554, 556, 558, 560, 563, 565, 567, 569, - 571, 573, 577, 579, 581, 583, 586, 588, 590, 592, - 594, 598, 600, 602, 604, 606, 608, 610, 612, 614, - 616, 620, 625, 630, 633, 637, 643, 645, 647, 650, - 654, 660, 664, 670, 674, 678, 684, 693, 699, 708, - 714, 715, 719, 720, 722, 726, 728, 733, 736, 737, - 741, 743, 747, 749, 753, 755, 759, 761, 765, 767, - 771, 775, 778, 783, 787, 793, 799, 801, 805, 807, - 810, 812, 816, 821, 823, 826, 829, 831, 833, 837, - 838, 841, 842, 844, 846, 848, 850, 852, 854, 856, - 858, 860, 861, 866, 868, 871, 874, 877, 880, 883, - 886, 888, 892, 894, 898, 900, 904, 906, 910, 912, - 916, 918, 920, 924, 928, 929, 932, 933, 935, 936, - 938, 939, 941, 942, 944, 945, 947, 948, 950, 951, - 953, 954, 956, 957, 959, 964, 969, 975, 982, 987, - 992, 994, 996, 998, 1000, 1002, 1004, 1006, 1008, 1010, - 1014, 1019, 1025, 1030, 1035, 1038, 1041, 1046, 1050, 1054, - 1060, 1064, 1069, 1073, 1079, 1081, 1082, 1084, 1088, 1090, - 1092, 1095, 1097, 1099, 1105, 1106, 1109, 1111, 1115, 1117, - 1121, 1123 + 232, 235, 241, 243, 245, 248, 249, 253, 255, 259, + 260, 261, 262, 271, 272, 278, 279, 282, 283, 286, + 287, 288, 296, 297, 303, 305, 309, 313, 317, 321, + 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, + 365, 369, 373, 377, 381, 385, 387, 390, 393, 396, + 399, 402, 405, 408, 411, 415, 421, 428, 430, 432, + 436, 442, 448, 453, 460, 469, 471, 477, 483, 489, + 497, 499, 500, 504, 506, 511, 513, 518, 520, 524, + 526, 528, 530, 532, 534, 536, 538, 539, 541, 543, + 545, 547, 552, 557, 559, 561, 563, 566, 568, 570, + 572, 574, 576, 580, 582, 584, 586, 589, 591, 593, + 595, 597, 601, 603, 605, 607, 609, 611, 613, 615, + 617, 619, 623, 628, 633, 636, 640, 646, 648, 650, + 653, 657, 663, 667, 673, 677, 681, 687, 696, 702, + 711, 717, 718, 722, 723, 725, 729, 731, 736, 739, + 740, 744, 746, 750, 752, 756, 758, 762, 764, 768, + 770, 774, 778, 781, 786, 790, 796, 802, 804, 808, + 810, 813, 815, 819, 824, 826, 829, 832, 834, 836, + 840, 841, 844, 845, 847, 849, 851, 853, 855, 857, + 859, 861, 863, 864, 869, 871, 874, 877, 880, 883, + 886, 889, 891, 895, 897, 901, 903, 907, 909, 913, + 915, 919, 921, 923, 927, 931, 932, 935, 936, 938, + 939, 941, 942, 944, 945, 947, 948, 950, 951, 953, + 954, 956, 957, 959, 960, 962, 967, 972, 978, 985, + 990, 995, 997, 999, 1001, 1003, 1005, 1007, 1009, 1011, + 1013, 1017, 1022, 1028, 1033, 1038, 1041, 1044, 1049, 1053, + 1057, 1063, 1067, 1072, 1076, 1082, 1084, 1085, 1087, 1091, + 1093, 1095, 1098, 1100, 1102, 1108, 1109, 1112, 1114, 1118, + 1120, 1124, 1126 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -563,96 +563,96 @@ static const yytype_int16 yyrhs[] = -1, -1, 67, 101, 183, 68, -1, -1, 99, 103, 183, -1, -1, 104, 102, -1, -1, 35, 106, 183, 68, -1, 186, 65, 26, 126, -1, 186, 5, 26, - 126, -1, 194, 62, 194, 62, 194, -1, 194, -1, - 107, -1, 108, 105, -1, -1, 16, 111, 109, -1, - 194, -1, 194, 62, 194, -1, -1, -1, -1, 20, - 114, 112, 115, 105, 116, 119, 120, -1, -1, 14, - 20, 118, 112, 105, -1, -1, 119, 117, -1, -1, - 14, 100, -1, -1, -1, 30, 122, 112, 123, 35, - 104, 68, -1, -1, 28, 125, 35, 104, 68, -1, - 127, -1, 126, 47, 126, -1, 126, 33, 126, -1, - 126, 38, 126, -1, 126, 46, 126, -1, 126, 45, - 126, -1, 126, 43, 126, -1, 126, 39, 126, -1, - 126, 40, 126, -1, 126, 49, 126, -1, 126, 50, - 126, -1, 126, 51, 126, -1, 126, 52, 126, -1, - 126, 53, 126, -1, 126, 54, 126, -1, 126, 55, - 126, -1, 126, 56, 126, -1, 126, 34, 126, -1, - 126, 44, 126, -1, 126, 48, 126, -1, 126, 36, - 126, -1, 134, -1, 53, 127, -1, 56, 127, -1, - 49, 127, -1, 50, 127, -1, 69, 127, -1, 70, - 127, -1, 52, 127, -1, 36, 127, -1, 134, 59, - 60, -1, 134, 59, 187, 191, 60, -1, 134, 59, - 187, 11, 191, 60, -1, 3, -1, 143, -1, 134, - 63, 141, -1, 134, 63, 59, 135, 60, -1, 134, - 63, 59, 31, 60, -1, 134, 71, 126, 72, -1, - 134, 71, 192, 66, 192, 72, -1, 134, 71, 192, - 66, 192, 66, 192, 72, -1, 128, -1, 149, 59, - 126, 191, 60, -1, 150, 137, 130, 189, 68, -1, - 129, 67, 130, 189, 68, -1, 59, 135, 60, 67, - 130, 189, 68, -1, 165, -1, -1, 126, 66, 133, - -1, 126, -1, 67, 130, 189, 68, -1, 126, -1, - 67, 130, 189, 68, -1, 129, -1, 59, 135, 60, - -1, 126, -1, 147, -1, 146, -1, 35, -1, 67, - -1, 141, -1, 141, -1, -1, 138, -1, 24, -1, - 142, -1, 73, -1, 74, 3, 63, 24, -1, 74, - 3, 63, 73, -1, 141, -1, 138, -1, 11, -1, - 11, 146, -1, 155, -1, 161, -1, 153, -1, 154, - -1, 152, -1, 59, 146, 60, -1, 155, -1, 161, - -1, 153, -1, 53, 147, -1, 161, -1, 153, -1, - 154, -1, 152, -1, 59, 146, 60, -1, 161, -1, - 153, -1, 153, -1, 155, -1, 161, -1, 153, -1, - 154, -1, 152, -1, 143, -1, 143, 63, 141, -1, - 71, 192, 72, 146, -1, 71, 11, 72, 146, -1, - 8, 148, -1, 8, 36, 146, -1, 23, 71, 146, - 72, 146, -1, 156, -1, 157, -1, 53, 146, -1, - 36, 8, 146, -1, 29, 137, 170, 190, 68, -1, - 29, 137, 68, -1, 22, 137, 171, 190, 68, -1, - 22, 137, 68, -1, 17, 159, 162, -1, 141, 59, - 179, 60, 163, -1, 59, 179, 60, 141, 59, 179, - 60, 163, -1, 200, 59, 195, 60, 210, -1, 59, - 215, 60, 141, 59, 195, 60, 210, -1, 17, 59, - 179, 60, 163, -1, -1, 67, 183, 68, -1, -1, - 151, -1, 59, 179, 60, -1, 161, -1, 164, 137, - 183, 68, -1, 164, 1, -1, -1, 166, 90, 62, - -1, 93, -1, 167, 62, 93, -1, 95, -1, 168, - 62, 95, -1, 97, -1, 169, 62, 97, -1, 172, - -1, 170, 62, 172, -1, 175, -1, 171, 62, 175, - -1, 184, 146, 198, -1, 174, 198, -1, 59, 174, - 60, 198, -1, 53, 174, 198, -1, 59, 53, 174, - 60, 198, -1, 53, 59, 174, 60, 198, -1, 24, - -1, 24, 63, 141, -1, 173, -1, 138, 176, -1, - 173, -1, 59, 173, 60, -1, 59, 179, 60, 163, - -1, 136, -1, 141, 136, -1, 141, 145, -1, 145, - -1, 177, -1, 178, 75, 177, -1, -1, 178, 191, - -1, -1, 100, -1, 91, -1, 181, -1, 1, -1, - 98, -1, 110, -1, 121, -1, 124, -1, 113, -1, - -1, 144, 66, 182, 180, -1, 15, -1, 6, 140, - -1, 10, 140, -1, 18, 128, -1, 13, 128, -1, - 19, 138, -1, 27, 193, -1, 180, -1, 183, 62, - 180, -1, 138, -1, 184, 75, 138, -1, 139, -1, - 185, 75, 139, -1, 126, -1, 186, 75, 126, -1, - 135, -1, 187, 75, 135, -1, 131, -1, 132, -1, - 188, 75, 131, -1, 188, 75, 132, -1, -1, 188, - 191, -1, -1, 62, -1, -1, 75, -1, -1, 126, - -1, -1, 186, -1, -1, 98, -1, -1, 215, -1, - -1, 216, -1, -1, 217, -1, -1, 3, -1, 21, - 24, 3, 62, -1, 32, 200, 202, 62, -1, 9, - 200, 65, 213, 62, -1, 9, 200, 202, 65, 213, - 62, -1, 31, 201, 202, 62, -1, 17, 160, 162, - 62, -1, 142, -1, 200, -1, 204, -1, 205, -1, - 206, -1, 204, -1, 206, -1, 142, -1, 24, -1, - 71, 72, 202, -1, 71, 3, 72, 202, -1, 23, - 71, 202, 72, 202, -1, 29, 67, 196, 68, -1, - 22, 67, 197, 68, -1, 53, 202, -1, 8, 203, - -1, 8, 59, 205, 60, -1, 8, 36, 202, -1, - 36, 8, 202, -1, 17, 59, 195, 60, 210, -1, - 141, 202, 198, -1, 141, 11, 202, 198, -1, 141, - 202, 198, -1, 141, 59, 195, 60, 210, -1, 202, - -1, -1, 211, -1, 59, 195, 60, -1, 202, -1, - 3, -1, 50, 3, -1, 141, -1, 212, -1, 59, - 212, 49, 212, 60, -1, -1, 214, 199, -1, 207, - -1, 215, 75, 207, -1, 208, -1, 216, 62, 208, - -1, 209, -1, 217, 62, 209, -1 + 126, -1, 26, 126, -1, 194, 62, 194, 62, 194, + -1, 194, -1, 107, -1, 108, 105, -1, -1, 16, + 111, 109, -1, 194, -1, 194, 62, 194, -1, -1, + -1, -1, 20, 114, 112, 115, 105, 116, 119, 120, + -1, -1, 14, 20, 118, 112, 105, -1, -1, 119, + 117, -1, -1, 14, 100, -1, -1, -1, 30, 122, + 112, 123, 35, 104, 68, -1, -1, 28, 125, 35, + 104, 68, -1, 127, -1, 126, 47, 126, -1, 126, + 33, 126, -1, 126, 38, 126, -1, 126, 46, 126, + -1, 126, 45, 126, -1, 126, 43, 126, -1, 126, + 39, 126, -1, 126, 40, 126, -1, 126, 49, 126, + -1, 126, 50, 126, -1, 126, 51, 126, -1, 126, + 52, 126, -1, 126, 53, 126, -1, 126, 54, 126, + -1, 126, 55, 126, -1, 126, 56, 126, -1, 126, + 34, 126, -1, 126, 44, 126, -1, 126, 48, 126, + -1, 126, 36, 126, -1, 134, -1, 53, 127, -1, + 56, 127, -1, 49, 127, -1, 50, 127, -1, 69, + 127, -1, 70, 127, -1, 52, 127, -1, 36, 127, + -1, 134, 59, 60, -1, 134, 59, 187, 191, 60, + -1, 134, 59, 187, 11, 191, 60, -1, 3, -1, + 143, -1, 134, 63, 141, -1, 134, 63, 59, 135, + 60, -1, 134, 63, 59, 31, 60, -1, 134, 71, + 126, 72, -1, 134, 71, 192, 66, 192, 72, -1, + 134, 71, 192, 66, 192, 66, 192, 72, -1, 128, + -1, 149, 59, 126, 191, 60, -1, 150, 137, 130, + 189, 68, -1, 129, 67, 130, 189, 68, -1, 59, + 135, 60, 67, 130, 189, 68, -1, 165, -1, -1, + 126, 66, 133, -1, 126, -1, 67, 130, 189, 68, + -1, 126, -1, 67, 130, 189, 68, -1, 129, -1, + 59, 135, 60, -1, 126, -1, 147, -1, 146, -1, + 35, -1, 67, -1, 141, -1, 141, -1, -1, 138, + -1, 24, -1, 142, -1, 73, -1, 74, 3, 63, + 24, -1, 74, 3, 63, 73, -1, 141, -1, 138, + -1, 11, -1, 11, 146, -1, 155, -1, 161, -1, + 153, -1, 154, -1, 152, -1, 59, 146, 60, -1, + 155, -1, 161, -1, 153, -1, 53, 147, -1, 161, + -1, 153, -1, 154, -1, 152, -1, 59, 146, 60, + -1, 161, -1, 153, -1, 153, -1, 155, -1, 161, + -1, 153, -1, 154, -1, 152, -1, 143, -1, 143, + 63, 141, -1, 71, 192, 72, 146, -1, 71, 11, + 72, 146, -1, 8, 148, -1, 8, 36, 146, -1, + 23, 71, 146, 72, 146, -1, 156, -1, 157, -1, + 53, 146, -1, 36, 8, 146, -1, 29, 137, 170, + 190, 68, -1, 29, 137, 68, -1, 22, 137, 171, + 190, 68, -1, 22, 137, 68, -1, 17, 159, 162, + -1, 141, 59, 179, 60, 163, -1, 59, 179, 60, + 141, 59, 179, 60, 163, -1, 200, 59, 195, 60, + 210, -1, 59, 215, 60, 141, 59, 195, 60, 210, + -1, 17, 59, 179, 60, 163, -1, -1, 67, 183, + 68, -1, -1, 151, -1, 59, 179, 60, -1, 161, + -1, 164, 137, 183, 68, -1, 164, 1, -1, -1, + 166, 90, 62, -1, 93, -1, 167, 62, 93, -1, + 95, -1, 168, 62, 95, -1, 97, -1, 169, 62, + 97, -1, 172, -1, 170, 62, 172, -1, 175, -1, + 171, 62, 175, -1, 184, 146, 198, -1, 174, 198, + -1, 59, 174, 60, 198, -1, 53, 174, 198, -1, + 59, 53, 174, 60, 198, -1, 53, 59, 174, 60, + 198, -1, 24, -1, 24, 63, 141, -1, 173, -1, + 138, 176, -1, 173, -1, 59, 173, 60, -1, 59, + 179, 60, 163, -1, 136, -1, 141, 136, -1, 141, + 145, -1, 145, -1, 177, -1, 178, 75, 177, -1, + -1, 178, 191, -1, -1, 100, -1, 91, -1, 181, + -1, 1, -1, 98, -1, 110, -1, 121, -1, 124, + -1, 113, -1, -1, 144, 66, 182, 180, -1, 15, + -1, 6, 140, -1, 10, 140, -1, 18, 128, -1, + 13, 128, -1, 19, 138, -1, 27, 193, -1, 180, + -1, 183, 62, 180, -1, 138, -1, 184, 75, 138, + -1, 139, -1, 185, 75, 139, -1, 126, -1, 186, + 75, 126, -1, 135, -1, 187, 75, 135, -1, 131, + -1, 132, -1, 188, 75, 131, -1, 188, 75, 132, + -1, -1, 188, 191, -1, -1, 62, -1, -1, 75, + -1, -1, 126, -1, -1, 186, -1, -1, 98, -1, + -1, 215, -1, -1, 216, -1, -1, 217, -1, -1, + 3, -1, 21, 24, 3, 62, -1, 32, 200, 202, + 62, -1, 9, 200, 65, 213, 62, -1, 9, 200, + 202, 65, 213, 62, -1, 31, 201, 202, 62, -1, + 17, 160, 162, 62, -1, 142, -1, 200, -1, 204, + -1, 205, -1, 206, -1, 204, -1, 206, -1, 142, + -1, 24, -1, 71, 72, 202, -1, 71, 3, 72, + 202, -1, 23, 71, 202, 72, 202, -1, 29, 67, + 196, 68, -1, 22, 67, 197, 68, -1, 53, 202, + -1, 8, 203, -1, 8, 59, 205, 60, -1, 8, + 36, 202, -1, 36, 8, 202, -1, 17, 59, 195, + 60, 210, -1, 141, 202, 198, -1, 141, 11, 202, + 198, -1, 141, 202, 198, -1, 141, 59, 195, 60, + 210, -1, 202, -1, -1, 211, -1, 59, 195, 60, + -1, 202, -1, 3, -1, 50, 3, -1, 141, -1, + 212, -1, 59, 212, 49, 212, 60, -1, -1, 214, + 199, -1, 207, -1, 215, 75, 207, -1, 208, -1, + 216, 62, 208, -1, 209, -1, 217, 62, 209, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -663,37 +663,37 @@ static const yytype_uint16 yyrline[] = 263, 264, 271, 271, 284, 288, 289, 293, 298, 304, 308, 312, 316, 322, 328, 334, 339, 343, 347, 353, 359, 363, 367, 373, 377, 383, 384, 388, 394, 403, - 409, 427, 432, 444, 460, 465, 472, 492, 510, 519, - 538, 537, 552, 551, 583, 586, 593, 592, 603, 609, - 618, 629, 635, 638, 646, 645, 656, 662, 674, 678, - 683, 673, 704, 703, 716, 719, 725, 728, 740, 744, - 739, 762, 761, 777, 778, 782, 786, 790, 794, 798, - 802, 806, 810, 814, 818, 822, 826, 830, 834, 838, - 842, 846, 850, 855, 861, 862, 866, 877, 881, 885, - 889, 894, 898, 908, 912, 917, 925, 929, 930, 941, - 945, 949, 953, 957, 965, 966, 972, 979, 985, 992, - 995, 1002, 1008, 1025, 1032, 1033, 1040, 1041, 1060, 1061, - 1064, 1067, 1071, 1082, 1091, 1097, 1100, 1103, 1110, 1111, - 1117, 1130, 1145, 1153, 1165, 1170, 1176, 1177, 1178, 1179, - 1180, 1181, 1187, 1188, 1189, 1190, 1196, 1197, 1198, 1199, - 1200, 1206, 1207, 1210, 1213, 1214, 1215, 1216, 1217, 1220, - 1221, 1234, 1238, 1243, 1248, 1253, 1257, 1258, 1261, 1267, - 1274, 1280, 1287, 1293, 1304, 1318, 1347, 1387, 1412, 1430, - 1439, 1442, 1450, 1454, 1458, 1465, 1471, 1476, 1488, 1491, - 1501, 1502, 1508, 1509, 1515, 1519, 1525, 1526, 1532, 1536, - 1542, 1565, 1570, 1576, 1582, 1589, 1598, 1607, 1622, 1628, - 1633, 1637, 1644, 1657, 1658, 1664, 1670, 1673, 1677, 1683, - 1686, 1695, 1698, 1699, 1703, 1704, 1710, 1711, 1712, 1713, - 1714, 1716, 1715, 1730, 1736, 1740, 1744, 1748, 1752, 1757, - 1776, 1782, 1790, 1794, 1800, 1804, 1810, 1814, 1820, 1824, - 1833, 1837, 1841, 1845, 1851, 1854, 1862, 1863, 1865, 1866, - 1869, 1872, 1875, 1878, 1881, 1884, 1887, 1890, 1893, 1896, - 1899, 1902, 1905, 1908, 1914, 1918, 1922, 1926, 1930, 1934, - 1954, 1961, 1972, 1973, 1974, 1977, 1978, 1981, 1985, 1995, - 1999, 2003, 2007, 2011, 2015, 2019, 2025, 2031, 2039, 2047, - 2053, 2060, 2076, 2098, 2102, 2108, 2111, 2114, 2118, 2128, - 2132, 2151, 2159, 2160, 2172, 2173, 2176, 2180, 2186, 2190, - 2196, 2200 + 409, 427, 432, 444, 460, 466, 474, 494, 512, 521, + 540, 539, 554, 553, 585, 588, 595, 594, 605, 611, + 618, 625, 636, 642, 645, 653, 652, 663, 669, 681, + 685, 690, 680, 711, 710, 723, 726, 732, 735, 747, + 751, 746, 769, 768, 784, 785, 789, 793, 797, 801, + 805, 809, 813, 817, 821, 825, 829, 833, 837, 841, + 845, 849, 853, 857, 862, 868, 869, 873, 884, 888, + 892, 896, 901, 905, 915, 919, 924, 932, 936, 937, + 948, 952, 956, 960, 964, 972, 973, 979, 986, 992, + 999, 1002, 1009, 1015, 1032, 1039, 1040, 1047, 1048, 1067, + 1068, 1071, 1074, 1078, 1089, 1098, 1104, 1107, 1110, 1117, + 1118, 1124, 1137, 1152, 1160, 1172, 1177, 1183, 1184, 1185, + 1186, 1187, 1188, 1194, 1195, 1196, 1197, 1203, 1204, 1205, + 1206, 1207, 1213, 1214, 1217, 1220, 1221, 1222, 1223, 1224, + 1227, 1228, 1241, 1245, 1250, 1255, 1260, 1264, 1265, 1268, + 1274, 1281, 1287, 1294, 1300, 1311, 1326, 1355, 1393, 1418, + 1436, 1445, 1448, 1456, 1460, 1464, 1471, 1477, 1482, 1494, + 1497, 1508, 1509, 1515, 1516, 1522, 1526, 1532, 1533, 1539, + 1543, 1549, 1572, 1577, 1583, 1589, 1596, 1605, 1614, 1629, + 1635, 1640, 1644, 1651, 1664, 1665, 1671, 1677, 1680, 1684, + 1690, 1693, 1702, 1705, 1706, 1710, 1711, 1717, 1718, 1719, + 1720, 1721, 1723, 1722, 1737, 1743, 1747, 1751, 1755, 1759, + 1764, 1783, 1789, 1797, 1801, 1807, 1811, 1817, 1821, 1827, + 1831, 1840, 1844, 1848, 1852, 1858, 1861, 1869, 1870, 1872, + 1873, 1876, 1879, 1882, 1885, 1888, 1891, 1894, 1897, 1900, + 1903, 1906, 1909, 1912, 1915, 1921, 1925, 1929, 1933, 1937, + 1941, 1961, 1968, 1979, 1980, 1981, 1984, 1985, 1988, 1992, + 2002, 2006, 2010, 2014, 2018, 2022, 2026, 2032, 2038, 2046, + 2054, 2060, 2067, 2083, 2105, 2109, 2115, 2118, 2121, 2125, + 2135, 2139, 2158, 2166, 2167, 2179, 2180, 2183, 2187, 2193, + 2197, 2203, 2207 }; #endif @@ -772,35 +772,35 @@ static const yytype_uint8 yyr1[] = 93, 93, 93, 94, 94, 95, 95, 95, 96, 97, 98, 98, 98, 98, 98, 98, 99, 99, 99, 99, 101, 100, 103, 102, 104, 104, 106, 105, 107, 107, - 108, 108, 108, 109, 111, 110, 112, 112, 114, 115, - 116, 113, 118, 117, 119, 119, 120, 120, 122, 123, - 121, 125, 124, 126, 126, 126, 126, 126, 126, 126, + 107, 108, 108, 108, 109, 111, 110, 112, 112, 114, + 115, 116, 113, 118, 117, 119, 119, 120, 120, 122, + 123, 121, 125, 124, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 128, 128, 128, 129, 129, 129, 129, + 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 130, 131, 132, 132, 133, 133, 134, 134, 135, 135, - 136, 137, 137, 138, 139, 140, 140, 141, 141, 141, - 142, 142, 143, 144, 145, 145, 146, 146, 146, 146, - 146, 146, 147, 147, 147, 147, 148, 148, 148, 148, - 148, 149, 149, 150, 151, 151, 151, 151, 151, 152, - 152, 153, 153, 153, 153, 153, 153, 153, 154, 155, - 156, 156, 157, 157, 158, 159, 159, 160, 160, 161, - 162, 162, 163, 163, 163, 164, 165, 165, 166, 166, - 167, 167, 168, 168, 169, 169, 170, 170, 171, 171, - 172, 172, 172, 172, 172, 172, 173, 173, 174, 175, - 175, 175, 176, 177, 177, 177, 177, 178, 178, 179, - 179, 180, 180, 180, 180, 180, 181, 181, 181, 181, - 181, 182, 181, 181, 181, 181, 181, 181, 181, 181, - 183, 183, 184, 184, 185, 185, 186, 186, 187, 187, - 188, 188, 188, 188, 189, 189, 190, 190, 191, 191, - 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, - 197, 197, 198, 198, 199, 199, 199, 199, 199, 199, - 200, 201, 202, 202, 202, 203, 203, 204, 204, 204, - 204, 204, 204, 204, 204, 204, 204, 204, 205, 206, - 207, 207, 208, 209, 209, 210, 210, 211, 211, 212, - 212, 212, 213, 213, 214, 214, 215, 215, 216, 216, - 217, 217 + 129, 130, 131, 132, 132, 133, 133, 134, 134, 135, + 135, 136, 137, 137, 138, 139, 140, 140, 141, 141, + 141, 142, 142, 143, 144, 145, 145, 146, 146, 146, + 146, 146, 146, 147, 147, 147, 147, 148, 148, 148, + 148, 148, 149, 149, 150, 151, 151, 151, 151, 151, + 152, 152, 153, 153, 153, 153, 153, 153, 153, 154, + 155, 156, 156, 157, 157, 158, 159, 159, 160, 160, + 161, 162, 162, 163, 163, 163, 164, 165, 165, 166, + 166, 167, 167, 168, 168, 169, 169, 170, 170, 171, + 171, 172, 172, 172, 172, 172, 172, 173, 173, 174, + 175, 175, 175, 176, 177, 177, 177, 177, 178, 178, + 179, 179, 180, 180, 180, 180, 180, 181, 181, 181, + 181, 181, 182, 181, 181, 181, 181, 181, 181, 181, + 181, 183, 183, 184, 184, 185, 185, 186, 186, 187, + 187, 188, 188, 188, 188, 189, 189, 190, 190, 191, + 191, 192, 192, 193, 193, 194, 194, 195, 195, 196, + 196, 197, 197, 198, 198, 199, 199, 199, 199, 199, + 199, 200, 201, 202, 202, 202, 203, 203, 204, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 204, 205, + 206, 207, 207, 208, 209, 209, 210, 210, 211, 211, + 212, 212, 212, 213, 213, 214, 214, 215, 215, 216, + 216, 217, 217 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -813,35 +813,35 @@ static const yytype_uint8 yyr2[] = 2, 4, 3, 4, 3, 1, 2, 1, 1, 2, 1, 3, 3, 3, 2, 2, 3, 5, 5, 2, 0, 4, 0, 3, 0, 2, 0, 4, 4, 4, - 5, 1, 1, 2, 0, 3, 1, 3, 0, 0, - 0, 8, 0, 5, 0, 2, 0, 2, 0, 0, - 7, 0, 5, 1, 3, 3, 3, 3, 3, 3, + 2, 5, 1, 1, 2, 0, 3, 1, 3, 0, + 0, 0, 8, 0, 5, 0, 2, 0, 2, 0, + 0, 7, 0, 5, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 1, 2, 2, 2, 2, 2, - 2, 2, 2, 3, 5, 6, 1, 1, 3, 5, - 5, 4, 6, 8, 1, 5, 5, 5, 7, 1, - 0, 3, 1, 4, 1, 4, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, - 4, 4, 1, 1, 1, 2, 1, 1, 1, 1, - 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 4, 4, 2, 3, 5, 1, 1, 2, 3, - 5, 3, 5, 3, 3, 5, 8, 5, 8, 5, - 0, 3, 0, 1, 3, 1, 4, 2, 0, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 3, 2, 4, 3, 5, 5, 1, 3, 1, 2, - 1, 3, 4, 1, 2, 2, 1, 1, 3, 0, - 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 0, 4, 1, 2, 2, 2, 2, 2, 2, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 1, 3, 3, 0, 2, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 4, 4, 5, 6, 4, 4, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 4, 5, 4, 4, 2, 2, 4, 3, 3, 5, - 3, 4, 3, 5, 1, 0, 1, 3, 1, 1, - 2, 1, 1, 5, 0, 2, 1, 3, 1, 3, - 1, 3 + 3, 3, 3, 3, 3, 1, 2, 2, 2, 2, + 2, 2, 2, 2, 3, 5, 6, 1, 1, 3, + 5, 5, 4, 6, 8, 1, 5, 5, 5, 7, + 1, 0, 3, 1, 4, 1, 4, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 4, 4, 1, 1, 1, 2, 1, 1, 1, + 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, + 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 4, 4, 2, 3, 5, 1, 1, 2, + 3, 5, 3, 5, 3, 3, 5, 8, 5, 8, + 5, 0, 3, 0, 1, 3, 1, 4, 2, 0, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 3, 2, 4, 3, 5, 5, 1, 3, 1, + 2, 1, 3, 4, 1, 2, 2, 1, 1, 3, + 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 4, 1, 2, 2, 2, 2, 2, + 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 1, 3, 3, 0, 2, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 4, 4, 5, 6, 4, + 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 4, 5, 4, 4, 2, 2, 4, 3, 3, + 5, 3, 4, 3, 5, 1, 0, 1, 3, 1, + 1, 2, 1, 1, 5, 0, 2, 1, 3, 1, + 3, 1, 3 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -849,656 +849,642 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 5, 0, 3, 0, 1, 0, 7, 0, 22, 157, - 159, 0, 0, 158, 218, 20, 6, 344, 0, 4, + 5, 0, 3, 0, 1, 0, 7, 0, 22, 158, + 160, 0, 0, 159, 219, 20, 6, 345, 0, 4, 0, 0, 0, 21, 0, 0, 0, 16, 0, 0, - 9, 22, 0, 8, 28, 126, 155, 0, 39, 155, - 0, 263, 74, 0, 0, 0, 78, 0, 0, 292, - 91, 0, 88, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 290, 0, 25, 0, 256, 257, - 260, 258, 259, 50, 93, 134, 146, 114, 163, 162, - 127, 0, 0, 0, 183, 196, 197, 26, 215, 0, - 139, 27, 0, 19, 0, 0, 0, 0, 0, 0, - 345, 160, 161, 11, 14, 286, 18, 22, 13, 17, - 156, 264, 153, 0, 0, 0, 0, 162, 189, 193, - 179, 177, 178, 176, 265, 134, 0, 294, 249, 0, - 210, 134, 268, 294, 151, 152, 0, 0, 276, 293, - 269, 0, 0, 294, 0, 0, 36, 48, 0, 29, - 274, 154, 0, 122, 117, 118, 121, 115, 116, 0, - 0, 148, 0, 149, 174, 172, 173, 119, 120, 0, - 291, 0, 219, 0, 32, 0, 0, 0, 0, 0, + 9, 22, 0, 8, 28, 127, 156, 0, 39, 156, + 0, 264, 75, 0, 0, 0, 79, 0, 0, 293, + 92, 0, 89, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 291, 0, 25, 0, 257, 258, + 261, 259, 260, 50, 94, 135, 147, 115, 164, 163, + 128, 0, 0, 0, 184, 197, 198, 26, 216, 0, + 140, 27, 0, 19, 0, 0, 0, 0, 0, 0, + 346, 161, 162, 11, 14, 287, 18, 22, 13, 17, + 157, 265, 154, 0, 0, 0, 0, 163, 190, 194, + 180, 178, 179, 177, 266, 135, 0, 295, 250, 0, + 211, 135, 269, 295, 152, 153, 0, 0, 277, 294, + 270, 0, 0, 295, 0, 0, 36, 48, 0, 29, + 275, 155, 0, 123, 118, 119, 122, 116, 117, 0, + 0, 149, 0, 150, 175, 173, 174, 120, 121, 0, + 292, 0, 220, 0, 32, 0, 0, 0, 0, 0, 55, 0, 0, 0, 54, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, - 0, 0, 290, 261, 0, 140, 217, 0, 0, 0, - 0, 310, 0, 0, 210, 0, 0, 311, 0, 0, - 23, 287, 0, 12, 249, 0, 0, 194, 170, 168, - 169, 166, 167, 198, 0, 0, 295, 72, 0, 75, - 0, 71, 164, 243, 162, 246, 150, 247, 288, 0, - 249, 0, 204, 79, 76, 157, 0, 203, 0, 286, - 240, 228, 0, 64, 0, 0, 201, 272, 286, 226, - 238, 302, 0, 89, 38, 224, 286, 49, 31, 220, - 286, 0, 0, 40, 0, 175, 147, 0, 0, 35, - 286, 0, 0, 51, 95, 110, 113, 96, 100, 101, - 99, 111, 98, 97, 94, 112, 102, 103, 104, 105, - 106, 107, 108, 109, 284, 123, 278, 288, 0, 128, - 291, 0, 0, 288, 284, 255, 60, 253, 252, 270, - 254, 0, 53, 52, 277, 0, 0, 0, 0, 318, - 0, 0, 0, 0, 0, 317, 0, 312, 313, 314, - 0, 346, 0, 0, 296, 0, 0, 0, 15, 10, - 0, 0, 0, 180, 190, 66, 73, 0, 0, 294, - 165, 244, 245, 289, 250, 212, 0, 0, 0, 294, - 0, 236, 0, 249, 239, 287, 0, 0, 0, 0, - 302, 0, 0, 287, 0, 303, 231, 0, 302, 0, - 287, 0, 287, 0, 42, 275, 0, 0, 0, 199, - 170, 168, 169, 167, 140, 192, 191, 287, 0, 44, - 0, 140, 142, 280, 281, 288, 0, 288, 289, 0, - 0, 0, 131, 290, 262, 289, 0, 0, 0, 0, - 216, 0, 0, 325, 315, 316, 296, 300, 0, 298, - 0, 324, 339, 0, 0, 341, 342, 0, 0, 0, - 0, 0, 302, 0, 0, 309, 0, 297, 304, 308, - 305, 212, 171, 0, 0, 0, 0, 248, 249, 162, - 213, 188, 186, 187, 184, 185, 209, 212, 211, 80, - 77, 237, 241, 0, 229, 202, 195, 0, 0, 92, - 62, 65, 0, 233, 0, 302, 227, 200, 273, 230, - 64, 225, 37, 221, 30, 41, 0, 284, 45, 222, - 286, 47, 33, 43, 284, 0, 289, 285, 137, 0, - 279, 124, 130, 129, 0, 135, 136, 0, 271, 327, - 0, 0, 318, 0, 317, 0, 334, 350, 301, 0, - 0, 0, 348, 299, 328, 340, 0, 306, 0, 319, - 0, 302, 330, 0, 347, 335, 0, 69, 68, 294, - 0, 249, 205, 84, 212, 0, 59, 0, 302, 302, - 232, 0, 171, 0, 287, 0, 46, 0, 140, 144, - 141, 282, 283, 125, 290, 132, 61, 326, 335, 296, - 323, 0, 0, 302, 322, 0, 0, 320, 307, 331, - 296, 296, 338, 207, 336, 67, 70, 214, 0, 86, - 242, 0, 0, 56, 0, 63, 235, 234, 90, 138, - 223, 34, 143, 284, 0, 329, 0, 351, 321, 332, - 349, 0, 0, 0, 212, 0, 85, 81, 0, 0, - 0, 133, 335, 343, 335, 337, 206, 82, 87, 58, - 57, 145, 333, 208, 294, 0, 83 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 141, + 0, 0, 291, 262, 0, 141, 218, 0, 0, 0, + 0, 311, 0, 0, 211, 0, 0, 312, 0, 0, + 23, 288, 0, 12, 250, 0, 0, 195, 171, 169, + 170, 167, 168, 199, 0, 0, 0, 296, 73, 0, + 76, 0, 72, 165, 244, 163, 247, 151, 248, 289, + 0, 250, 0, 205, 80, 77, 158, 0, 204, 0, + 287, 241, 229, 0, 64, 0, 0, 202, 273, 287, + 227, 239, 303, 0, 90, 38, 225, 287, 49, 31, + 221, 287, 0, 0, 40, 0, 176, 148, 0, 0, + 35, 287, 0, 0, 51, 96, 111, 114, 97, 101, + 102, 100, 112, 99, 98, 95, 113, 103, 104, 105, + 106, 107, 108, 109, 110, 285, 124, 279, 289, 0, + 129, 292, 0, 0, 289, 285, 256, 60, 254, 253, + 271, 255, 0, 53, 52, 278, 0, 0, 0, 0, + 319, 0, 0, 0, 0, 0, 318, 0, 313, 314, + 315, 0, 347, 0, 0, 297, 0, 0, 0, 15, + 10, 0, 0, 0, 181, 191, 70, 66, 74, 0, + 0, 295, 166, 245, 246, 290, 251, 213, 0, 0, + 0, 295, 0, 237, 0, 250, 240, 288, 0, 0, + 0, 0, 303, 0, 0, 288, 0, 304, 232, 0, + 303, 0, 288, 0, 288, 0, 42, 276, 0, 0, + 0, 200, 171, 169, 170, 168, 141, 193, 192, 288, + 0, 44, 0, 141, 143, 281, 282, 289, 0, 289, + 290, 0, 0, 0, 132, 291, 263, 290, 0, 0, + 0, 0, 217, 0, 0, 326, 316, 317, 297, 301, + 0, 299, 0, 325, 340, 0, 0, 342, 343, 0, + 0, 0, 0, 0, 303, 0, 0, 310, 0, 298, + 305, 309, 306, 213, 172, 0, 0, 0, 0, 249, + 250, 163, 214, 189, 187, 188, 185, 186, 210, 213, + 212, 81, 78, 238, 242, 0, 230, 203, 196, 0, + 0, 93, 62, 65, 0, 234, 0, 303, 228, 201, + 274, 231, 64, 226, 37, 222, 30, 41, 0, 285, + 45, 223, 287, 47, 33, 43, 285, 0, 290, 286, + 138, 0, 280, 125, 131, 130, 0, 136, 137, 0, + 272, 328, 0, 0, 319, 0, 318, 0, 335, 351, + 302, 0, 0, 0, 349, 300, 329, 341, 0, 307, + 0, 320, 0, 303, 331, 0, 348, 336, 0, 69, + 68, 295, 0, 250, 206, 85, 213, 0, 59, 0, + 303, 303, 233, 0, 172, 0, 288, 0, 46, 0, + 141, 145, 142, 283, 284, 126, 291, 133, 61, 327, + 336, 297, 324, 0, 0, 303, 323, 0, 0, 321, + 308, 332, 297, 297, 339, 208, 337, 67, 71, 215, + 0, 87, 243, 0, 0, 56, 0, 63, 236, 235, + 91, 139, 224, 34, 144, 285, 0, 330, 0, 352, + 322, 333, 350, 0, 0, 0, 213, 0, 86, 82, + 0, 0, 0, 134, 336, 344, 336, 338, 207, 83, + 88, 58, 57, 146, 334, 209, 295, 0, 84 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 1, 6, 2, 3, 14, 21, 30, 105, 31, - 8, 24, 16, 17, 65, 327, 67, 149, 518, 519, - 145, 146, 68, 500, 328, 438, 501, 577, 388, 366, - 473, 237, 238, 239, 69, 127, 253, 70, 133, 378, - 573, 646, 664, 619, 647, 71, 143, 399, 72, 141, - 73, 74, 75, 76, 314, 423, 424, 590, 77, 316, - 243, 136, 78, 150, 111, 117, 13, 80, 81, 245, - 246, 163, 119, 82, 83, 480, 228, 84, 230, 231, - 85, 86, 87, 130, 214, 88, 252, 486, 89, 90, - 22, 280, 520, 276, 268, 259, 269, 270, 271, 261, - 384, 247, 248, 249, 329, 330, 322, 331, 272, 152, - 92, 317, 425, 426, 222, 374, 171, 140, 254, 466, - 551, 545, 396, 100, 212, 218, 612, 443, 347, 348, - 349, 351, 552, 547, 613, 614, 456, 457, 25, 467, - 553, 548 + 8, 24, 16, 17, 65, 328, 67, 149, 520, 521, + 145, 146, 68, 502, 329, 440, 503, 579, 390, 368, + 475, 238, 239, 240, 69, 127, 254, 70, 133, 380, + 575, 648, 666, 621, 649, 71, 143, 401, 72, 141, + 73, 74, 75, 76, 315, 425, 426, 592, 77, 317, + 244, 136, 78, 150, 111, 117, 13, 80, 81, 246, + 247, 163, 119, 82, 83, 482, 228, 84, 230, 231, + 85, 86, 87, 130, 214, 88, 253, 488, 89, 90, + 22, 281, 522, 277, 269, 260, 270, 271, 272, 262, + 386, 248, 249, 250, 330, 331, 323, 332, 273, 152, + 92, 318, 427, 428, 222, 376, 171, 140, 255, 468, + 553, 547, 398, 100, 212, 218, 614, 445, 348, 349, + 350, 352, 554, 549, 615, 616, 458, 459, 25, 469, + 555, 550 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -474 +#define YYPACT_NINF -473 static const yytype_int16 yypact[] = { - -474, 48, 28, 35, -474, 258, -474, 37, -474, -474, - -474, 61, 12, -474, 85, 107, -474, -474, 70, -474, - 156, 82, 1059, -474, 122, 328, 22, -474, 56, 199, - -474, 35, 211, -474, -474, -474, 258, 767, -474, 258, - 459, -474, -474, 152, 459, 258, -474, 23, 145, 1650, - -474, 23, -474, 294, 359, 1650, 1650, 1650, 1650, 1650, - 1650, 1693, 1650, 1650, 1289, 159, -474, 412, -474, -474, - -474, -474, -474, 939, -474, -474, 157, 302, -474, 168, - -474, 175, 184, 23, 204, -474, -474, -474, 219, 54, - -474, -474, 47, -474, 227, -12, 269, 227, 227, 239, - -474, -474, -474, -474, -474, 240, -474, -474, -474, -474, - -474, -474, -474, 250, 1813, 1813, 1813, -474, 259, -474, - -474, -474, -474, -474, -474, 64, 302, 1650, 1805, 262, - 260, 174, -474, 1650, -474, -474, 221, 1813, 2166, 255, - -474, 290, 237, 1650, 304, 1813, -474, -474, 420, -474, - -474, -474, 580, -474, -474, -474, -474, -474, -474, 1736, - 1693, 2166, 280, -474, 253, -474, 50, -474, -474, 275, - 2166, 285, -474, 430, -474, 612, 1650, 1650, 1650, 1650, - -474, 1650, 1650, 1650, -474, 1650, 1650, 1650, 1650, 1650, - 1650, 1650, 1650, 1650, 1650, 1650, 1650, 1650, 1650, -474, - 1332, 428, 1650, -474, 1650, -474, -474, 1234, 1650, 1650, - 1650, -474, 763, 258, 260, 293, 369, -474, 1992, 1992, - -474, 51, 326, -474, 1805, 392, 1813, -474, -474, -474, - -474, -474, -474, -474, 341, 258, -474, -474, 371, -474, - 89, 342, 1813, -474, 1805, -474, -474, -474, 335, 360, - 1805, 1234, -474, -474, 357, 99, 399, -474, 365, 380, - -474, -474, 377, -474, 173, 151, -474, -474, 381, -474, - -474, 456, 1779, -474, -474, -474, 401, -474, -474, -474, - 404, 1650, 258, 366, 1838, -474, 405, 1813, 1813, -474, - 407, 1650, 410, 2166, 650, -474, 2190, 877, 877, 877, - 877, -474, 877, 877, 2214, -474, 461, 461, 461, 461, - -474, -474, -474, -474, 1387, -474, -474, 52, 1442, -474, - 2064, 411, 1160, 2031, 1387, -474, -474, -474, -474, -474, - -474, 19, 255, 255, 2166, 1905, 447, 441, 439, -474, - 444, 505, 1992, 225, 27, -474, 454, -474, -474, -474, - 1931, -474, 125, 458, 258, 460, 465, 466, -474, -474, - 463, 1813, 480, -474, -474, -474, -474, 1497, 1552, 1650, - -474, -474, -474, 1805, -474, 1872, 484, 24, 371, 1650, - 258, 485, 487, 1805, -474, 472, 481, 1813, 81, 399, - 456, 399, 490, 289, 483, -474, -474, 258, 456, 519, - 258, 495, 258, 496, 255, -474, 1650, 1897, 1813, -474, - 321, 349, 350, 354, -474, -474, -474, 258, 497, 255, - 1650, -474, 2094, -474, -474, 488, 491, 489, 1693, 498, - 500, 502, -474, 1650, -474, -474, 506, 503, 1234, 1160, - -474, 1992, 534, -474, -474, -474, 258, 1958, 1992, 258, - 1992, -474, -474, 565, 149, -474, -474, 510, 504, 1992, - 225, 1992, 456, 258, 258, -474, 514, 507, -474, -474, - -474, 1872, -474, 1234, 1650, 1650, 515, -474, 1805, 520, - -474, -474, -474, -474, -474, -474, -474, 1872, -474, -474, - -474, -474, -474, 518, -474, -474, -474, 1693, 517, -474, - -474, -474, 524, -474, 525, 456, -474, -474, -474, -474, - -474, -474, -474, -474, -474, 255, 526, 1387, -474, -474, - 527, 612, -474, 255, 1387, 1595, 1387, -474, -474, 530, - -474, -474, -474, -474, 116, -474, -474, 141, -474, -474, - 539, 540, 521, 542, 546, 538, -474, -474, 548, 543, - 1992, 549, -474, 552, -474, -474, 562, -474, 1992, -474, - 556, 456, -474, 560, -474, 1984, 238, 2166, 2166, 1650, - 561, 1805, -474, -474, 1872, 32, -474, 1160, 456, 456, - -474, 186, 370, 554, 258, 563, 410, 557, -474, 2166, - -474, -474, -474, -474, 1650, -474, -474, -474, 1984, 258, - -474, 1958, 1992, 456, -474, 258, 149, -474, -474, -474, - 258, 258, -474, -474, -474, -474, -474, -474, 564, 613, - -474, 1650, 1650, -474, 1693, 566, -474, -474, -474, -474, - -474, -474, -474, 1387, 558, -474, 571, -474, -474, -474, - -474, 577, 582, 583, 1872, 36, -474, -474, 2118, 2142, - 572, -474, 1984, -474, 1984, -474, -474, -474, -474, -474, - -474, -474, -474, -474, 1650, 371, -474 + -473, 65, 22, 49, -473, 261, -473, 64, -473, -473, + -473, 95, 52, -473, 143, 145, -473, -473, 104, -473, + 68, 128, 1049, -473, 142, 305, 16, -473, 56, 204, + -473, 49, 220, -473, -473, -473, 261, 974, -473, 261, + 562, -473, -473, 288, 562, 261, -473, 14, 147, 1615, + -473, 14, -473, 395, 401, 1615, 1615, 1615, 1615, 1615, + 1615, 1658, 1615, 1615, 737, 168, -473, 414, -473, -473, + -473, -473, -473, 649, -473, -473, 165, 122, -473, 169, + -473, 177, 218, 14, 219, -473, -473, -473, 235, 89, + -473, -473, 34, -473, 206, 124, 286, 206, 206, 260, + -473, -473, -473, -473, -473, 265, -473, -473, -473, -473, + -473, -473, -473, 270, 1803, 1803, 1803, -473, 269, -473, + -473, -473, -473, -473, -473, 39, 122, 882, 1777, 283, + 277, 230, -473, 1615, -473, -473, 292, 1803, 2097, 280, + -473, 332, 315, 1615, 215, 1803, -473, -473, 244, -473, + -473, -473, 949, -473, -473, -473, -473, -473, -473, 1701, + 1658, 2097, 298, -473, 9, -473, 59, -473, -473, 303, + 2097, 319, -473, 330, -473, 1744, 1615, 1615, 1615, 1615, + -473, 1615, 1615, 1615, -473, 1615, 1615, 1615, 1615, 1615, + 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, 1615, -473, + 1297, 455, 1615, -473, 1615, -473, -473, 1225, 1615, 1615, + 1615, -473, 594, 261, 277, 328, 403, -473, 1308, 1308, + -473, 152, 352, -473, 1777, 405, 1803, -473, -473, -473, + -473, -473, -473, -473, 354, 261, 1615, -473, -473, 382, + -473, 47, 360, 1803, -473, 1777, -473, -473, -473, 351, + 367, 1777, 1225, -473, -473, 366, 84, 407, -473, 374, + 373, -473, -473, 372, -473, 138, 42, -473, -473, 377, + -473, -473, 442, 1769, -473, -473, -473, 384, -473, -473, + -473, 389, 1615, 261, 391, 1830, -473, 394, 1803, 1803, + -473, 409, 1615, 411, 2097, 1935, -473, 2121, 1080, 1080, + 1080, 1080, -473, 1080, 1080, 2145, -473, 503, 503, 503, + 503, -473, -473, -473, -473, 1352, -473, -473, 27, 1407, + -473, 1995, 412, 1147, 1962, 1352, -473, -473, -473, -473, + -473, -473, 7, 280, 280, 2097, 698, 418, 415, 413, + -473, 416, 477, 1308, 188, 31, -473, 425, -473, -473, + -473, 1897, -473, 221, 433, 261, 434, 436, 439, -473, + -473, 432, 1803, 452, -473, -473, 2097, -473, -473, 1462, + 1517, 1615, -473, -473, -473, 1777, -473, 1856, 453, 91, + 382, 1615, 261, 454, 456, 1777, -473, 475, 451, 1803, + 133, 407, 442, 407, 460, 326, 462, -473, -473, 261, + 442, 467, 261, 478, 261, 486, 280, -473, 1615, 1864, + 1803, -473, 26, 248, 264, 430, -473, -473, -473, 261, + 492, 280, 1615, -473, 2025, -473, -473, 485, 493, 487, + 1658, 504, 506, 508, -473, 1615, -473, -473, 512, 505, + 1225, 1147, -473, 1308, 517, -473, -473, -473, 261, 1889, + 1308, 261, 1308, -473, -473, 571, 155, -473, -473, 514, + 509, 1308, 188, 1308, 442, 261, 261, -473, 518, 507, + -473, -473, -473, 1856, -473, 1225, 1615, 1615, 521, -473, + 1777, 528, -473, -473, -473, -473, -473, -473, -473, 1856, + -473, -473, -473, -473, -473, 520, -473, -473, -473, 1658, + 522, -473, -473, -473, 530, -473, 532, 442, -473, -473, + -473, -473, -473, -473, -473, -473, -473, 280, 535, 1352, + -473, -473, 536, 1744, -473, 280, 1352, 1560, 1352, -473, + -473, 539, -473, -473, -473, -473, 247, -473, -473, 308, + -473, -473, 541, 543, 545, 546, 547, 544, -473, -473, + 551, 548, 1308, 554, -473, 557, -473, -473, 576, -473, + 1308, -473, 564, 442, -473, 568, -473, 1923, 318, 2097, + 2097, 1615, 569, 1777, -473, -473, 1856, 156, -473, 1147, + 442, 442, -473, 243, 483, 563, 261, 577, 411, 570, + -473, 2097, -473, -473, -473, -473, 1615, -473, -473, -473, + 1923, 261, -473, 1889, 1308, 442, -473, 261, 155, -473, + -473, -473, 261, 261, -473, -473, -473, -473, -473, -473, + 579, 627, -473, 1615, 1615, -473, 1658, 580, -473, -473, + -473, -473, -473, -473, -473, 1352, 572, -473, 583, -473, + -473, -473, -473, 585, 586, 590, 1856, 77, -473, -473, + 2049, 2073, 584, -473, 1923, -473, 1923, -473, -473, -473, + -473, -473, -473, -473, -473, -473, 1615, 382, -473 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -474, -474, -474, -474, -474, -474, -474, -15, -474, -474, - 616, -474, -3, -474, -474, 622, -474, -125, -27, 66, - -474, -124, -112, -474, 11, -474, -474, -474, 147, -368, - -474, -474, -474, -474, -474, -474, -140, -474, -474, -474, - -474, -474, -474, -474, -474, -474, -474, -474, -474, -474, - 532, 10, 247, -474, -194, 132, 135, -474, 279, -59, - 418, 67, 5, 384, 624, 425, 317, 20, -474, 424, - 636, 509, -474, -474, -474, -474, -36, -37, -31, -49, - -474, -474, -474, -474, -474, -32, 464, -473, -474, -474, - -474, -474, -474, -474, -474, -474, 277, -119, -231, 287, - -474, 300, -474, -205, -300, 652, -474, -242, -474, -63, - 106, 182, -474, -316, -241, -285, -195, -474, -111, -420, - -474, -474, -245, -474, 402, -474, -176, -474, 345, 249, - 346, 218, 87, 96, -415, -474, -429, 252, -474, 522, - -474, -474 + -473, -473, -473, -473, -473, -473, -473, -12, -473, -473, + 624, -473, -1, -473, -473, 635, -473, -137, -48, 74, + -473, -130, -112, -473, 11, -473, -473, -473, 149, -372, + -473, -473, -473, -473, -473, -473, -140, -473, -473, -473, + -473, -473, -473, -473, -473, -473, -473, -473, -473, -473, + 662, 448, 257, -473, -196, 135, 139, -473, 262, -59, + 424, -16, -3, 387, 632, 427, 313, 20, -473, 428, + -89, 524, -473, -473, -473, -473, -36, -37, -31, -49, + -473, -473, -473, -473, -473, -32, 458, -472, -473, -473, + -473, -473, -473, -473, -473, -473, 279, -108, -211, 290, + -473, 306, -473, -214, -291, 658, -473, -230, -473, -63, + -6, 191, -473, -302, -219, -254, -195, -473, -107, -435, + -473, -473, -347, -473, 323, -473, 72, -473, 371, 268, + 380, 242, 102, 110, -468, -473, -438, 255, -473, 515, + -473, -473 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -277 +#define YYTABLE_NINF -278 static const yytype_int16 yytable[] = { - 121, 120, 162, 273, 175, 123, 122, 321, 437, 377, - 489, 324, 165, 104, 572, 236, 241, 260, 386, 360, - 275, 236, 434, 279, 164, 556, 541, 394, 108, 166, - 458, 236, 429, 390, 392, 401, 346, 621, 436, 403, - 174, 110, 356, 357, 110, 376, 101, 213, 4, 418, - 132, -215, 208, 5, 27, 206, 657, 118, 134, 27, - 7, 15, 11, 427, 18, 153, 154, 155, 156, 157, - 158, -267, 167, 168, 19, 9, -267, 229, 229, 229, - 9, 439, 232, 232, 232, -215, 439, 440, 497, 134, - 135, 229, 488, 498, 367, 102, 232, 622, 623, 459, - 229, 620, -236, 326, 223, 232, 20, 624, 229, -181, - 175, 165, 209, 232, 29, 229, 103, -215, 142, 29, - 232, 135, 210, 164, 10, 11, -267, 428, 166, 10, - 11, 23, -267, 26, 118, 118, 118, 382, 229, 538, - 527, 258, 529, 232, 33, 503, 290, 267, 118, 499, - 205, 165, 452, 509, 368, 139, 207, 118, 502, 27, - 504, -236, 380, 164, 210, 118, 451, -236, 166, 153, - 157, 656, 118, 9, 462, 381, 9, 641, 493, 636, - 9, -266, 594, 635, 93, 463, -266, 229, 595, 229, - 642, 643, 232, 497, 232, 118, 537, 381, 498, 453, - 464, 583, 106, 439, 391, 229, 358, 229, 587, 596, - 232, 128, 232, 229, 109, 28, 137, 562, 232, 29, - 517, 172, 10, 11, 199, 10, 11, 524, 452, 10, - 11, 566, 389, 240, -153, 229, -266, 662, 534, 663, - 232, 203, -266, 204, 118, 255, 118, 411, 410, 9, - 229, 229, 413, 412, 628, 232, 232, 236, 476, 431, - 580, 255, 118, -182, 118, 539, 260, 236, 490, 165, - 118, 546, 549, 570, 554, 453, 511, 513, -181, 585, - 256, 164, 9, 559, 454, 561, 166, 125, -183, 257, - 264, 131, 118, 216, 10, 11, 265, 666, 10, 11, - 439, 11, 221, 220, 118, 266, 615, 118, 118, 224, - 10, 11, -182, 255, 332, 333, 609, 650, 9, 126, - -183, 250, 235, 126, 229, 263, 484, 251, 9, 232, - 210, 10, 11, 626, 627, 625, 229, 94, 482, 481, - 286, 232, 264, 485, 483, 95, 229, 287, 265, 96, - 229, 232, 354, 144, 521, 232, -179, 288, 639, 97, - 98, 200, 10, 11, 274, 201, 618, 10, 11, 530, - 229, 229, 355, 202, 603, 232, 232, 10, 11, 165, - -179, 118, 607, 9, -177, -178, 359, 404, -179, -176, - 258, 164, 99, 118, 633, 118, 166, 419, 267, 634, - 361, 363, 508, 118, 369, -180, 365, 118, -177, -178, - 373, 211, 211, -176, 211, 211, -177, -178, 148, 379, - 375, -176, 484, 381, 383, 546, 638, 118, 118, -180, - 12, 406, 10, 11, 482, 481, 9, -180, 484, 485, - 483, 229, 385, 393, 9, 32, 232, 79, 165, 387, - 482, 481, 9, 32, 9, 485, 483, 236, 616, 395, - 164, 112, 35, 400, 112, 166, 402, 37, 129, 417, - 112, 173, 414, 332, 333, 420, 113, 433, 147, 151, - 278, 47, 48, 9, 229, 10, 11, 318, 51, 232, - 289, 118, 151, 10, 11, 178, 255, 215, 118, 217, - 219, 10, 11, 10, 11, 186, 446, 118, 447, 190, - 448, 449, 515, 450, 195, 196, 197, 198, 61, 460, - 465, 521, 468, 471, 665, 484, 523, 469, 470, 345, - 64, 256, 10, 11, 229, 345, 345, 482, 481, 232, - 472, 118, 485, 483, 487, 10, 11, 492, 380, 495, - 505, 507, 236, 244, 510, 512, 514, 522, 531, 528, - 532, 112, 533, 526, 435, 530, 535, 112, 555, 147, - 341, 536, 557, 151, 565, 165, 558, 569, 574, 571, - -157, 138, 464, 576, 578, 579, 582, 164, 37, 584, - 593, 118, 166, 161, 118, 484, 170, 113, 151, 597, - 598, 599, 47, 48, 9, -158, 600, 482, 481, 51, - 601, 606, 485, 483, 605, 602, 225, 604, 608, 610, - 37, 617, 629, 631, 644, 632, 319, 645, 439, 113, - 651, 652, 79, 115, 47, 48, 9, 653, 350, 226, - 661, 51, 654, 655, 66, 281, 32, 107, 225, 244, - 630, 64, 345, 10, 11, 282, 658, 581, 591, 345, - 364, 592, 371, 124, 118, 115, 405, 345, 372, 285, - 506, 226, 494, 477, 91, 244, 79, 291, 353, 575, - 444, 445, 564, 64, 178, 10, 11, 282, 181, 182, - 183, 540, 640, 185, 186, 187, 188, 637, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 151, 293, 294, - 295, 296, 560, 297, 298, 299, 0, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 0, 161, 0, 320, 352, 323, 0, 0, 0, - 138, 138, 334, 0, 0, 0, 0, 79, 0, 0, - 227, 233, 234, 0, 0, 0, 0, 0, 345, 0, - 0, 0, 0, 0, 544, 345, 0, 345, 455, 0, - 0, 335, 0, 262, 0, 37, 345, 0, 345, 350, - 336, 277, 0, 0, 113, 337, 338, 339, 283, 47, - 48, 9, 340, 0, 0, 0, 51, 0, 244, 341, - 479, 0, 0, 114, 0, 491, 0, 0, 244, 0, - 112, 292, 0, 138, 0, 0, 342, 0, 112, 0, - 115, 0, 112, 138, 0, 147, 116, 151, 343, 0, - 0, 0, 0, 0, 344, 0, 0, 11, 64, 0, - 10, 11, 151, 0, 0, 0, 422, 0, 0, 0, - 161, 0, 0, 0, 0, 0, 422, 0, 0, 0, - 0, 0, 362, 79, 79, 0, 0, 345, 0, 0, - 0, 350, 543, 0, 550, 345, 0, 0, 370, 455, - 0, 0, 345, 0, 0, 455, 0, 0, 563, 350, - 0, 0, 0, 0, 0, 0, 0, 0, 79, 138, - 138, 0, 0, 244, 0, 0, 0, 0, 398, 0, - 0, 178, 0, 0, 0, 345, 0, 0, 544, 345, - 409, 186, 0, 415, 416, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 0, 0, 0, 0, 138, 0, - 0, 0, 0, 176, -276, 0, 0, 0, 0, 0, - 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, - 161, 0, 0, 0, 0, 170, 0, 0, 0, 345, - 0, 345, 177, 178, 0, 179, 180, 181, 182, 183, - 0, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 244, 409, 0, 0, - 0, 0, 79, 0, -276, 0, 567, 568, 0, 151, - 0, 0, 0, 0, -276, 0, 0, 0, 0, 0, - 0, 0, 0, 496, 350, 0, 543, 0, 0, 161, - 550, 455, 0, 0, 0, 350, 350, 0, 0, 0, - 0, 0, 0, 227, 516, 0, 0, 0, 0, 422, - 0, 0, 0, 0, 0, 0, 422, 589, 422, -2, + 121, 120, 162, 274, 175, 123, 122, 322, 491, 325, + 361, 280, 165, 543, 276, 237, 104, 574, 558, 174, + 242, 237, 379, 439, 164, 227, 233, 234, 261, 166, + 108, 237, 436, 110, 460, 142, 110, 378, 429, 208, + 101, 388, 132, 139, -184, 505, -268, 5, 263, 134, + 396, -268, 369, 511, 392, 394, 278, 118, 403, 27, + -216, -180, 405, 284, 431, 4, 383, 205, -183, 441, + 438, 27, 420, 207, 7, 442, -184, 229, 229, 229, + 9, 135, 232, 232, 232, -180, 293, -237, 15, 102, + 206, 229, 9, -180, -216, 393, 232, 659, 18, 209, + 229, -268, 430, 461, 622, 232, 223, -268, 229, 210, + 175, 165, 370, 232, 19, 229, 103, 564, -182, 29, + 232, 241, 210, 164, 134, 291, -216, 28, 166, 10, + 11, 29, 637, 259, 118, 118, 118, 363, 229, 268, + 499, 10, 11, 232, 327, 500, -237, 382, 118, 384, + 540, 165, -237, 441, 372, 27, 135, 118, 454, 490, + 582, 623, 383, 164, 20, 118, 638, 26, 166, 23, + 643, 495, 118, 529, 658, 531, 9, 644, 645, 9, + 504, 200, 506, 213, 400, 201, 664, 229, 665, 229, + 33, 454, 232, 202, 232, 118, 411, 391, 11, 417, + 418, 501, 333, 334, 93, 455, 229, 106, 229, 359, + 539, 232, 9, 232, 229, 29, 611, 585, 137, 232, + 519, 624, 625, 109, 589, 10, 11, 526, 10, 11, + 172, 626, 199, 628, 629, -154, 229, -267, 455, 9, + 536, 232, -267, 203, 118, 568, 118, 456, 413, 412, + 499, 229, 229, 415, 414, 500, 232, 232, 641, 237, + 433, 10, 11, 118, 478, 118, 572, 515, 9, 237, + 165, 118, 513, 411, 492, 275, 406, 204, -183, 261, + 11, 465, 164, -178, 347, 9, 421, 166, 10, 11, + 357, 358, -267, 118, -182, 668, 466, 125, -267, -179, + 498, 131, 126, 587, 279, 118, 126, -178, 118, 118, + 216, 630, 9, 596, 94, -178, 256, 10, 11, 597, + 227, 518, 95, -179, 220, 229, 96, 221, 486, 224, + 232, -179, 235, 652, 10, 11, 97, 98, 229, 256, + 484, 483, 251, 232, 252, 487, 485, 128, 229, 627, + 256, 257, 229, 232, 9, 210, 523, 232, 287, 620, + 258, 10, 11, 333, 334, 10, 11, 264, 265, 99, + 441, 532, 229, 229, 266, 288, 598, 232, 232, 265, + 441, 165, 118, 267, 259, 266, 617, 355, 10, 11, + 290, 289, 268, 164, 635, 118, 510, 118, 166, 10, + 11, 636, 517, 10, 11, 118, 356, 211, 211, 118, + 211, 211, 360, 362, 364, 453, 525, 367, 215, 9, + 217, 219, 371, 464, 486, 9, 375, 377, 381, 118, + 118, 383, 12, 385, 588, 387, 484, 483, 9, 395, + 486, 487, 485, 229, 389, 397, 402, 32, 232, 79, + 165, 404, 484, 483, 144, 32, 408, 487, 485, 237, + 148, 416, 164, 112, 618, -177, 112, 166, 10, 11, + 129, 419, 112, 173, 10, 11, 422, 448, 435, 9, + 147, 151, 449, 451, 450, 452, 229, 10, 11, -177, + 462, 232, 473, 118, 151, 467, 470, -177, 471, 256, + 118, 472, 512, 153, 154, 155, 156, 157, 158, 118, + 167, 168, 474, 489, 319, 541, 494, 382, -181, 497, + 507, 548, 551, 523, 556, 346, 667, 486, 10, 11, + 509, 346, 346, 561, 257, 563, 229, 178, 514, 484, + 483, 232, -181, 118, 487, 485, 516, 186, 10, 11, + -181, 190, 524, 342, 237, 245, 195, 196, 197, 198, + 528, 530, 437, 112, 533, 35, 534, 532, 535, 112, + 37, 147, 537, 538, 557, 151, 559, 165, 567, 113, + 576, 560, 466, 571, 47, 48, 9, 573, 578, 164, + 580, 51, 581, 118, 166, 584, 118, 486, 586, 595, + 151, 599, 336, 600, -158, 601, -159, 153, 157, 484, + 483, 337, 602, 603, 487, 485, 338, 339, 340, 607, + 604, 61, 606, 341, 605, 608, 610, 612, 320, 619, + 342, 631, 609, 64, 79, 10, 11, 633, 634, 646, + 351, 647, 441, 654, 653, 655, 656, 343, 32, 346, + 657, 245, 663, 176, -277, 107, 346, 66, 660, 344, + 632, 583, 365, 593, 346, 345, 118, 594, 11, 373, + 407, 124, 354, 374, 508, 548, 640, 496, 245, 79, + 91, 479, 177, 178, 286, 179, 180, 181, 182, 183, + 577, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 336, 446, 566, 642, + 151, 138, 542, 639, -277, 337, 447, 562, 0, 0, + 338, 339, 340, 161, -277, 0, 170, 341, 353, 0, + 0, 0, 0, 0, 443, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 0, 37, 0, 0, 169, 0, + 79, 343, 0, 0, 113, 0, 346, 444, 0, 47, + 48, 9, 546, 346, 0, 346, 51, 0, 0, 345, + 0, 457, 11, 55, 346, 0, 346, 0, 0, 0, + 0, 0, 351, 0, 0, 0, 56, 57, 0, 58, + 59, 0, 0, 60, 0, 0, 61, 0, 0, 0, + 0, 0, 245, 0, 481, 0, 62, 63, 64, 493, + 10, 11, 245, 0, 112, 0, 0, 0, 0, 0, + 0, 0, 112, 0, 0, 0, 112, 0, 0, 147, + 0, 151, 0, 0, 0, 0, 0, 0, 294, 295, + 296, 297, 0, 298, 299, 300, 151, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 0, 161, 0, 321, 346, 324, 79, 79, 0, + 138, 138, 335, 346, 0, 351, 545, 0, 552, 0, + 346, 0, 0, 457, 0, 35, 0, 0, 0, 457, + 37, 0, 565, 351, 0, 0, 0, 0, 366, 113, + 0, 0, 79, 0, 47, 48, 9, 245, 236, 0, + 0, 51, 0, 346, 0, 0, 546, 346, 55, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 56, 57, 0, 58, 59, 0, 0, 60, 0, + 0, 61, 0, 0, 138, 0, 0, 0, 0, 0, + 0, 62, 63, 64, 138, 10, 11, 37, 0, 0, + 0, 0, 0, 0, 0, 0, 113, 346, 0, 346, + 0, 47, 48, 9, 0, 0, 0, 424, 51, 0, + 0, 161, 37, 0, 0, 225, 0, 424, 0, 0, + 0, 113, 0, 0, 0, 0, 47, 48, 9, 0, + 245, 0, 115, 51, 0, 0, 79, 0, 226, 0, + 114, 0, 0, 151, 282, 0, 0, 0, 0, 0, + 64, 0, 10, 11, 283, 0, 0, 115, 351, 0, + 545, 138, 138, 116, 552, 457, 0, 0, 0, 351, + 351, 0, 0, 0, 0, 64, 0, 10, 11, -2, 34, 0, 35, 0, 0, 36, 0, 37, 38, 39, 0, 0, 40, 0, 41, 42, 43, 44, 45, 46, - 0, 47, 48, 9, 0, 0, 49, 50, 51, 52, - 53, 54, 0, 0, 0, 55, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 56, 57, + 138, 47, 48, 9, 0, 0, 49, 50, 51, 52, + 53, 54, 0, 0, 138, 55, 0, 0, 0, 0, + 0, 0, 161, 0, 0, 0, 0, 170, 56, 57, 0, 58, 59, 0, 0, 60, 0, 0, 61, 0, - 0, -24, 0, 0, 0, 0, 170, 0, 62, 63, - 64, 0, 10, 11, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 648, 649, 0, 161, 586, 0, 0, - 0, 325, 0, 35, 0, 422, 36, -251, 37, 38, - 39, 0, -251, 40, 0, 41, 42, 113, 44, 45, - 46, 0, 47, 48, 9, 0, 0, 49, 50, 51, - 52, 53, 54, 0, 0, 0, 55, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, - 57, 0, 58, 59, 0, 0, 60, 0, 0, 61, - 0, 0, -251, 0, 0, 0, 0, 326, -251, 62, - 63, 64, 0, 10, 11, 325, 0, 35, 0, 0, - 36, 0, 37, 38, 39, 0, 0, 40, 0, 41, - 42, 113, 44, 45, 46, 0, 47, 48, 9, 0, - 0, 49, 50, 51, 52, 53, 54, 0, 0, 0, - 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 56, 57, 0, 58, 59, 0, 0, - 60, 0, 35, 61, 0, 0, -251, 37, 0, 0, - 169, 326, -251, 62, 63, 64, 113, 10, 11, 0, - 0, 47, 48, 9, 0, 0, 0, 0, 51, 0, - 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 35, 0, 0, 56, 57, - 37, 58, 59, 0, 0, 60, 0, 0, 61, 113, - 0, 0, 0, 0, 47, 48, 9, 0, 62, 63, - 64, 51, 10, 11, 0, 0, 0, 0, 159, 0, + 0, -24, 0, 0, 178, 0, 0, 0, 62, 63, + 64, 0, 10, 11, 186, 0, 0, 0, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 0, 569, 570, + 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, + 35, 0, 0, 36, -252, 37, 38, 39, 0, -252, + 40, 161, 41, 42, 113, 44, 45, 46, 0, 47, + 48, 9, 0, 0, 49, 50, 51, 52, 53, 54, + 0, 424, 0, 55, 0, 0, 0, 0, 424, 591, + 424, 0, 0, 0, 0, 0, 56, 57, 0, 58, + 59, 0, 0, 60, 0, 0, 61, 0, 0, -252, + 0, 0, 0, 0, 327, -252, 62, 63, 64, 0, + 10, 11, 0, 0, 0, 0, 326, 0, 35, 0, + 0, 36, 0, 37, 38, 39, 0, 0, 40, 0, + 41, 42, 113, 44, 45, 46, 0, 47, 48, 9, + 0, 0, 49, 50, 51, 52, 53, 54, 170, 0, + 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 56, 57, 0, 58, 59, 0, + 0, 60, 0, 0, 61, 650, 651, -252, 161, 0, + 0, 0, 327, -252, 62, 63, 64, 424, 10, 11, + 35, 0, 0, 0, 0, 37, 0, 0, 0, 0, + 0, 0, 0, 0, 113, 0, 336, 0, 0, 47, + 48, 9, 0, 0, 0, 337, 51, 0, 0, 0, + 338, 339, 340, 159, 0, 0, 0, 341, 0, 0, + 0, 0, 0, 0, 342, 0, 56, 57, 0, 58, + 160, 0, 0, 60, 0, 35, 61, 316, 0, 0, + 37, 343, 0, 0, 0, 0, 62, 63, 64, 113, + 10, 11, 0, 0, 47, 48, 9, 0, 0, 345, + 0, 51, 11, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 56, 57, 0, 58, 160, 0, 0, 60, 0, - 35, 61, 315, 0, 0, 37, 0, 0, 0, 0, + 0, 56, 57, 0, 58, 59, 0, 0, 60, 0, + 35, 61, 0, 0, 0, 37, 0, 0, 0, 423, 0, 62, 63, 64, 113, 10, 11, 0, 0, 47, - 48, 9, 0, 0, 0, 0, 51, 0, 0, 0, - 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, + 48, 9, 0, 0, 0, 0, 51, 0, 432, 0, + 0, 0, 0, 159, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 57, 0, 58, - 59, 0, 0, 60, 0, 35, 61, 0, 0, 0, - 37, 0, 0, 0, 421, 0, 62, 63, 64, 113, - 10, 11, 0, 0, 47, 48, 9, 0, 0, 0, - 0, 51, 0, 430, 0, 0, 0, 0, 159, 0, + 160, 0, 0, 60, 0, 35, 61, 0, 0, 0, + 37, 0, 0, 0, 0, 0, 62, 63, 64, 113, + 10, 11, 0, 0, 47, 48, 9, 0, 476, 0, + 0, 51, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 56, 57, 0, 58, 160, 0, 0, 60, 0, + 0, 56, 57, 0, 58, 59, 0, 0, 60, 0, 35, 61, 0, 0, 0, 37, 0, 0, 0, 0, 0, 62, 63, 64, 113, 10, 11, 0, 0, 47, - 48, 9, 0, 474, 0, 0, 51, 0, 0, 0, + 48, 9, 0, 477, 0, 0, 51, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 56, 57, 0, 58, - 59, 0, 0, 60, 0, 35, 61, 0, 0, 0, - 37, 0, 0, 0, 0, 0, 62, 63, 64, 113, - 10, 11, 0, 0, 47, 48, 9, 0, 475, 0, - 0, 51, 0, 0, 0, 0, 0, 0, 55, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, - 0, 56, 57, 37, 58, 59, 0, 0, 60, 0, - 0, 61, 113, 0, 0, 0, 0, 47, 48, 9, - 0, 62, 63, 64, 51, 10, 11, 0, 0, 0, + 0, 0, 0, 35, 0, 0, 56, 57, 37, 58, + 59, 0, 0, 60, 0, 0, 61, 113, 0, 0, + 0, 0, 47, 48, 9, 0, 62, 63, 64, 51, + 10, 11, 0, 0, 0, 0, 55, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, + 57, 0, 58, 59, 0, 0, 60, 0, 35, 61, + 0, 0, 0, 37, 0, 0, 0, 590, 0, 62, + 63, 64, 113, 10, 11, 0, 0, 47, 48, 9, + 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 56, 57, 0, 58, 59, 0, - 0, 60, 0, 35, 61, 0, 0, 0, 37, 0, - 0, 0, 588, 0, 62, 63, 64, 113, 10, 11, - 0, 0, 47, 48, 9, 0, 0, 0, 0, 51, - 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 35, 0, 0, 56, - 57, 37, 58, 59, 0, 0, 60, 0, 0, 61, - 113, 0, 0, 0, 0, 47, 48, 9, 0, 62, - 63, 64, 51, 10, 11, 0, 0, 0, 0, 159, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, - 0, 0, 56, 57, 284, 58, 160, 0, 0, 60, - 0, 0, 61, 113, 0, 0, 0, 0, 47, 48, - 9, 0, 62, 63, 64, 51, 10, 11, 0, 0, - 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 56, 57, 37, 58, 59, - 0, 0, 60, 0, 0, 61, 113, 0, 0, 0, - 0, 47, 48, 9, 0, 62, 63, 64, 51, 10, - 11, 0, 0, 37, 0, 225, 242, 0, 0, 0, - 0, 37, 113, 0, 0, 0, 0, 47, 48, 9, - 113, 0, 115, 0, 51, 47, 48, 9, 226, 0, - 0, 225, 51, 0, 0, 0, 37, 0, 0, 225, - 64, 0, 10, 11, 397, 113, 0, 0, 115, 0, - 47, 48, 9, 0, 226, 0, 115, 51, 0, 0, - 0, 0, 226, 0, 407, 0, 64, 0, 10, 11, - 37, 0, 0, 0, 64, 0, 10, 11, 0, 113, - 0, 115, 0, 0, 47, 48, 9, 408, 0, 0, - 0, 51, 0, 0, 0, 284, 0, 0, 225, 64, - 0, 10, 11, 335, 113, 0, 0, 0, 0, 47, - 48, 9, 336, 0, 0, 115, 51, 337, 338, 339, - 0, 478, 0, 225, 340, 0, 0, 0, 0, 335, - 0, 441, 461, 64, 0, 10, 11, 0, 336, 0, - 115, 0, 0, 337, 338, 339, 226, 0, 342, 0, - 340, 0, 0, 0, 442, 0, 335, 341, 64, 0, - 10, 11, 0, 0, 0, 336, 344, 0, 0, 11, - 337, 338, 542, 0, 342, 0, 0, 340, 0, 0, - 0, 0, 335, 0, 341, 0, 0, 0, 0, 0, - 335, 336, 344, 0, 0, 11, 337, 338, 339, 336, - 0, 342, 0, 340, 337, 338, 339, 0, 0, 0, - 341, 340, 0, 0, 0, 0, 0, 0, 341, 344, - 0, 10, 11, 0, 0, 0, 0, 342, 0, 0, - 0, 0, 0, 611, 0, 342, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 344, 0, 0, 11, 0, - 0, 0, 0, 344, 177, 178, 11, 179, 0, 181, + 0, 35, 0, 0, 56, 57, 37, 58, 59, 0, + 0, 60, 0, 0, 61, 113, 0, 0, 0, 0, + 47, 48, 9, 0, 62, 63, 64, 51, 10, 11, + 0, 0, 0, 0, 159, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 35, 0, 0, 56, 57, 285, + 58, 160, 0, 0, 60, 0, 0, 61, 113, 0, + 0, 0, 0, 47, 48, 9, 0, 62, 63, 64, + 51, 10, 11, 0, 0, 0, 0, 55, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 56, 57, 37, 58, 59, 0, 0, 60, 0, 0, + 61, 113, 0, 0, 0, 0, 47, 48, 9, 0, + 62, 63, 64, 51, 10, 11, 0, 37, 0, 0, + 225, 0, 0, 0, 0, 37, 113, 0, 243, 0, + 0, 47, 48, 9, 113, 0, 0, 115, 51, 47, + 48, 9, 0, 226, 0, 225, 51, 0, 0, 292, + 0, 37, 0, 225, 0, 64, 0, 10, 11, 283, + 113, 0, 115, 0, 0, 47, 48, 9, 226, 0, + 115, 0, 51, 0, 0, 0, 226, 0, 37, 225, + 64, 0, 10, 11, 399, 0, 0, 113, 64, 0, + 10, 11, 47, 48, 9, 0, 115, 0, 0, 51, + 0, 0, 226, 0, 37, 0, 409, 0, 0, 0, + 0, 0, 285, 113, 64, 0, 10, 11, 47, 48, + 9, 113, 0, 115, 0, 51, 47, 48, 9, 410, + 0, 0, 225, 51, 0, 0, 0, 336, 0, 0, + 225, 64, 0, 10, 11, 336, 337, 0, 463, 115, + 0, 338, 339, 544, 337, 480, 0, 115, 341, 338, + 339, 340, 0, 226, 0, 342, 341, 64, 0, 10, + 11, 336, 0, 342, 0, 64, 0, 10, 11, 0, + 337, 0, 343, 0, 0, 338, 339, 340, 0, 0, + 343, 0, 341, 0, 0, 0, 0, 0, 0, 342, + 345, 0, 10, 11, 0, 0, 0, 0, 345, 178, + 0, 11, 0, 181, 182, 183, 343, 0, 185, 186, + 187, 188, 613, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 0, 0, 345, 177, 178, 11, 179, 0, + 181, 182, 183, 0, 0, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 177, 178, + 0, 179, 0, 181, 182, 183, 0, 437, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 0, 0, 0, 0, 0, 0, 177, 178, + 0, 179, 0, 181, 182, 183, 0, 434, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 177, 178, 0, 179, 0, 181, 182, 183, + 0, 527, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 177, 178, 0, 179, + 0, 181, 182, 183, 0, 661, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 177, 178, 0, 179, 0, 181, 182, 183, 0, 662, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 177, 178, 0, 0, 0, 181, 182, 183, 0, 0, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 177, 178, 0, - 179, 0, 181, 182, 183, 0, 435, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 0, 0, 0, 0, 0, 0, 177, 178, 0, - 179, 0, 181, 182, 183, 0, 432, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 177, 178, 0, 179, 0, 181, 182, 183, 0, - 525, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 177, 178, 0, 179, 0, - 181, 182, 183, 0, 659, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 177, - 178, 0, 179, 0, 181, 182, 183, 0, 660, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 177, 178, 0, 0, 0, 181, 182, - 183, 0, 0, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 177, 178, 0, - 0, 0, 181, 182, 183, 0, 0, 185, 186, 187, - 188, 0, 190, 191, 192, 193, 194, 195, 196, 197, - 198 + 191, 192, 193, 194, 195, 196, 197, 198, 177, 178, + 0, 0, 0, 181, 182, 183, 0, 0, 185, 186, + 187, 188, 0, 190, 191, 192, 193, 194, 195, 196, + 197, 198 }; static const yytype_int16 yycheck[] = { - 37, 37, 61, 143, 67, 37, 37, 202, 324, 251, - 378, 205, 61, 28, 487, 127, 127, 136, 259, 224, - 144, 133, 322, 148, 61, 454, 446, 268, 31, 61, - 3, 143, 317, 264, 265, 276, 212, 5, 323, 280, - 67, 36, 218, 219, 39, 250, 24, 59, 0, 290, - 45, 1, 5, 25, 3, 1, 20, 37, 35, 3, - 25, 24, 74, 11, 3, 55, 56, 57, 58, 59, - 60, 7, 62, 63, 62, 24, 12, 114, 115, 116, - 24, 62, 114, 115, 116, 35, 62, 68, 7, 35, - 67, 128, 68, 12, 5, 73, 128, 65, 66, 72, - 137, 574, 3, 67, 107, 137, 21, 75, 145, 59, - 173, 160, 65, 145, 63, 152, 60, 67, 51, 63, - 152, 67, 75, 160, 73, 74, 62, 75, 160, 73, - 74, 24, 68, 63, 114, 115, 116, 256, 175, 439, - 425, 136, 427, 175, 62, 390, 173, 142, 128, 68, - 83, 200, 3, 398, 65, 49, 89, 137, 389, 3, - 391, 62, 63, 200, 75, 145, 342, 68, 200, 159, - 160, 644, 152, 24, 350, 24, 24, 606, 383, 599, - 24, 7, 66, 598, 62, 60, 12, 224, 72, 226, - 610, 611, 224, 7, 226, 175, 438, 24, 12, 50, - 75, 517, 3, 62, 53, 242, 221, 244, 524, 68, - 242, 59, 244, 250, 3, 59, 71, 462, 250, 63, - 414, 62, 73, 74, 67, 73, 74, 421, 3, 73, - 74, 473, 59, 127, 66, 272, 62, 652, 433, 654, - 272, 66, 68, 59, 224, 24, 226, 284, 284, 24, - 287, 288, 284, 284, 68, 287, 288, 369, 369, 318, - 505, 24, 242, 59, 244, 441, 385, 379, 379, 318, - 250, 447, 448, 478, 450, 50, 400, 402, 59, 520, - 59, 318, 24, 459, 59, 461, 318, 40, 35, 68, - 53, 44, 272, 24, 73, 74, 59, 665, 73, 74, - 62, 74, 62, 64, 284, 68, 68, 287, 288, 59, - 73, 74, 59, 24, 208, 209, 561, 633, 24, 40, - 67, 59, 63, 44, 361, 35, 375, 67, 24, 361, - 75, 73, 74, 578, 579, 577, 373, 9, 375, 375, - 60, 373, 53, 375, 375, 17, 383, 72, 59, 21, - 387, 383, 59, 59, 417, 387, 35, 72, 603, 31, - 32, 59, 73, 74, 60, 63, 571, 73, 74, 428, - 407, 408, 3, 71, 550, 407, 408, 73, 74, 428, - 59, 361, 558, 24, 35, 35, 60, 281, 67, 35, - 385, 428, 64, 373, 588, 375, 428, 291, 393, 594, - 8, 60, 397, 383, 62, 35, 35, 387, 59, 59, - 75, 94, 95, 59, 97, 98, 67, 67, 59, 62, - 60, 67, 471, 24, 59, 601, 602, 407, 408, 59, - 5, 65, 73, 74, 471, 471, 24, 67, 487, 471, - 471, 478, 62, 62, 24, 20, 478, 22, 497, 72, - 487, 487, 24, 28, 24, 487, 487, 569, 569, 3, - 497, 36, 3, 62, 39, 497, 62, 8, 43, 62, - 45, 59, 67, 367, 368, 65, 17, 66, 53, 54, - 60, 22, 23, 24, 521, 73, 74, 59, 29, 521, - 60, 471, 67, 73, 74, 34, 24, 95, 478, 97, - 98, 73, 74, 73, 74, 44, 59, 487, 67, 48, - 71, 67, 406, 8, 53, 54, 55, 56, 59, 65, - 62, 584, 62, 60, 664, 574, 420, 62, 62, 212, - 71, 59, 73, 74, 571, 218, 219, 574, 574, 571, - 60, 521, 574, 574, 60, 73, 74, 60, 63, 68, - 60, 68, 664, 128, 35, 60, 60, 60, 60, 68, - 60, 136, 60, 75, 75, 624, 60, 142, 3, 144, - 36, 68, 62, 148, 60, 624, 72, 62, 60, 59, - 59, 49, 75, 66, 60, 60, 60, 624, 8, 62, - 60, 571, 624, 61, 574, 644, 64, 17, 173, 60, - 60, 59, 22, 23, 24, 59, 68, 644, 644, 29, - 62, 49, 644, 644, 62, 72, 36, 68, 62, 59, - 8, 60, 68, 60, 60, 68, 201, 14, 62, 17, - 72, 60, 207, 53, 22, 23, 24, 60, 213, 59, - 68, 29, 60, 60, 22, 65, 221, 31, 36, 224, - 584, 71, 335, 73, 74, 75, 645, 510, 526, 342, - 235, 526, 244, 39, 644, 53, 282, 350, 244, 160, - 393, 59, 385, 373, 22, 250, 251, 65, 214, 497, - 335, 335, 464, 71, 34, 73, 74, 75, 38, 39, - 40, 442, 605, 43, 44, 45, 46, 601, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 282, 176, 177, - 178, 179, 460, 181, 182, 183, -1, 185, 186, 187, + 37, 37, 61, 143, 67, 37, 37, 202, 380, 205, + 224, 148, 61, 448, 144, 127, 28, 489, 456, 67, + 127, 133, 252, 325, 61, 114, 115, 116, 136, 61, + 31, 143, 323, 36, 3, 51, 39, 251, 11, 5, + 24, 260, 45, 49, 35, 392, 7, 25, 137, 35, + 269, 12, 5, 400, 265, 266, 145, 37, 277, 3, + 1, 35, 281, 152, 318, 0, 24, 83, 59, 62, + 324, 3, 291, 89, 25, 68, 67, 114, 115, 116, + 24, 67, 114, 115, 116, 59, 175, 3, 24, 73, + 1, 128, 24, 67, 35, 53, 128, 20, 3, 65, + 137, 62, 75, 72, 576, 137, 107, 68, 145, 75, + 173, 160, 65, 145, 62, 152, 60, 464, 59, 63, + 152, 127, 75, 160, 35, 173, 67, 59, 160, 73, + 74, 63, 600, 136, 114, 115, 116, 226, 175, 142, + 7, 73, 74, 175, 67, 12, 62, 63, 128, 257, + 441, 200, 68, 62, 243, 3, 67, 137, 3, 68, + 507, 5, 24, 200, 21, 145, 601, 63, 200, 24, + 608, 385, 152, 427, 646, 429, 24, 612, 613, 24, + 391, 59, 393, 59, 273, 63, 654, 224, 656, 226, + 62, 3, 224, 71, 226, 175, 285, 59, 74, 288, + 289, 68, 208, 209, 62, 50, 243, 3, 245, 221, + 440, 243, 24, 245, 251, 63, 563, 519, 71, 251, + 416, 65, 66, 3, 526, 73, 74, 423, 73, 74, + 62, 75, 67, 580, 581, 66, 273, 7, 50, 24, + 435, 273, 12, 66, 224, 475, 226, 59, 285, 285, + 7, 288, 289, 285, 285, 12, 288, 289, 605, 371, + 319, 73, 74, 243, 371, 245, 480, 404, 24, 381, + 319, 251, 402, 362, 381, 60, 282, 59, 59, 387, + 74, 60, 319, 35, 212, 24, 292, 319, 73, 74, + 218, 219, 62, 273, 59, 667, 75, 40, 68, 35, + 389, 44, 40, 522, 60, 285, 44, 59, 288, 289, + 24, 68, 24, 66, 9, 67, 24, 73, 74, 72, + 409, 410, 17, 59, 64, 362, 21, 62, 377, 59, + 362, 67, 63, 635, 73, 74, 31, 32, 375, 24, + 377, 377, 59, 375, 67, 377, 377, 59, 385, 579, + 24, 59, 389, 385, 24, 75, 419, 389, 60, 573, + 68, 73, 74, 369, 370, 73, 74, 35, 53, 64, + 62, 430, 409, 410, 59, 72, 68, 409, 410, 53, + 62, 430, 362, 68, 387, 59, 68, 59, 73, 74, + 60, 72, 395, 430, 590, 375, 399, 377, 430, 73, + 74, 596, 408, 73, 74, 385, 3, 94, 95, 389, + 97, 98, 60, 8, 60, 343, 422, 35, 95, 24, + 97, 98, 62, 351, 473, 24, 75, 60, 62, 409, + 410, 24, 5, 59, 523, 62, 473, 473, 24, 62, + 489, 473, 473, 480, 72, 3, 62, 20, 480, 22, + 499, 62, 489, 489, 59, 28, 65, 489, 489, 571, + 59, 67, 499, 36, 571, 35, 39, 499, 73, 74, + 43, 62, 45, 59, 73, 74, 65, 59, 66, 24, + 53, 54, 67, 67, 71, 8, 523, 73, 74, 59, + 65, 523, 60, 473, 67, 62, 62, 67, 62, 24, + 480, 62, 35, 55, 56, 57, 58, 59, 60, 489, + 62, 63, 60, 60, 59, 443, 60, 63, 35, 68, + 60, 449, 450, 586, 452, 212, 666, 576, 73, 74, + 68, 218, 219, 461, 59, 463, 573, 34, 60, 576, + 576, 573, 59, 523, 576, 576, 60, 44, 73, 74, + 67, 48, 60, 36, 666, 128, 53, 54, 55, 56, + 75, 68, 75, 136, 60, 3, 60, 626, 60, 142, + 8, 144, 60, 68, 3, 148, 62, 626, 60, 17, + 60, 72, 75, 62, 22, 23, 24, 59, 66, 626, + 60, 29, 60, 573, 626, 60, 576, 646, 62, 60, + 173, 60, 8, 60, 59, 59, 59, 159, 160, 646, + 646, 17, 68, 62, 646, 646, 22, 23, 24, 62, + 72, 59, 68, 29, 552, 49, 62, 59, 201, 60, + 36, 68, 560, 71, 207, 73, 74, 60, 68, 60, + 213, 14, 62, 60, 72, 60, 60, 53, 221, 336, + 60, 224, 68, 4, 5, 31, 343, 22, 647, 65, + 586, 512, 235, 528, 351, 71, 646, 528, 74, 245, + 283, 39, 214, 245, 395, 603, 604, 387, 251, 252, + 22, 375, 33, 34, 160, 36, 37, 38, 39, 40, + 499, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 8, 336, 466, 607, + 283, 49, 444, 603, 65, 17, 336, 462, -1, -1, + 22, 23, 24, 61, 75, -1, 64, 29, 213, -1, + -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, + 3, -1, -1, -1, -1, 8, -1, -1, 11, -1, + 323, 53, -1, -1, 17, -1, 443, 59, -1, 22, + 23, 24, 449, 450, -1, 452, 29, -1, -1, 71, + -1, 344, 74, 36, 461, -1, 463, -1, -1, -1, + -1, -1, 355, -1, -1, -1, 49, 50, -1, 52, + 53, -1, -1, 56, -1, -1, 59, -1, -1, -1, + -1, -1, 375, -1, 377, -1, 69, 70, 71, 382, + 73, 74, 385, -1, 387, -1, -1, -1, -1, -1, + -1, -1, 395, -1, -1, -1, 399, -1, -1, 402, + -1, 404, -1, -1, -1, -1, -1, -1, 176, 177, + 178, 179, -1, 181, 182, 183, 419, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, -1, 200, -1, 202, 213, 204, -1, -1, -1, - 208, 209, 210, -1, -1, -1, -1, 322, -1, -1, - 114, 115, 116, -1, -1, -1, -1, -1, 441, -1, - -1, -1, -1, -1, 447, 448, -1, 450, 343, -1, - -1, 8, -1, 137, -1, 8, 459, -1, 461, 354, - 17, 145, -1, -1, 17, 22, 23, 24, 152, 22, - 23, 24, 29, -1, -1, -1, 29, -1, 373, 36, - 375, -1, -1, 36, -1, 380, -1, -1, 383, -1, - 385, 175, -1, 281, -1, -1, 53, -1, 393, -1, - 53, -1, 397, 291, -1, 400, 59, 402, 65, -1, - -1, -1, -1, -1, 71, -1, -1, 74, 71, -1, - 73, 74, 417, -1, -1, -1, 314, -1, -1, -1, - 318, -1, -1, -1, -1, -1, 324, -1, -1, -1, - -1, -1, 226, 438, 439, -1, -1, 550, -1, -1, - -1, 446, 447, -1, 449, 558, -1, -1, 242, 454, - -1, -1, 565, -1, -1, 460, -1, -1, 463, 464, - -1, -1, -1, -1, -1, -1, -1, -1, 473, 367, - 368, -1, -1, 478, -1, -1, -1, -1, 272, -1, - -1, 34, -1, -1, -1, 598, -1, -1, 601, 602, - 284, 44, -1, 287, 288, 48, 49, 50, 51, 52, - 53, 54, 55, 56, -1, -1, -1, -1, 406, -1, - -1, -1, -1, 4, 5, -1, -1, -1, -1, -1, - -1, -1, 420, -1, -1, -1, -1, -1, -1, -1, - 428, -1, -1, -1, -1, 433, -1, -1, -1, 652, - -1, 654, 33, 34, -1, 36, 37, 38, 39, 40, - -1, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 571, 361, -1, -1, - -1, -1, 577, -1, 65, -1, 474, 475, -1, 584, - -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, - -1, -1, -1, 387, 599, -1, 601, -1, -1, 497, - 605, 606, -1, -1, -1, 610, 611, -1, -1, -1, - -1, -1, -1, 407, 408, -1, -1, -1, -1, 517, - -1, -1, -1, -1, -1, -1, 524, 525, 526, 0, + 198, -1, 200, -1, 202, 552, 204, 440, 441, -1, + 208, 209, 210, 560, -1, 448, 449, -1, 451, -1, + 567, -1, -1, 456, -1, 3, -1, -1, -1, 462, + 8, -1, 465, 466, -1, -1, -1, -1, 236, 17, + -1, -1, 475, -1, 22, 23, 24, 480, 26, -1, + -1, 29, -1, 600, -1, -1, 603, 604, 36, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 49, 50, -1, 52, 53, -1, -1, 56, -1, + -1, 59, -1, -1, 282, -1, -1, -1, -1, -1, + -1, 69, 70, 71, 292, 73, 74, 8, -1, -1, + -1, -1, -1, -1, -1, -1, 17, 654, -1, 656, + -1, 22, 23, 24, -1, -1, -1, 315, 29, -1, + -1, 319, 8, -1, -1, 36, -1, 325, -1, -1, + -1, 17, -1, -1, -1, -1, 22, 23, 24, -1, + 573, -1, 53, 29, -1, -1, 579, -1, 59, -1, + 36, -1, -1, 586, 65, -1, -1, -1, -1, -1, + 71, -1, 73, 74, 75, -1, -1, 53, 601, -1, + 603, 369, 370, 59, 607, 608, -1, -1, -1, 612, + 613, -1, -1, -1, -1, 71, -1, 73, 74, 0, 1, -1, 3, -1, -1, 6, -1, 8, 9, 10, -1, -1, 13, -1, 15, 16, 17, 18, 19, 20, - -1, 22, 23, 24, -1, -1, 27, 28, 29, 30, - 31, 32, -1, -1, -1, 36, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, + 408, 22, 23, 24, -1, -1, 27, 28, 29, 30, + 31, 32, -1, -1, 422, 36, -1, -1, -1, -1, + -1, -1, 430, -1, -1, -1, -1, 435, 49, 50, -1, 52, 53, -1, -1, 56, -1, -1, 59, -1, - -1, 62, -1, -1, -1, -1, 594, -1, 69, 70, - 71, -1, 73, 74, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 621, 622, -1, 624, 521, -1, -1, - -1, 1, -1, 3, -1, 633, 6, 7, 8, 9, - 10, -1, 12, 13, -1, 15, 16, 17, 18, 19, - 20, -1, 22, 23, 24, -1, -1, 27, 28, 29, - 30, 31, 32, -1, -1, -1, 36, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, - 50, -1, 52, 53, -1, -1, 56, -1, -1, 59, - -1, -1, 62, -1, -1, -1, -1, 67, 68, 69, - 70, 71, -1, 73, 74, 1, -1, 3, -1, -1, - 6, -1, 8, 9, 10, -1, -1, 13, -1, 15, - 16, 17, 18, 19, 20, -1, 22, 23, 24, -1, - -1, 27, 28, 29, 30, 31, 32, -1, -1, -1, - 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 49, 50, -1, 52, 53, -1, -1, - 56, -1, 3, 59, -1, -1, 62, 8, -1, -1, - 11, 67, 68, 69, 70, 71, 17, 73, 74, -1, - -1, 22, 23, 24, -1, -1, -1, -1, 29, -1, - -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 3, -1, -1, 49, 50, - 8, 52, 53, -1, -1, 56, -1, -1, 59, 17, - -1, -1, -1, -1, 22, 23, 24, -1, 69, 70, - 71, 29, 73, 74, -1, -1, -1, -1, 36, -1, + -1, 62, -1, -1, 34, -1, -1, -1, 69, 70, + 71, -1, 73, 74, 44, -1, -1, -1, 48, 49, + 50, 51, 52, 53, 54, 55, 56, -1, 476, 477, + -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, + 3, -1, -1, 6, 7, 8, 9, 10, -1, 12, + 13, 499, 15, 16, 17, 18, 19, 20, -1, 22, + 23, 24, -1, -1, 27, 28, 29, 30, 31, 32, + -1, 519, -1, 36, -1, -1, -1, -1, 526, 527, + 528, -1, -1, -1, -1, -1, 49, 50, -1, 52, + 53, -1, -1, 56, -1, -1, 59, -1, -1, 62, + -1, -1, -1, -1, 67, 68, 69, 70, 71, -1, + 73, 74, -1, -1, -1, -1, 1, -1, 3, -1, + -1, 6, -1, 8, 9, 10, -1, -1, 13, -1, + 15, 16, 17, 18, 19, 20, -1, 22, 23, 24, + -1, -1, 27, 28, 29, 30, 31, 32, 596, -1, + -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 49, 50, -1, 52, 53, -1, + -1, 56, -1, -1, 59, 623, 624, 62, 626, -1, + -1, -1, 67, 68, 69, 70, 71, 635, 73, 74, + 3, -1, -1, -1, -1, 8, -1, -1, -1, -1, + -1, -1, -1, -1, 17, -1, 8, -1, -1, 22, + 23, 24, -1, -1, -1, 17, 29, -1, -1, -1, + 22, 23, 24, 36, -1, -1, -1, 29, -1, -1, + -1, -1, -1, -1, 36, -1, 49, 50, -1, 52, + 53, -1, -1, 56, -1, 3, 59, 60, -1, -1, + 8, 53, -1, -1, -1, -1, 69, 70, 71, 17, + 73, 74, -1, -1, 22, 23, 24, -1, -1, 71, + -1, 29, 74, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, -1, 52, 53, -1, -1, 56, -1, - 3, 59, 60, -1, -1, 8, -1, -1, -1, -1, + 3, 59, -1, -1, -1, 8, -1, -1, -1, 67, -1, 69, 70, 71, 17, 73, 74, -1, -1, 22, - 23, 24, -1, -1, -1, -1, 29, -1, -1, -1, + 23, 24, -1, -1, -1, -1, 29, -1, 31, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, -1, 52, 53, -1, -1, 56, -1, 3, 59, -1, -1, -1, - 8, -1, -1, -1, 67, -1, 69, 70, 71, 17, - 73, 74, -1, -1, 22, 23, 24, -1, -1, -1, - -1, 29, -1, 31, -1, -1, -1, -1, 36, -1, + 8, -1, -1, -1, -1, -1, 69, 70, 71, 17, + 73, 74, -1, -1, 22, 23, 24, -1, 26, -1, + -1, 29, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, -1, 52, 53, -1, -1, 56, -1, 3, 59, -1, -1, -1, 8, -1, -1, -1, -1, -1, 69, 70, 71, 17, 73, 74, -1, -1, 22, 23, 24, -1, 26, -1, -1, 29, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 49, 50, -1, 52, - 53, -1, -1, 56, -1, 3, 59, -1, -1, -1, - 8, -1, -1, -1, -1, -1, 69, 70, 71, 17, - 73, 74, -1, -1, 22, 23, 24, -1, 26, -1, - -1, 29, -1, -1, -1, -1, -1, -1, 36, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 3, -1, - -1, 49, 50, 8, 52, 53, -1, -1, 56, -1, - -1, 59, 17, -1, -1, -1, -1, 22, 23, 24, - -1, 69, 70, 71, 29, 73, 74, -1, -1, -1, + -1, -1, -1, 3, -1, -1, 49, 50, 8, 52, + 53, -1, -1, 56, -1, -1, 59, 17, -1, -1, + -1, -1, 22, 23, 24, -1, 69, 70, 71, 29, + 73, 74, -1, -1, -1, -1, 36, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, + 50, -1, 52, 53, -1, -1, 56, -1, 3, 59, + -1, -1, -1, 8, -1, -1, -1, 67, -1, 69, + 70, 71, 17, 73, 74, -1, -1, 22, 23, 24, + -1, -1, -1, -1, 29, -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 49, 50, -1, 52, 53, -1, - -1, 56, -1, 3, 59, -1, -1, -1, 8, -1, - -1, -1, 67, -1, 69, 70, 71, 17, 73, 74, - -1, -1, 22, 23, 24, -1, -1, -1, -1, 29, - -1, -1, -1, -1, -1, -1, 36, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 3, -1, -1, 49, - 50, 8, 52, 53, -1, -1, 56, -1, -1, 59, - 17, -1, -1, -1, -1, 22, 23, 24, -1, 69, - 70, 71, 29, 73, 74, -1, -1, -1, -1, 36, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, - -1, -1, 49, 50, 8, 52, 53, -1, -1, 56, - -1, -1, 59, 17, -1, -1, -1, -1, 22, 23, - 24, -1, 69, 70, 71, 29, 73, 74, -1, -1, - -1, -1, 36, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 49, 50, 8, 52, 53, - -1, -1, 56, -1, -1, 59, 17, -1, -1, -1, - -1, 22, 23, 24, -1, 69, 70, 71, 29, 73, - 74, -1, -1, 8, -1, 36, 11, -1, -1, -1, - -1, 8, 17, -1, -1, -1, -1, 22, 23, 24, - 17, -1, 53, -1, 29, 22, 23, 24, 59, -1, - -1, 36, 29, -1, -1, -1, 8, -1, -1, 36, - 71, -1, 73, 74, 75, 17, -1, -1, 53, -1, - 22, 23, 24, -1, 59, -1, 53, 29, -1, -1, - -1, -1, 59, -1, 36, -1, 71, -1, 73, 74, - 8, -1, -1, -1, 71, -1, 73, 74, -1, 17, - -1, 53, -1, -1, 22, 23, 24, 59, -1, -1, - -1, 29, -1, -1, -1, 8, -1, -1, 36, 71, - -1, 73, 74, 8, 17, -1, -1, -1, -1, 22, - 23, 24, 17, -1, -1, 53, 29, 22, 23, 24, - -1, 59, -1, 36, 29, -1, -1, -1, -1, 8, - -1, 36, 11, 71, -1, 73, 74, -1, 17, -1, - 53, -1, -1, 22, 23, 24, 59, -1, 53, -1, - 29, -1, -1, -1, 59, -1, 8, 36, 71, -1, - 73, 74, -1, -1, -1, 17, 71, -1, -1, 74, - 22, 23, 24, -1, 53, -1, -1, 29, -1, -1, - -1, -1, 8, -1, 36, -1, -1, -1, -1, -1, - 8, 17, 71, -1, -1, 74, 22, 23, 24, 17, - -1, 53, -1, 29, 22, 23, 24, -1, -1, -1, - 36, 29, -1, -1, -1, -1, -1, -1, 36, 71, - -1, 73, 74, -1, -1, -1, -1, 53, -1, -1, - -1, -1, -1, 59, -1, 53, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 71, -1, -1, 74, -1, - -1, -1, -1, 71, 33, 34, 74, 36, -1, 38, + -1, 3, -1, -1, 49, 50, 8, 52, 53, -1, + -1, 56, -1, -1, 59, 17, -1, -1, -1, -1, + 22, 23, 24, -1, 69, 70, 71, 29, 73, 74, + -1, -1, -1, -1, 36, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 3, -1, -1, 49, 50, 8, + 52, 53, -1, -1, 56, -1, -1, 59, 17, -1, + -1, -1, -1, 22, 23, 24, -1, 69, 70, 71, + 29, 73, 74, -1, -1, -1, -1, 36, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 49, 50, 8, 52, 53, -1, -1, 56, -1, -1, + 59, 17, -1, -1, -1, -1, 22, 23, 24, -1, + 69, 70, 71, 29, 73, 74, -1, 8, -1, -1, + 36, -1, -1, -1, -1, 8, 17, -1, 11, -1, + -1, 22, 23, 24, 17, -1, -1, 53, 29, 22, + 23, 24, -1, 59, -1, 36, 29, -1, -1, 65, + -1, 8, -1, 36, -1, 71, -1, 73, 74, 75, + 17, -1, 53, -1, -1, 22, 23, 24, 59, -1, + 53, -1, 29, -1, -1, -1, 59, -1, 8, 36, + 71, -1, 73, 74, 75, -1, -1, 17, 71, -1, + 73, 74, 22, 23, 24, -1, 53, -1, -1, 29, + -1, -1, 59, -1, 8, -1, 36, -1, -1, -1, + -1, -1, 8, 17, 71, -1, 73, 74, 22, 23, + 24, 17, -1, 53, -1, 29, 22, 23, 24, 59, + -1, -1, 36, 29, -1, -1, -1, 8, -1, -1, + 36, 71, -1, 73, 74, 8, 17, -1, 11, 53, + -1, 22, 23, 24, 17, 59, -1, 53, 29, 22, + 23, 24, -1, 59, -1, 36, 29, 71, -1, 73, + 74, 8, -1, 36, -1, 71, -1, 73, 74, -1, + 17, -1, 53, -1, -1, 22, 23, 24, -1, -1, + 53, -1, 29, -1, -1, -1, -1, -1, -1, 36, + 71, -1, 73, 74, -1, -1, -1, -1, 71, 34, + -1, 74, -1, 38, 39, 40, 53, -1, 43, 44, + 45, 46, 59, 48, 49, 50, 51, 52, 53, 54, + 55, 56, -1, -1, 71, 33, 34, 74, 36, -1, + 38, 39, 40, -1, -1, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 33, 34, + -1, 36, -1, 38, 39, 40, -1, 75, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, -1, -1, -1, -1, -1, -1, 33, 34, + -1, 36, -1, 38, 39, 40, -1, 72, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 33, 34, -1, 36, -1, 38, 39, 40, + -1, 66, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 33, 34, -1, 36, + -1, 38, 39, 40, -1, 66, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 33, 34, -1, 36, -1, 38, 39, 40, -1, 66, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 33, 34, -1, -1, -1, 38, 39, 40, -1, -1, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, - 36, -1, 38, 39, 40, -1, 75, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, -1, -1, -1, -1, -1, -1, 33, 34, -1, - 36, -1, 38, 39, 40, -1, 72, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 33, 34, -1, 36, -1, 38, 39, 40, -1, - 66, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 33, 34, -1, 36, -1, - 38, 39, 40, -1, 66, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 33, - 34, -1, 36, -1, 38, 39, 40, -1, 66, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 33, 34, -1, -1, -1, 38, 39, - 40, -1, -1, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 33, 34, -1, - -1, -1, 38, 39, 40, -1, -1, 43, 44, 45, - 46, -1, 48, 49, 50, 51, 52, 53, 54, 55, - 56 + 49, 50, 51, 52, 53, 54, 55, 56, 33, 34, + -1, -1, -1, 38, 39, 40, -1, -1, 43, 44, + 45, 46, -1, 48, 49, 50, 51, 52, 53, 54, + 55, 56 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1528,50 +1514,50 @@ static const yytype_uint8 yystos[] = 59, 63, 71, 66, 59, 137, 1, 137, 5, 65, 75, 142, 200, 59, 160, 200, 24, 200, 201, 200, 64, 62, 190, 88, 59, 36, 59, 146, 152, 153, - 154, 155, 161, 146, 146, 63, 98, 107, 108, 109, - 186, 194, 11, 136, 141, 145, 146, 177, 178, 179, - 59, 67, 162, 112, 194, 24, 59, 68, 138, 171, - 173, 175, 146, 35, 53, 59, 68, 138, 170, 172, - 173, 174, 184, 112, 60, 97, 169, 146, 60, 93, - 167, 65, 75, 146, 8, 147, 60, 72, 72, 60, - 94, 65, 146, 126, 126, 126, 126, 126, 126, 126, + 154, 155, 161, 146, 146, 63, 26, 98, 107, 108, + 109, 186, 194, 11, 136, 141, 145, 146, 177, 178, + 179, 59, 67, 162, 112, 194, 24, 59, 68, 138, + 171, 173, 175, 146, 35, 53, 59, 68, 138, 170, + 172, 173, 174, 184, 112, 60, 97, 169, 146, 60, + 93, 167, 65, 75, 146, 8, 147, 60, 72, 72, + 60, 94, 65, 146, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 130, 60, 135, 187, 59, 141, - 126, 192, 182, 126, 130, 1, 67, 91, 100, 180, - 181, 183, 186, 186, 126, 8, 17, 22, 23, 24, - 29, 36, 53, 65, 71, 142, 202, 204, 205, 206, - 141, 207, 215, 162, 59, 3, 202, 202, 83, 60, - 179, 8, 146, 60, 141, 35, 105, 5, 65, 62, - 146, 136, 145, 75, 191, 60, 179, 183, 115, 62, - 63, 24, 173, 59, 176, 62, 190, 72, 104, 59, - 174, 53, 174, 62, 190, 3, 198, 75, 146, 123, - 62, 190, 62, 190, 186, 139, 65, 36, 59, 146, - 152, 153, 154, 161, 67, 146, 146, 62, 190, 186, - 65, 67, 126, 131, 132, 188, 189, 11, 75, 191, - 31, 135, 72, 66, 180, 75, 191, 189, 101, 62, - 68, 36, 59, 203, 204, 206, 59, 67, 71, 67, - 8, 202, 3, 50, 59, 141, 212, 213, 3, 72, - 65, 11, 202, 60, 75, 62, 195, 215, 62, 62, - 62, 60, 60, 106, 26, 26, 194, 177, 59, 141, - 151, 152, 153, 154, 155, 161, 163, 60, 68, 105, - 194, 141, 60, 179, 175, 68, 146, 7, 12, 68, - 99, 102, 174, 198, 174, 60, 172, 68, 138, 198, - 35, 97, 60, 93, 60, 186, 146, 130, 94, 95, - 168, 185, 60, 186, 130, 66, 75, 191, 68, 191, - 135, 60, 60, 60, 192, 60, 68, 183, 180, 202, - 205, 195, 24, 141, 142, 197, 202, 209, 217, 202, - 141, 196, 208, 216, 202, 3, 212, 62, 72, 202, - 213, 202, 198, 141, 207, 60, 183, 126, 126, 62, - 179, 59, 163, 116, 60, 187, 66, 103, 60, 60, - 198, 104, 60, 189, 62, 190, 146, 189, 67, 126, - 133, 131, 132, 60, 66, 72, 68, 60, 60, 59, - 68, 62, 72, 202, 68, 62, 49, 202, 62, 198, - 59, 59, 202, 210, 211, 68, 194, 60, 179, 119, - 163, 5, 65, 66, 75, 183, 198, 198, 68, 68, - 95, 60, 68, 130, 192, 210, 195, 209, 202, 198, - 208, 212, 195, 195, 60, 14, 117, 120, 126, 126, - 189, 72, 60, 60, 60, 60, 163, 20, 100, 66, - 66, 68, 210, 210, 118, 112, 105 + 126, 126, 126, 126, 126, 130, 60, 135, 187, 59, + 141, 126, 192, 182, 126, 130, 1, 67, 91, 100, + 180, 181, 183, 186, 186, 126, 8, 17, 22, 23, + 24, 29, 36, 53, 65, 71, 142, 202, 204, 205, + 206, 141, 207, 215, 162, 59, 3, 202, 202, 83, + 60, 179, 8, 146, 60, 141, 126, 35, 105, 5, + 65, 62, 146, 136, 145, 75, 191, 60, 179, 183, + 115, 62, 63, 24, 173, 59, 176, 62, 190, 72, + 104, 59, 174, 53, 174, 62, 190, 3, 198, 75, + 146, 123, 62, 190, 62, 190, 186, 139, 65, 36, + 59, 146, 152, 153, 154, 161, 67, 146, 146, 62, + 190, 186, 65, 67, 126, 131, 132, 188, 189, 11, + 75, 191, 31, 135, 72, 66, 180, 75, 191, 189, + 101, 62, 68, 36, 59, 203, 204, 206, 59, 67, + 71, 67, 8, 202, 3, 50, 59, 141, 212, 213, + 3, 72, 65, 11, 202, 60, 75, 62, 195, 215, + 62, 62, 62, 60, 60, 106, 26, 26, 194, 177, + 59, 141, 151, 152, 153, 154, 155, 161, 163, 60, + 68, 105, 194, 141, 60, 179, 175, 68, 146, 7, + 12, 68, 99, 102, 174, 198, 174, 60, 172, 68, + 138, 198, 35, 97, 60, 93, 60, 186, 146, 130, + 94, 95, 168, 185, 60, 186, 130, 66, 75, 191, + 68, 191, 135, 60, 60, 60, 192, 60, 68, 183, + 180, 202, 205, 195, 24, 141, 142, 197, 202, 209, + 217, 202, 141, 196, 208, 216, 202, 3, 212, 62, + 72, 202, 213, 202, 198, 141, 207, 60, 183, 126, + 126, 62, 179, 59, 163, 116, 60, 187, 66, 103, + 60, 60, 198, 104, 60, 189, 62, 190, 146, 189, + 67, 126, 133, 131, 132, 60, 66, 72, 68, 60, + 60, 59, 68, 62, 72, 202, 68, 62, 49, 202, + 62, 198, 59, 59, 202, 210, 211, 68, 194, 60, + 179, 119, 163, 5, 65, 66, 75, 183, 198, 198, + 68, 68, 95, 60, 68, 130, 192, 210, 195, 209, + 202, 198, 208, 212, 195, 195, 60, 14, 117, 120, + 126, 126, 189, 72, 60, 60, 60, 60, 163, 20, + 100, 66, 66, 68, 210, 210, 118, 112, 105 }; #define yyerrok (yyerrstatus = 0) @@ -2795,20 +2781,22 @@ yyreduce: #line 461 "go.y" { (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); + (yyval.node)->implicit = 1; (yyval.node)->etype = OADD; } break; case 55: -#line 466 "go.y" +#line 467 "go.y" { (yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1)); + (yyval.node)->implicit = 1; (yyval.node)->etype = OSUB; } break; case 56: -#line 473 "go.y" +#line 475 "go.y" { Node *n, *nn; @@ -2831,7 +2819,7 @@ yyreduce: break; case 57: -#line 493 "go.y" +#line 495 "go.y" { Node *n; @@ -2852,7 +2840,7 @@ yyreduce: break; case 58: -#line 511 "go.y" +#line 513 "go.y" { // will be converted to OCASE // right will point to next case @@ -2864,7 +2852,7 @@ yyreduce: break; case 59: -#line 520 "go.y" +#line 522 "go.y" { Node *n, *nn; @@ -2883,14 +2871,14 @@ yyreduce: break; case 60: -#line 538 "go.y" +#line 540 "go.y" { markdcl(); } break; case 61: -#line 542 "go.y" +#line 544 "go.y" { if((yyvsp[(3) - (4)].list) == nil) (yyval.node) = nod(OEMPTY, N, N); @@ -2901,7 +2889,7 @@ yyreduce: break; case 62: -#line 552 "go.y" +#line 554 "go.y" { // If the last token read by the lexer was consumed // as part of the case, clear it (parser has cleared yychar). @@ -2915,7 +2903,7 @@ yyreduce: break; case 63: -#line 563 "go.y" +#line 565 "go.y" { int last; @@ -2937,28 +2925,28 @@ yyreduce: break; case 64: -#line 583 "go.y" +#line 585 "go.y" { (yyval.list) = nil; } break; case 65: -#line 587 "go.y" +#line 589 "go.y" { (yyval.list) = list((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node)); } break; case 66: -#line 593 "go.y" +#line 595 "go.y" { markdcl(); } break; case 67: -#line 597 "go.y" +#line 599 "go.y" { (yyval.list) = (yyvsp[(3) - (4)].list); popdcl(); @@ -2966,7 +2954,7 @@ yyreduce: break; case 68: -#line 604 "go.y" +#line 606 "go.y" { (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); (yyval.node)->list = (yyvsp[(1) - (4)].list); @@ -2975,7 +2963,7 @@ yyreduce: break; case 69: -#line 610 "go.y" +#line 612 "go.y" { (yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node)); (yyval.node)->list = (yyvsp[(1) - (4)].list); @@ -2987,6 +2975,14 @@ yyreduce: case 70: #line 619 "go.y" { + (yyval.node) = nod(ORANGE, N, (yyvsp[(2) - (2)].node)); + (yyval.node)->etype = 0; // := flag + } + break; + + case 71: +#line 626 "go.y" + { // init ; test ; incr if((yyvsp[(5) - (5)].node) != N && (yyvsp[(5) - (5)].node)->colas != 0) yyerror("cannot declare in the for-increment"); @@ -2998,8 +2994,8 @@ yyreduce: } break; - case 71: -#line 630 "go.y" + case 72: +#line 637 "go.y" { // normal test (yyval.node) = nod(OFOR, N, N); @@ -3007,31 +3003,31 @@ yyreduce: } break; - case 73: -#line 639 "go.y" + case 74: +#line 646 "go.y" { (yyval.node) = (yyvsp[(1) - (2)].node); (yyval.node)->nbody = concat((yyval.node)->nbody, (yyvsp[(2) - (2)].list)); } break; - case 74: -#line 646 "go.y" + case 75: +#line 653 "go.y" { markdcl(); } break; - case 75: -#line 650 "go.y" + case 76: +#line 657 "go.y" { (yyval.node) = (yyvsp[(3) - (3)].node); popdcl(); } break; - case 76: -#line 657 "go.y" + case 77: +#line 664 "go.y" { // test (yyval.node) = nod(OIF, N, N); @@ -3039,8 +3035,8 @@ yyreduce: } break; - case 77: -#line 663 "go.y" + case 78: +#line 670 "go.y" { // init ; test (yyval.node) = nod(OIF, N, N); @@ -3050,30 +3046,30 @@ yyreduce: } break; - case 78: -#line 674 "go.y" + case 79: +#line 681 "go.y" { markdcl(); } break; - case 79: -#line 678 "go.y" + case 80: +#line 685 "go.y" { if((yyvsp[(3) - (3)].node)->ntest == N) yyerror("missing condition in if statement"); } break; - case 80: -#line 683 "go.y" + case 81: +#line 690 "go.y" { (yyvsp[(3) - (5)].node)->nbody = (yyvsp[(5) - (5)].list); } break; - case 81: -#line 687 "go.y" + case 82: +#line 694 "go.y" { Node *n; NodeList *nn; @@ -3090,15 +3086,15 @@ yyreduce: } break; - case 82: -#line 704 "go.y" + case 83: +#line 711 "go.y" { markdcl(); } break; - case 83: -#line 708 "go.y" + case 84: +#line 715 "go.y" { if((yyvsp[(4) - (5)].node)->ntest == N) yyerror("missing condition in if statement"); @@ -3107,29 +3103,29 @@ yyreduce: } break; - case 84: -#line 716 "go.y" + case 85: +#line 723 "go.y" { (yyval.list) = nil; } break; - case 85: -#line 720 "go.y" + case 86: +#line 727 "go.y" { (yyval.list) = concat((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); } break; - case 86: -#line 725 "go.y" + case 87: +#line 732 "go.y" { (yyval.list) = nil; } break; - case 87: -#line 729 "go.y" + case 88: +#line 736 "go.y" { NodeList *node; @@ -3140,15 +3136,15 @@ yyreduce: } break; - case 88: -#line 740 "go.y" + case 89: +#line 747 "go.y" { markdcl(); } break; - case 89: -#line 744 "go.y" + case 90: +#line 751 "go.y" { Node *n; n = (yyvsp[(3) - (3)].node)->ntest; @@ -3158,8 +3154,8 @@ yyreduce: } break; - case 90: -#line 752 "go.y" + case 91: +#line 759 "go.y" { (yyval.node) = (yyvsp[(3) - (7)].node); (yyval.node)->op = OSWITCH; @@ -3169,15 +3165,15 @@ yyreduce: } break; - case 91: -#line 762 "go.y" + case 92: +#line 769 "go.y" { typesw = nod(OXXX, typesw, N); } break; - case 92: -#line 766 "go.y" + case 93: +#line 773 "go.y" { (yyval.node) = nod(OSELECT, N, N); (yyval.node)->lineno = typesw->lineno; @@ -3186,155 +3182,155 @@ yyreduce: } break; - case 94: -#line 779 "go.y" + case 95: +#line 786 "go.y" { (yyval.node) = nod(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 95: -#line 783 "go.y" + case 96: +#line 790 "go.y" { (yyval.node) = nod(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 96: -#line 787 "go.y" + case 97: +#line 794 "go.y" { (yyval.node) = nod(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 97: -#line 791 "go.y" + case 98: +#line 798 "go.y" { (yyval.node) = nod(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 98: -#line 795 "go.y" + case 99: +#line 802 "go.y" { (yyval.node) = nod(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 99: -#line 799 "go.y" + case 100: +#line 806 "go.y" { (yyval.node) = nod(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 100: -#line 803 "go.y" + case 101: +#line 810 "go.y" { (yyval.node) = nod(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 101: -#line 807 "go.y" + case 102: +#line 814 "go.y" { (yyval.node) = nod(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 102: -#line 811 "go.y" + case 103: +#line 818 "go.y" { (yyval.node) = nod(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 103: -#line 815 "go.y" + case 104: +#line 822 "go.y" { (yyval.node) = nod(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 104: -#line 819 "go.y" + case 105: +#line 826 "go.y" { (yyval.node) = nod(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 105: -#line 823 "go.y" + case 106: +#line 830 "go.y" { (yyval.node) = nod(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 106: -#line 827 "go.y" + case 107: +#line 834 "go.y" { (yyval.node) = nod(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 107: -#line 831 "go.y" + case 108: +#line 838 "go.y" { (yyval.node) = nod(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 108: -#line 835 "go.y" + case 109: +#line 842 "go.y" { (yyval.node) = nod(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 109: -#line 839 "go.y" + case 110: +#line 846 "go.y" { (yyval.node) = nod(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 110: -#line 843 "go.y" + case 111: +#line 850 "go.y" { (yyval.node) = nod(OANDNOT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 111: -#line 847 "go.y" + case 112: +#line 854 "go.y" { (yyval.node) = nod(OLSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 112: -#line 851 "go.y" + case 113: +#line 858 "go.y" { (yyval.node) = nod(ORSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 113: -#line 856 "go.y" + case 114: +#line 863 "go.y" { (yyval.node) = nod(OSEND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 115: -#line 863 "go.y" + case 116: +#line 870 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); } break; - case 116: -#line 867 "go.y" + case 117: +#line 874 "go.y" { if((yyvsp[(2) - (2)].node)->op == OCOMPLIT) { // Special case for &T{...}: turn into (*T){...}. @@ -3347,66 +3343,66 @@ yyreduce: } break; - case 117: -#line 878 "go.y" + case 118: +#line 885 "go.y" { (yyval.node) = nod(OPLUS, (yyvsp[(2) - (2)].node), N); } break; - case 118: -#line 882 "go.y" + case 119: +#line 889 "go.y" { (yyval.node) = nod(OMINUS, (yyvsp[(2) - (2)].node), N); } break; - case 119: -#line 886 "go.y" + case 120: +#line 893 "go.y" { (yyval.node) = nod(ONOT, (yyvsp[(2) - (2)].node), N); } break; - case 120: -#line 890 "go.y" + case 121: +#line 897 "go.y" { yyerror("the bitwise complement operator is ^"); (yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N); } break; - case 121: -#line 895 "go.y" + case 122: +#line 902 "go.y" { (yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N); } break; - case 122: -#line 899 "go.y" + case 123: +#line 906 "go.y" { (yyval.node) = nod(ORECV, (yyvsp[(2) - (2)].node), N); } break; - case 123: -#line 909 "go.y" + case 124: +#line 916 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (3)].node), N); } break; - case 124: -#line 913 "go.y" + case 125: +#line 920 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N); (yyval.node)->list = (yyvsp[(3) - (5)].list); } break; - case 125: -#line 918 "go.y" + case 126: +#line 925 "go.y" { (yyval.node) = nod(OCALL, (yyvsp[(1) - (6)].node), N); (yyval.node)->list = (yyvsp[(3) - (6)].list); @@ -3414,15 +3410,15 @@ yyreduce: } break; - case 126: -#line 926 "go.y" + case 127: +#line 933 "go.y" { (yyval.node) = nodlit((yyvsp[(1) - (1)].val)); } break; - case 128: -#line 931 "go.y" + case 129: +#line 938 "go.y" { if((yyvsp[(1) - (3)].node)->op == OPACK) { Sym *s; @@ -3435,36 +3431,36 @@ yyreduce: } break; - case 129: -#line 942 "go.y" + case 130: +#line 949 "go.y" { (yyval.node) = nod(ODOTTYPE, (yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node)); } break; - case 130: -#line 946 "go.y" + case 131: +#line 953 "go.y" { (yyval.node) = nod(OTYPESW, N, (yyvsp[(1) - (5)].node)); } break; - case 131: -#line 950 "go.y" + case 132: +#line 957 "go.y" { (yyval.node) = nod(OINDEX, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)); } break; - case 132: -#line 954 "go.y" + case 133: +#line 961 "go.y" { (yyval.node) = nod(OSLICE, (yyvsp[(1) - (6)].node), nod(OKEY, (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node))); } break; - case 133: -#line 958 "go.y" + case 134: +#line 965 "go.y" { if((yyvsp[(5) - (8)].node) == N) yyerror("middle index required in 3-index slice"); @@ -3474,8 +3470,8 @@ yyreduce: } break; - case 135: -#line 967 "go.y" + case 136: +#line 974 "go.y" { // conversion (yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N); @@ -3483,8 +3479,8 @@ yyreduce: } break; - case 136: -#line 973 "go.y" + case 137: +#line 980 "go.y" { (yyval.node) = (yyvsp[(3) - (5)].node); (yyval.node)->right = (yyvsp[(1) - (5)].node); @@ -3493,8 +3489,8 @@ yyreduce: } break; - case 137: -#line 980 "go.y" + case 138: +#line 987 "go.y" { (yyval.node) = (yyvsp[(3) - (5)].node); (yyval.node)->right = (yyvsp[(1) - (5)].node); @@ -3502,8 +3498,8 @@ yyreduce: } break; - case 138: -#line 986 "go.y" + case 139: +#line 993 "go.y" { yyerror("cannot parenthesize type in composite literal"); (yyval.node) = (yyvsp[(5) - (7)].node); @@ -3512,8 +3508,8 @@ yyreduce: } break; - case 140: -#line 995 "go.y" + case 141: +#line 1002 "go.y" { // composite expression. // make node early so we get the right line number. @@ -3521,15 +3517,15 @@ yyreduce: } break; - case 141: -#line 1003 "go.y" + case 142: +#line 1010 "go.y" { (yyval.node) = nod(OKEY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); } break; - case 142: -#line 1009 "go.y" + case 143: +#line 1016 "go.y" { // These nodes do not carry line numbers. // Since a composite literal commonly spans several lines, @@ -3548,24 +3544,24 @@ yyreduce: } break; - case 143: -#line 1026 "go.y" + case 144: +#line 1033 "go.y" { (yyval.node) = (yyvsp[(2) - (4)].node); (yyval.node)->list = (yyvsp[(3) - (4)].list); } break; - case 145: -#line 1034 "go.y" + case 146: +#line 1041 "go.y" { (yyval.node) = (yyvsp[(2) - (4)].node); (yyval.node)->list = (yyvsp[(3) - (4)].list); } break; - case 147: -#line 1042 "go.y" + case 148: +#line 1049 "go.y" { (yyval.node) = (yyvsp[(2) - (3)].node); @@ -3584,22 +3580,22 @@ yyreduce: } break; - case 151: -#line 1068 "go.y" + case 152: +#line 1075 "go.y" { (yyval.i) = LBODY; } break; - case 152: -#line 1072 "go.y" + case 153: +#line 1079 "go.y" { (yyval.i) = '{'; } break; - case 153: -#line 1083 "go.y" + case 154: +#line 1090 "go.y" { if((yyvsp[(1) - (1)].sym) == S) (yyval.node) = N; @@ -3608,22 +3604,22 @@ yyreduce: } break; - case 154: -#line 1092 "go.y" + case 155: +#line 1099 "go.y" { (yyval.node) = dclname((yyvsp[(1) - (1)].sym)); } break; - case 155: -#line 1097 "go.y" + case 156: +#line 1104 "go.y" { (yyval.node) = N; } break; - case 157: -#line 1104 "go.y" + case 158: +#line 1111 "go.y" { (yyval.sym) = (yyvsp[(1) - (1)].sym); // during imports, unqualified non-exported identifiers are from builtinpkg @@ -3632,15 +3628,15 @@ yyreduce: } break; - case 159: -#line 1112 "go.y" + case 160: +#line 1119 "go.y" { (yyval.sym) = S; } break; - case 160: -#line 1118 "go.y" + case 161: +#line 1125 "go.y" { Pkg *p; @@ -3655,8 +3651,8 @@ yyreduce: } break; - case 161: -#line 1131 "go.y" + case 162: +#line 1138 "go.y" { Pkg *p; @@ -3671,8 +3667,8 @@ yyreduce: } break; - case 162: -#line 1146 "go.y" + case 163: +#line 1153 "go.y" { (yyval.node) = oldname((yyvsp[(1) - (1)].sym)); if((yyval.node)->pack != N) @@ -3680,44 +3676,44 @@ yyreduce: } break; - case 164: -#line 1166 "go.y" + case 165: +#line 1173 "go.y" { yyerror("final argument in variadic function missing type"); (yyval.node) = nod(ODDD, typenod(typ(TINTER)), N); } break; - case 165: -#line 1171 "go.y" + case 166: +#line 1178 "go.y" { (yyval.node) = nod(ODDD, (yyvsp[(2) - (2)].node), N); } break; - case 171: -#line 1182 "go.y" + case 172: +#line 1189 "go.y" { - (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); + (yyval.node) = (yyvsp[(2) - (3)].node); } break; - case 175: -#line 1191 "go.y" + case 176: +#line 1198 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); } break; - case 180: -#line 1201 "go.y" + case 181: +#line 1208 "go.y" { - (yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N); + (yyval.node) = (yyvsp[(2) - (3)].node); } break; - case 190: -#line 1222 "go.y" + case 191: +#line 1229 "go.y" { if((yyvsp[(1) - (3)].node)->op == OPACK) { Sym *s; @@ -3730,61 +3726,61 @@ yyreduce: } break; - case 191: -#line 1235 "go.y" + case 192: +#line 1242 "go.y" { (yyval.node) = nod(OTARRAY, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node)); } break; - case 192: -#line 1239 "go.y" + case 193: +#line 1246 "go.y" { // array literal of nelem (yyval.node) = nod(OTARRAY, nod(ODDD, N, N), (yyvsp[(4) - (4)].node)); } break; - case 193: -#line 1244 "go.y" + case 194: +#line 1251 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(2) - (2)].node), N); (yyval.node)->etype = Cboth; } break; - case 194: -#line 1249 "go.y" + case 195: +#line 1256 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); (yyval.node)->etype = Csend; } break; - case 195: -#line 1254 "go.y" + case 196: +#line 1261 "go.y" { (yyval.node) = nod(OTMAP, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)); } break; - case 198: -#line 1262 "go.y" + case 199: +#line 1269 "go.y" { (yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N); } break; - case 199: -#line 1268 "go.y" + case 200: +#line 1275 "go.y" { (yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N); (yyval.node)->etype = Crecv; } break; - case 200: -#line 1275 "go.y" + case 201: +#line 1282 "go.y" { (yyval.node) = nod(OTSTRUCT, N, N); (yyval.node)->list = (yyvsp[(3) - (5)].list); @@ -3792,16 +3788,16 @@ yyreduce: } break; - case 201: -#line 1281 "go.y" + case 202: +#line 1288 "go.y" { (yyval.node) = nod(OTSTRUCT, N, N); fixlbrace((yyvsp[(2) - (3)].i)); } break; - case 202: -#line 1288 "go.y" + case 203: +#line 1295 "go.y" { (yyval.node) = nod(OTINTER, N, N); (yyval.node)->list = (yyvsp[(3) - (5)].list); @@ -3809,16 +3805,16 @@ yyreduce: } break; - case 203: -#line 1294 "go.y" + case 204: +#line 1301 "go.y" { (yyval.node) = nod(OTINTER, N, N); fixlbrace((yyvsp[(2) - (3)].i)); } break; - case 204: -#line 1305 "go.y" + case 205: +#line 1312 "go.y" { (yyval.node) = (yyvsp[(2) - (3)].node); if((yyval.node) == N) @@ -3828,12 +3824,13 @@ yyreduce: (yyval.node)->nbody = (yyvsp[(3) - (3)].list); (yyval.node)->endlineno = lineno; (yyval.node)->noescape = noescape; + (yyval.node)->nosplit = nosplit; funcbody((yyval.node)); } break; - case 205: -#line 1319 "go.y" + case 206: +#line 1327 "go.y" { Node *t; @@ -3864,8 +3861,8 @@ yyreduce: } break; - case 206: -#line 1348 "go.y" + case 207: +#line 1356 "go.y" { Node *rcvr, *t; @@ -3886,8 +3883,6 @@ yyreduce: yyerror("bad receiver in method"); break; } - if(rcvr->right->op == OTPAREN || (rcvr->right->op == OIND && rcvr->right->left->op == OTPAREN)) - yyerror("cannot parenthesize receiver type"); t = nod(OTFUNC, rcvr, N); t->list = (yyvsp[(6) - (8)].list); @@ -3905,8 +3900,8 @@ yyreduce: } break; - case 207: -#line 1388 "go.y" + case 208: +#line 1394 "go.y" { Sym *s; Type *t; @@ -3933,8 +3928,8 @@ yyreduce: } break; - case 208: -#line 1413 "go.y" + case 209: +#line 1419 "go.y" { (yyval.node) = methodname1(newname((yyvsp[(4) - (8)].sym)), (yyvsp[(2) - (8)].list)->n->right); (yyval.node)->type = functype((yyvsp[(2) - (8)].list)->n, (yyvsp[(6) - (8)].list), (yyvsp[(8) - (8)].list)); @@ -3952,8 +3947,8 @@ yyreduce: } break; - case 209: -#line 1431 "go.y" + case 210: +#line 1437 "go.y" { (yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1); (yyval.node) = nod(OTFUNC, N, N); @@ -3962,15 +3957,15 @@ yyreduce: } break; - case 210: -#line 1439 "go.y" + case 211: +#line 1445 "go.y" { (yyval.list) = nil; } break; - case 211: -#line 1443 "go.y" + case 212: +#line 1449 "go.y" { (yyval.list) = (yyvsp[(2) - (3)].list); if((yyval.list) == nil) @@ -3978,119 +3973,120 @@ yyreduce: } break; - case 212: -#line 1451 "go.y" + case 213: +#line 1457 "go.y" { (yyval.list) = nil; } break; - case 213: -#line 1455 "go.y" + case 214: +#line 1461 "go.y" { (yyval.list) = list1(nod(ODCLFIELD, N, (yyvsp[(1) - (1)].node))); } break; - case 214: -#line 1459 "go.y" + case 215: +#line 1465 "go.y" { (yyvsp[(2) - (3)].list) = checkarglist((yyvsp[(2) - (3)].list), 0); (yyval.list) = (yyvsp[(2) - (3)].list); } break; - case 215: -#line 1466 "go.y" + case 216: +#line 1472 "go.y" { closurehdr((yyvsp[(1) - (1)].node)); } break; - case 216: -#line 1472 "go.y" + case 217: +#line 1478 "go.y" { (yyval.node) = closurebody((yyvsp[(3) - (4)].list)); fixlbrace((yyvsp[(2) - (4)].i)); } break; - case 217: -#line 1477 "go.y" + case 218: +#line 1483 "go.y" { (yyval.node) = closurebody(nil); } break; - case 218: -#line 1488 "go.y" + case 219: +#line 1494 "go.y" { (yyval.list) = nil; } break; - case 219: -#line 1492 "go.y" + case 220: +#line 1498 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(2) - (3)].list)); if(nsyntaxerrors == 0) testdclstack(); nointerface = 0; noescape = 0; + nosplit = 0; } break; - case 221: -#line 1503 "go.y" + case 222: +#line 1510 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); } break; - case 223: -#line 1510 "go.y" + case 224: +#line 1517 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); } break; - case 224: -#line 1516 "go.y" + case 225: +#line 1523 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 225: -#line 1520 "go.y" + case 226: +#line 1527 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 227: -#line 1527 "go.y" + case 228: +#line 1534 "go.y" { (yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list)); } break; - case 228: -#line 1533 "go.y" + case 229: +#line 1540 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 229: -#line 1537 "go.y" + case 230: +#line 1544 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 230: -#line 1543 "go.y" + case 231: +#line 1550 "go.y" { NodeList *l; @@ -4115,16 +4111,16 @@ yyreduce: } break; - case 231: -#line 1566 "go.y" + case 232: +#line 1573 "go.y" { (yyvsp[(1) - (2)].node)->val = (yyvsp[(2) - (2)].val); (yyval.list) = list1((yyvsp[(1) - (2)].node)); } break; - case 232: -#line 1571 "go.y" + case 233: +#line 1578 "go.y" { (yyvsp[(2) - (4)].node)->val = (yyvsp[(4) - (4)].val); (yyval.list) = list1((yyvsp[(2) - (4)].node)); @@ -4132,8 +4128,8 @@ yyreduce: } break; - case 233: -#line 1577 "go.y" + case 234: +#line 1584 "go.y" { (yyvsp[(2) - (3)].node)->right = nod(OIND, (yyvsp[(2) - (3)].node)->right, N); (yyvsp[(2) - (3)].node)->val = (yyvsp[(3) - (3)].val); @@ -4141,8 +4137,8 @@ yyreduce: } break; - case 234: -#line 1583 "go.y" + case 235: +#line 1590 "go.y" { (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); (yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val); @@ -4151,8 +4147,8 @@ yyreduce: } break; - case 235: -#line 1590 "go.y" + case 236: +#line 1597 "go.y" { (yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N); (yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val); @@ -4161,8 +4157,8 @@ yyreduce: } break; - case 236: -#line 1599 "go.y" + case 237: +#line 1606 "go.y" { Node *n; @@ -4173,8 +4169,8 @@ yyreduce: } break; - case 237: -#line 1608 "go.y" + case 238: +#line 1615 "go.y" { Pkg *pkg; @@ -4189,38 +4185,38 @@ yyreduce: } break; - case 238: -#line 1623 "go.y" + case 239: +#line 1630 "go.y" { (yyval.node) = embedded((yyvsp[(1) - (1)].sym), localpkg); } break; - case 239: -#line 1629 "go.y" + case 240: +#line 1636 "go.y" { (yyval.node) = nod(ODCLFIELD, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node)); ifacedcl((yyval.node)); } break; - case 240: -#line 1634 "go.y" + case 241: +#line 1641 "go.y" { (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(1) - (1)].sym))); } break; - case 241: -#line 1638 "go.y" + case 242: +#line 1645 "go.y" { (yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(2) - (3)].sym))); yyerror("cannot parenthesize embedded type"); } break; - case 242: -#line 1645 "go.y" + case 243: +#line 1652 "go.y" { // without func keyword (yyvsp[(2) - (4)].list) = checkarglist((yyvsp[(2) - (4)].list), 1); @@ -4230,8 +4226,8 @@ yyreduce: } break; - case 244: -#line 1659 "go.y" + case 245: +#line 1666 "go.y" { (yyval.node) = nod(ONONAME, N, N); (yyval.node)->sym = (yyvsp[(1) - (2)].sym); @@ -4239,8 +4235,8 @@ yyreduce: } break; - case 245: -#line 1665 "go.y" + case 246: +#line 1672 "go.y" { (yyval.node) = nod(ONONAME, N, N); (yyval.node)->sym = (yyvsp[(1) - (2)].sym); @@ -4248,65 +4244,65 @@ yyreduce: } break; - case 247: -#line 1674 "go.y" + case 248: +#line 1681 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 248: -#line 1678 "go.y" + case 249: +#line 1685 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 249: -#line 1683 "go.y" + case 250: +#line 1690 "go.y" { (yyval.list) = nil; } break; - case 250: -#line 1687 "go.y" + case 251: +#line 1694 "go.y" { (yyval.list) = (yyvsp[(1) - (2)].list); } break; - case 251: -#line 1695 "go.y" + case 252: +#line 1702 "go.y" { (yyval.node) = N; } break; - case 253: -#line 1700 "go.y" + case 254: +#line 1707 "go.y" { (yyval.node) = liststmt((yyvsp[(1) - (1)].list)); } break; - case 255: -#line 1705 "go.y" + case 256: +#line 1712 "go.y" { (yyval.node) = N; } break; - case 261: -#line 1716 "go.y" + case 262: +#line 1723 "go.y" { (yyvsp[(1) - (2)].node) = nod(OLABEL, (yyvsp[(1) - (2)].node), N); (yyvsp[(1) - (2)].node)->sym = dclstack; // context, for goto restrictions } break; - case 262: -#line 1721 "go.y" + case 263: +#line 1728 "go.y" { NodeList *l; @@ -4318,8 +4314,8 @@ yyreduce: } break; - case 263: -#line 1731 "go.y" + case 264: +#line 1738 "go.y" { // will be converted to OFALL (yyval.node) = nod(OXFALL, N, N); @@ -4327,44 +4323,44 @@ yyreduce: } break; - case 264: -#line 1737 "go.y" + case 265: +#line 1744 "go.y" { (yyval.node) = nod(OBREAK, (yyvsp[(2) - (2)].node), N); } break; - case 265: -#line 1741 "go.y" + case 266: +#line 1748 "go.y" { (yyval.node) = nod(OCONTINUE, (yyvsp[(2) - (2)].node), N); } break; - case 266: -#line 1745 "go.y" + case 267: +#line 1752 "go.y" { (yyval.node) = nod(OPROC, (yyvsp[(2) - (2)].node), N); } break; - case 267: -#line 1749 "go.y" + case 268: +#line 1756 "go.y" { (yyval.node) = nod(ODEFER, (yyvsp[(2) - (2)].node), N); } break; - case 268: -#line 1753 "go.y" + case 269: +#line 1760 "go.y" { (yyval.node) = nod(OGOTO, (yyvsp[(2) - (2)].node), N); (yyval.node)->sym = dclstack; // context, for goto restrictions } break; - case 269: -#line 1758 "go.y" + case 270: +#line 1765 "go.y" { (yyval.node) = nod(ORETURN, N, N); (yyval.node)->list = (yyvsp[(2) - (2)].list); @@ -4383,8 +4379,8 @@ yyreduce: } break; - case 270: -#line 1777 "go.y" + case 271: +#line 1784 "go.y" { (yyval.list) = nil; if((yyvsp[(1) - (1)].node) != N) @@ -4392,8 +4388,8 @@ yyreduce: } break; - case 271: -#line 1783 "go.y" + case 272: +#line 1790 "go.y" { (yyval.list) = (yyvsp[(1) - (3)].list); if((yyvsp[(3) - (3)].node) != N) @@ -4401,190 +4397,190 @@ yyreduce: } break; - case 272: -#line 1791 "go.y" + case 273: +#line 1798 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 273: -#line 1795 "go.y" + case 274: +#line 1802 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 274: -#line 1801 "go.y" + case 275: +#line 1808 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 275: -#line 1805 "go.y" + case 276: +#line 1812 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 276: -#line 1811 "go.y" + case 277: +#line 1818 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 277: -#line 1815 "go.y" + case 278: +#line 1822 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 278: -#line 1821 "go.y" + case 279: +#line 1828 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 279: -#line 1825 "go.y" + case 280: +#line 1832 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 280: -#line 1834 "go.y" + case 281: +#line 1841 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 281: -#line 1838 "go.y" + case 282: +#line 1845 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 282: -#line 1842 "go.y" + case 283: +#line 1849 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 283: -#line 1846 "go.y" + case 284: +#line 1853 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 284: -#line 1851 "go.y" + case 285: +#line 1858 "go.y" { (yyval.list) = nil; } break; - case 285: -#line 1855 "go.y" + case 286: +#line 1862 "go.y" { (yyval.list) = (yyvsp[(1) - (2)].list); } break; - case 290: -#line 1869 "go.y" + case 291: +#line 1876 "go.y" { (yyval.node) = N; } break; - case 292: -#line 1875 "go.y" + case 293: +#line 1882 "go.y" { (yyval.list) = nil; } break; - case 294: -#line 1881 "go.y" + case 295: +#line 1888 "go.y" { (yyval.node) = N; } break; - case 296: -#line 1887 "go.y" + case 297: +#line 1894 "go.y" { (yyval.list) = nil; } break; - case 298: -#line 1893 "go.y" + case 299: +#line 1900 "go.y" { (yyval.list) = nil; } break; - case 300: -#line 1899 "go.y" + case 301: +#line 1906 "go.y" { (yyval.list) = nil; } break; - case 302: -#line 1905 "go.y" + case 303: +#line 1912 "go.y" { (yyval.val).ctype = CTxxx; } break; - case 304: -#line 1915 "go.y" + case 305: +#line 1922 "go.y" { importimport((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].val).u.sval); } break; - case 305: -#line 1919 "go.y" + case 306: +#line 1926 "go.y" { importvar((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].type)); } break; - case 306: -#line 1923 "go.y" + case 307: +#line 1930 "go.y" { importconst((yyvsp[(2) - (5)].sym), types[TIDEAL], (yyvsp[(4) - (5)].node)); } break; - case 307: -#line 1927 "go.y" + case 308: +#line 1934 "go.y" { importconst((yyvsp[(2) - (6)].sym), (yyvsp[(3) - (6)].type), (yyvsp[(5) - (6)].node)); } break; - case 308: -#line 1931 "go.y" + case 309: +#line 1938 "go.y" { importtype((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].type)); } break; - case 309: -#line 1935 "go.y" + case 310: +#line 1942 "go.y" { if((yyvsp[(2) - (4)].node) == N) { dclcontext = PEXTERN; // since we skip the funcbody below @@ -4604,31 +4600,31 @@ yyreduce: } break; - case 310: -#line 1955 "go.y" + case 311: +#line 1962 "go.y" { (yyval.sym) = (yyvsp[(1) - (1)].sym); structpkg = (yyval.sym)->pkg; } break; - case 311: -#line 1962 "go.y" + case 312: +#line 1969 "go.y" { (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); importsym((yyvsp[(1) - (1)].sym), OTYPE); } break; - case 317: -#line 1982 "go.y" + case 318: +#line 1989 "go.y" { (yyval.type) = pkgtype((yyvsp[(1) - (1)].sym)); } break; - case 318: -#line 1986 "go.y" + case 319: +#line 1993 "go.y" { // predefined name like uint8 (yyvsp[(1) - (1)].sym) = pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg); @@ -4640,50 +4636,50 @@ yyreduce: } break; - case 319: -#line 1996 "go.y" + case 320: +#line 2003 "go.y" { (yyval.type) = aindex(N, (yyvsp[(3) - (3)].type)); } break; - case 320: -#line 2000 "go.y" + case 321: +#line 2007 "go.y" { (yyval.type) = aindex(nodlit((yyvsp[(2) - (4)].val)), (yyvsp[(4) - (4)].type)); } break; - case 321: -#line 2004 "go.y" + case 322: +#line 2011 "go.y" { (yyval.type) = maptype((yyvsp[(3) - (5)].type), (yyvsp[(5) - (5)].type)); } break; - case 322: -#line 2008 "go.y" + case 323: +#line 2015 "go.y" { (yyval.type) = tostruct((yyvsp[(3) - (4)].list)); } break; - case 323: -#line 2012 "go.y" + case 324: +#line 2019 "go.y" { (yyval.type) = tointerface((yyvsp[(3) - (4)].list)); } break; - case 324: -#line 2016 "go.y" + case 325: +#line 2023 "go.y" { (yyval.type) = ptrto((yyvsp[(2) - (2)].type)); } break; - case 325: -#line 2020 "go.y" + case 326: +#line 2027 "go.y" { (yyval.type) = typ(TCHAN); (yyval.type)->type = (yyvsp[(2) - (2)].type); @@ -4691,8 +4687,8 @@ yyreduce: } break; - case 326: -#line 2026 "go.y" + case 327: +#line 2033 "go.y" { (yyval.type) = typ(TCHAN); (yyval.type)->type = (yyvsp[(3) - (4)].type); @@ -4700,8 +4696,8 @@ yyreduce: } break; - case 327: -#line 2032 "go.y" + case 328: +#line 2039 "go.y" { (yyval.type) = typ(TCHAN); (yyval.type)->type = (yyvsp[(3) - (3)].type); @@ -4709,8 +4705,8 @@ yyreduce: } break; - case 328: -#line 2040 "go.y" + case 329: +#line 2047 "go.y" { (yyval.type) = typ(TCHAN); (yyval.type)->type = (yyvsp[(3) - (3)].type); @@ -4718,15 +4714,15 @@ yyreduce: } break; - case 329: -#line 2048 "go.y" + case 330: +#line 2055 "go.y" { (yyval.type) = functype(nil, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)); } break; - case 330: -#line 2054 "go.y" + case 331: +#line 2061 "go.y" { (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(2) - (3)].type))); if((yyvsp[(1) - (3)].sym)) @@ -4735,8 +4731,8 @@ yyreduce: } break; - case 331: -#line 2061 "go.y" + case 332: +#line 2068 "go.y" { Type *t; @@ -4752,8 +4748,8 @@ yyreduce: } break; - case 332: -#line 2077 "go.y" + case 333: +#line 2084 "go.y" { Sym *s; Pkg *p; @@ -4775,50 +4771,50 @@ yyreduce: } break; - case 333: -#line 2099 "go.y" + case 334: +#line 2106 "go.y" { (yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (5)].sym)), typenod(functype(fakethis(), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list)))); } break; - case 334: -#line 2103 "go.y" + case 335: +#line 2110 "go.y" { (yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type))); } break; - case 335: -#line 2108 "go.y" + case 336: +#line 2115 "go.y" { (yyval.list) = nil; } break; - case 337: -#line 2115 "go.y" + case 338: +#line 2122 "go.y" { (yyval.list) = (yyvsp[(2) - (3)].list); } break; - case 338: -#line 2119 "go.y" + case 339: +#line 2126 "go.y" { (yyval.list) = list1(nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type)))); } break; - case 339: -#line 2129 "go.y" + case 340: +#line 2136 "go.y" { (yyval.node) = nodlit((yyvsp[(1) - (1)].val)); } break; - case 340: -#line 2133 "go.y" + case 341: +#line 2140 "go.y" { (yyval.node) = nodlit((yyvsp[(2) - (2)].val)); switch((yyval.node)->val.ctype){ @@ -4839,8 +4835,8 @@ yyreduce: } break; - case 341: -#line 2152 "go.y" + case 342: +#line 2159 "go.y" { (yyval.node) = oldname(pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg)); if((yyval.node)->op != OLITERAL) @@ -4848,8 +4844,8 @@ yyreduce: } break; - case 343: -#line 2161 "go.y" + case 344: +#line 2168 "go.y" { if((yyvsp[(2) - (5)].node)->val.ctype == CTRUNE && (yyvsp[(4) - (5)].node)->val.ctype == CTINT) { (yyval.node) = (yyvsp[(2) - (5)].node); @@ -4862,43 +4858,43 @@ yyreduce: } break; - case 346: -#line 2177 "go.y" + case 347: +#line 2184 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 347: -#line 2181 "go.y" + case 348: +#line 2188 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 348: -#line 2187 "go.y" + case 349: +#line 2194 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 349: -#line 2191 "go.y" + case 350: +#line 2198 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } break; - case 350: -#line 2197 "go.y" + case 351: +#line 2204 "go.y" { (yyval.list) = list1((yyvsp[(1) - (1)].node)); } break; - case 351: -#line 2201 "go.y" + case 352: +#line 2208 "go.y" { (yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node)); } @@ -4906,7 +4902,7 @@ yyreduce: /* Line 1267 of yacc.c. */ -#line 4911 "y.tab.c" +#line 4907 "y.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -5120,7 +5116,7 @@ yyreturn: } -#line 2205 "go.y" +#line 2212 "go.y" static void diff --git a/src/cmd/gc/yerr.h b/src/cmd/gc/yerr.h index 1526d8231..d0dd639ff 100644 --- a/src/cmd/gc/yerr.h +++ b/src/cmd/gc/yerr.h @@ -14,66 +14,66 @@ static struct { // is converted by bisonerrors into the yystate and yychar caused // by that token list. - 222, ',', - "unexpected comma during import block", + {222, ',', + "unexpected comma during import block"}, - 32, ';', - "missing import path; require quoted string", + {32, ';', + "missing import path; require quoted string"}, - 378, ';', - "missing { after if clause", + {380, ';', + "missing { after if clause"}, - 399, ';', - "missing { after switch clause", + {401, ';', + "missing { after switch clause"}, - 238, ';', - "missing { after for clause", + {239, ';', + "missing { after for clause"}, - 476, LBODY, - "missing { after for clause", + {478, LBODY, + "missing { after for clause"}, - 22, '{', - "unexpected semicolon or newline before {", + {22, '{', + "unexpected semicolon or newline before {"}, - 145, ';', - "unexpected semicolon or newline in type declaration", + {145, ';', + "unexpected semicolon or newline in type declaration"}, - 37, '}', - "unexpected } in channel type", + {37, '}', + "unexpected } in channel type"}, - 37, ')', - "unexpected ) in channel type", + {37, ')', + "unexpected ) in channel type"}, - 37, ',', - "unexpected comma in channel type", + {37, ',', + "unexpected comma in channel type"}, - 439, LELSE, - "unexpected semicolon or newline before else", + {441, LELSE, + "unexpected semicolon or newline before else"}, - 258, ',', - "name list not allowed in interface type", + {259, ',', + "name list not allowed in interface type"}, - 238, LVAR, - "var declaration not allowed in for initializer", + {239, LVAR, + "var declaration not allowed in for initializer"}, - 65, '{', - "unexpected { at end of statement", + {65, '{', + "unexpected { at end of statement"}, - 377, '{', - "unexpected { at end of statement", + {379, '{', + "unexpected { at end of statement"}, - 126, ';', - "argument to go/defer must be function call", + {126, ';', + "argument to go/defer must be function call"}, - 426, ';', - "need trailing comma before newline in composite literal", + {428, ';', + "need trailing comma before newline in composite literal"}, - 437, ';', - "need trailing comma before newline in composite literal", + {439, ';', + "need trailing comma before newline in composite literal"}, - 113, LNAME, - "nested func not allowed", + {113, LNAME, + "nested func not allowed"}, - 645, ';', - "else must be followed by if or statement block" + {647, ';', + "else must be followed by if or statement block"} }; |