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

Side by Side Diff: src/cmd/gc/pgen.c

Issue 71030044: code review 71030044: cmd/ld: clear unused ctxt before morestack (Closed)
Patch Set: diff -r 363a4ef7e011 https://code.google.com/p/go/ Created 11 years 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:
View unified diff | Download patch
« no previous file with comments | « src/cmd/gc/go.h ('k') | src/cmd/ld/textflag.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 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 // "Portable" code generation. 5 // "Portable" code generation.
6 // Compiled separately for 5g, 6g, and 8g, so allowed to use gg.h, opt.h. 6 // Compiled separately for 5g, 6g, and 8g, so allowed to use gg.h, opt.h.
7 // Must code to the intersection of the three back ends. 7 // Must code to the intersection of the three back ends.
8 8
9 #include <u.h> 9 #include <u.h>
10 #include <libc.h> 10 #include <libc.h>
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 pl->name = linksym(curfn->nname->sym); 185 pl->name = linksym(curfn->nname->sym);
186 186
187 setlineno(curfn); 187 setlineno(curfn);
188 188
189 nodconst(&nod1, types[TINT32], 0); 189 nodconst(&nod1, types[TINT32], 0);
190 ptxt = gins(ATEXT, isblank(curfn->nname) ? N : curfn->nname, &nod1); 190 ptxt = gins(ATEXT, isblank(curfn->nname) ? N : curfn->nname, &nod1);
191 if(fn->dupok) 191 if(fn->dupok)
192 ptxt->TEXTFLAG |= DUPOK; 192 ptxt->TEXTFLAG |= DUPOK;
193 if(fn->wrapper) 193 if(fn->wrapper)
194 ptxt->TEXTFLAG |= WRAPPER; 194 ptxt->TEXTFLAG |= WRAPPER;
195 if(fn->needctxt)
196 ptxt->TEXTFLAG |= NEEDCTXT;
195 197
196 // Clumsy but important. 198 // Clumsy but important.
197 // See test/recover.go for test cases and src/pkg/reflect/value.go 199 // See test/recover.go for test cases and src/pkg/reflect/value.go
198 // for the actual functions being considered. 200 // for the actual functions being considered.
199 if(myimportpath != nil && strcmp(myimportpath, "reflect") == 0) { 201 if(myimportpath != nil && strcmp(myimportpath, "reflect") == 0) {
200 if(strcmp(curfn->nname->sym->name, "callReflect") == 0 || strcmp (curfn->nname->sym->name, "callMethod") == 0) 202 if(strcmp(curfn->nname->sym->name, "callReflect") == 0 || strcmp (curfn->nname->sym->name, "callMethod") == 0)
201 ptxt->TEXTFLAG |= WRAPPER; 203 ptxt->TEXTFLAG |= WRAPPER;
202 }······· 204 }·······
203 ········ 205 ········
204 afunclit(&ptxt->from, curfn->nname); 206 afunclit(&ptxt->from, curfn->nname);
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 } 480 }
479 if((thechar == '5' && n->op != OREGISTER) || !n->addable || n->op == OLI TERAL) { 481 if((thechar == '5' && n->op != OREGISTER) || !n->addable || n->op == OLI TERAL) {
480 regalloc(&reg, types[tptr], n); 482 regalloc(&reg, types[tptr], n);
481 cgen(n, &reg); 483 cgen(n, &reg);
482 gins(ACHECKNIL, &reg, N); 484 gins(ACHECKNIL, &reg, N);
483 regfree(&reg); 485 regfree(&reg);
484 return; 486 return;
485 } 487 }
486 gins(ACHECKNIL, n, N); 488 gins(ACHECKNIL, n, N);
487 } 489 }
OLDNEW
« no previous file with comments | « src/cmd/gc/go.h ('k') | src/cmd/ld/textflag.h » ('j') | no next file with comments »

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