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

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

Issue 4515167: code review 4515167: gc: elide call to runtime.closure for function literals... (Closed)
Left Patch Set: Created 13 years, 10 months ago
Right Patch Set: diff -r b99566fe890a https://go.googlecode.com/hg/ Created 13 years, 10 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/go.h ('k') | src/pkg/runtime/closure_test.go » ('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 #include "go.h" 5 #include "go.h"
6 6
7 static Node* walkprint(Node*, NodeList**, int); 7 static Node* walkprint(Node*, NodeList**, int);
8 static Node* conv(Node*, Type*); 8 static Node* conv(Node*, Type*);
9 static Node* mapfn(char*, Type*); 9 static Node* mapfn(char*, Type*);
10 static Node* makenewvar(Type*, NodeList**, Node**); 10 static Node* makenewvar(Type*, NodeList**, Node**);
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 walkexpr(&n->left, init); 763 walkexpr(&n->left, init);
764 walkexprlist(n->list, init); 764 walkexprlist(n->list, init);
765 ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init); 765 ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init);
766 n->list = reorder1(ll); 766 n->list = reorder1(ll);
767 goto ret; 767 goto ret;
768 768
769 case OCALLFUNC: 769 case OCALLFUNC:
770 t = n->left->type; 770 t = n->left->type;
771 if(n->list && n->list->n->op == OAS) 771 if(n->list && n->list->n->op == OAS)
772 goto ret; 772 goto ret;
773 » » walkexpr(&n->left, init); 773
774 » » if(n->left->op == OCLOSURE) {
775 » » » walkcallclosure(n, init);
776 » » » t = n->left->type;
777 » » } else
778 » » » walkexpr(&n->left, init);
779
774 walkexprlist(n->list, init); 780 walkexprlist(n->list, init);
781
775 ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init); 782 ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init);
776 n->list = reorder1(ll); 783 n->list = reorder1(ll);
777 if(isselect(n)) { 784 if(isselect(n)) {
778 // special prob with selectsend and selectrecv: 785 // special prob with selectsend and selectrecv:
779 // if chan is nil, they don't know big the channel 786 // if chan is nil, they don't know big the channel
780 // element is and therefore don't know how to find 787 // element is and therefore don't know how to find
781 // the output bool, so we clear it before the call. 788 // the output bool, so we clear it before the call.
782 Node *b; 789 Node *b;
783 b = nodbool(0); 790 b = nodbool(0);
784 typecheck(&b, Erv); 791 typecheck(&b, Erv);
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after
2441 l = list(l, nod(OAS, nx, a->n)); // s[n] = arg 2448 l = list(l, nod(OAS, nx, a->n)); // s[n] = arg
2442 if (a->next != nil) 2449 if (a->next != nil)
2443 l = list(l, nod(OAS, nn, nod(OADD, nn, nodintconst(1)))) ; // n = n + 1 2450 l = list(l, nod(OAS, nn, nod(OADD, nn, nodintconst(1)))) ; // n = n + 1
2444 } 2451 }
2445 2452
2446 typechecklist(l, Etop); 2453 typechecklist(l, Etop);
2447 walkstmtlist(l); 2454 walkstmtlist(l);
2448 *init = concat(*init, l); 2455 *init = concat(*init, l);
2449 return ns; 2456 return ns;
2450 } 2457 }
LEFTRIGHT

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