OLD | NEW |
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 Type *t; | 158 Type *t; |
159 Iter save; | 159 Iter save; |
160 vlong oldstksize; | 160 vlong oldstksize; |
161 NodeList *l; | 161 NodeList *l; |
162 Sym *gcargs; | 162 Sym *gcargs; |
163 Sym *gclocals; | 163 Sym *gclocals; |
164 | 164 |
165 if(newproc == N) { | 165 if(newproc == N) { |
166 newproc = sysfunc("newproc"); | 166 newproc = sysfunc("newproc"); |
167 deferproc = sysfunc("deferproc"); | 167 deferproc = sysfunc("deferproc"); |
| 168 deferproc1 = sysfunc("deferproc1"); |
168 deferreturn = sysfunc("deferreturn"); | 169 deferreturn = sysfunc("deferreturn"); |
169 panicindex = sysfunc("panicindex"); | 170 panicindex = sysfunc("panicindex"); |
170 panicslice = sysfunc("panicslice"); | 171 panicslice = sysfunc("panicslice"); |
171 throwreturn = sysfunc("throwreturn"); | 172 throwreturn = sysfunc("throwreturn"); |
172 } | 173 } |
173 | 174 |
174 lno = setlineno(fn); | 175 lno = setlineno(fn); |
175 | 176 |
176 if(fn->nbody == nil) { | 177 if(fn->nbody == nil) { |
177 if(pure_go || memcmp(fn->nname->sym->name, "init·", 6) == 0) | 178 if(pure_go || memcmp(fn->nname->sym->name, "init·", 6) == 0) |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 } | 486 } |
486 if((thechar == '5' && n->op != OREGISTER) || !n->addable || n->op == OLI
TERAL) { | 487 if((thechar == '5' && n->op != OREGISTER) || !n->addable || n->op == OLI
TERAL) { |
487 regalloc(®, types[tptr], n); | 488 regalloc(®, types[tptr], n); |
488 cgen(n, ®); | 489 cgen(n, ®); |
489 gins(ACHECKNIL, ®, N); | 490 gins(ACHECKNIL, ®, N); |
490 regfree(®); | 491 regfree(®); |
491 return; | 492 return; |
492 } | 493 } |
493 gins(ACHECKNIL, n, N); | 494 gins(ACHECKNIL, n, N); |
494 } | 495 } |
OLD | NEW |