]> Cypherpunks repositories - gostls13.git/commitdiff
undo CL 105260044 / afd6f214cc81
authorKeith Randall <khr@golang.org>
Tue, 17 Jun 2014 15:10:21 +0000 (08:10 -0700)
committerKeith Randall <khr@golang.org>
Tue, 17 Jun 2014 15:10:21 +0000 (08:10 -0700)
The go:nosplit change wasn't the problem, reinstating.

««« original CL description
undo CL 93380044 / 7f0999348917

Partial undo, just of go:nosplit annotation.  Somehow it
is breaking the windows builders.

TBR=bradfitz

««« original CL description
runtime: implement string ops in Go

Also implement go:nosplit annotation.  Not really needed
for now, but we'll definitely need it for other conversions.

benchmark                 old ns/op     new ns/op     delta
BenchmarkRuneIterate      534           474           -11.24%
BenchmarkRuneIterate2     535           470           -12.15%

LGTM=bradfitz
R=golang-codereviews, dave, bradfitz, minux
CC=golang-codereviews
https://golang.org/cl/93380044
»»»

TBR=bradfitz
CC=golang-codereviews
https://golang.org/cl/105260044
»»»

TBR=bradfitz
R=bradfitz, golang-codereviews
CC=golang-codereviews
https://golang.org/cl/103490043

src/cmd/gc/fmt.c
src/cmd/gc/go.h
src/cmd/gc/go.y
src/cmd/gc/lex.c
src/cmd/gc/pgen.c
src/cmd/gc/y.tab.c

index b5f8a834f1620e55b5f9ebfd6601303dc0f85fb1..8c2f8b98f1fbc871b18318b5ee63250665a85ae2 100644 (file)
@@ -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);
index 413e71069deb4fa7286c4499d7377174962c09f2..a5a464e23d32ccab982b4873c13f2bc068cfd7ea 100644 (file)
@@ -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;
@@ -980,6 +981,7 @@ EXTERN      char*   flag_installsuffix;
 EXTERN int     flag_race;
 EXTERN int     flag_largemodel;
 EXTERN int     noescape;
+EXTERN int     nosplit;
 EXTERN int     debuglive;
 EXTERN Link*   ctxt;
 
index 2f354f723fa54c750f2d2688a8ab9c6bc218674b..e351fa731c7920c53e1520b877360b71981c0d08 100644 (file)
@@ -1311,6 +1311,7 @@ xfndcl:
                $$->nbody = $3;
                $$->endlineno = lineno;
                $$->noescape = noescape;
+               $$->nosplit = nosplit;
                funcbody($$);
        }
 
@@ -1495,6 +1496,7 @@ xdcl_list:
                        testdclstack();
                nointerface = 0;
                noescape = 0;
+               nosplit = 0;
        }
 
 vardcl_list:
index a50101c4299c5278377a962d13760474b6198211..c90cbef890bcb50437cd9b813838033508606a41 100644 (file)
@@ -1592,6 +1592,10 @@ go:
                noescape = 1;
                goto out;
        }
+       if(strcmp(lexbuf, "go:nosplit") == 0) {
+               nosplit = 1;
+               goto out;
+       }
        
 out:
        return c;
index 40620c3dad90faa8dac1cb2ceeb7e1a540f09d77..cabba6824ec78ce519d34fbca45235e48312f718 100644 (file)
@@ -229,6 +229,8 @@ 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
index 08d8ecff20708e38d93a2d34e7f6d7f38ff692bb..c389f2324d522041671a9e5c416b8db698943eda 100644 (file)
@@ -3828,6 +3828,7 @@ yyreduce:
                (yyval.node)->nbody = (yyvsp[(3) - (3)].list);
                (yyval.node)->endlineno = lineno;
                (yyval.node)->noescape = noescape;
+               (yyval.node)->nosplit = nosplit;
                funcbody((yyval.node));
        }
     break;
@@ -4037,6 +4038,7 @@ yyreduce:
                        testdclstack();
                nointerface = 0;
                noescape = 0;
+               nosplit = 0;
        }
     break;