Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(515)

Delta Between Two Patch Sets: src/cmd/gc/select.c

Issue 4634073: code review 4634073: gc: Escape analysis. (Closed)
Left Patch Set: diff -r 1cad1e8470ba https://go.googlecode.com/hg/ Created 13 years, 9 months ago
Right Patch Set: diff -r adfa9f5cca40 https://go.googlecode.com/hg/ Created 13 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/gc/reflect.c ('k') | src/cmd/gc/subr.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 /* 5 /*
6 * select 6 * select
7 */ 7 */
8 8
9 #include "go.h" 9 #include "go.h"
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 n->right = n->right->left; 52 n->right = n->right->left;
53 53
54 if(n->right->op != ORECV) { 54 if(n->right->op != ORECV) {
55 yyerror("select assignment must have rec eive on right hand side"); 55 yyerror("select assignment must have rec eive on right hand side");
56 break; 56 break;
57 } 57 }
58 n->op = OSELRECV; 58 n->op = OSELRECV;
59 break; 59 break;
60 60
61 case OAS2RECV: 61 case OAS2RECV:
62 » » » » // convert x, ok = <-c into OSELRECV(x, <-c) wit h ntest=ok 62 » » » » // convert x, ok = <-c into OSELRECV2(x, <-c) wi th ntest=ok
63 if(n->right->op != ORECV) { 63 if(n->right->op != ORECV) {
64 yyerror("select assignment must have rec eive on right hand side"); 64 yyerror("select assignment must have rec eive on right hand side");
65 break; 65 break;
66 } 66 }
67 n->op = OSELRECV2; 67 n->op = OSELRECV2;
68 n->left = n->list->n; 68 n->left = n->list->n;
69 n->ntest = n->list->next->n; 69 n->ntest = n->list->next->n;
70 n->right = n->rlist->n; 70 n->right = n->rlist->n;
71 break; 71 break;
72 72
73 case ORECV: 73 case ORECV:
74 // convert <-c into OSELRECV(N, <-c) 74 // convert <-c into OSELRECV(N, <-c)
75 n = nod(OSELRECV, N, n); 75 n = nod(OSELRECV, N, n);
76 n->typecheck = 1;
76 ncase->left = n; 77 ncase->left = n;
77 break; 78 break;
78 79
79 case OSEND: 80 case OSEND:
80 break; 81 break;
81 } 82 }
82 } 83 }
83 typechecklist(ncase->nbody, Etop); 84 typechecklist(ncase->nbody, Etop);
84 } 85 }
85 sel->xoffset = count; 86 sel->xoffset = count;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 // run the select 343 // run the select
343 setlineno(sel); 344 setlineno(sel);
344 init = list(init, mkcall("selectgo", T, nil, var)); 345 init = list(init, mkcall("selectgo", T, nil, var));
345 sel->nbody = init; 346 sel->nbody = init;
346 347
347 out: 348 out:
348 sel->list = nil; 349 sel->list = nil;
349 walkstmtlist(sel->nbody); 350 walkstmtlist(sel->nbody);
350 lineno = lno; 351 lineno = lno;
351 } 352 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b