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

Delta Between Two Patch Sets: src/cmd/6g/gsubr.c

Issue 6733055: code review 6733055: cmd/5g, cmd/6g: fix out of registers with array indexing. (Closed)
Left Patch Set: diff -r 11f0ba3b7006 https://go.googlecode.com/hg/ Created 12 years, 5 months ago
Right Patch Set: diff -r 4f5ad3a5b26d https://go.googlecode.com/hg/ Created 12 years, 5 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/6g/gg.h ('k') | src/cmd/gc/fmt.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
1 // Derived from Inferno utils/6c/txt.c 1 // Derived from Inferno utils/6c/txt.c
2 // http://code.google.com/p/inferno-os/source/browse/utils/6c/txt.c 2 // http://code.google.com/p/inferno-os/source/browse/utils/6c/txt.c
3 // 3 //
4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
6 // Portions Copyright © 1997-1999 Vita Nuova Limited 6 // Portions Copyright © 1997-1999 Vita Nuova Limited
7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com) 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov a.com)
8 // Portions Copyright © 2004,2006 Bruce Ellis 8 // Portions Copyright © 2004,2006 Bruce Ellis
9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net)
10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 p = gins(AGLOBL, nam, N); 197 p = gins(AGLOBL, nam, N);
198 p->lineno = nam->lineno; 198 p->lineno = nam->lineno;
199 p->to.sym = S; 199 p->to.sym = S;
200 p->to.type = D_CONST; 200 p->to.type = D_CONST;
201 p->to.offset = width; 201 p->to.offset = width;
202 if(nam->readonly) 202 if(nam->readonly)
203 p->from.scale = RODATA; 203 p->from.scale = RODATA;
204 if(nam->type != T && !haspointers(nam->type)) 204 if(nam->type != T && !haspointers(nam->type))
205 p->from.scale |= NOPTR; 205 p->from.scale |= NOPTR;
206 }
207
208 void
209 gtrack(Sym *s)
210 {
211 Prog *p;
212 ········
213 p = gins(AUSEFIELD, N, N);
214 p->from.type = D_EXTERN;
215 p->from.index = D_NONE;
216 p->from.sym = s;
206 } 217 }
207 218
208 void 219 void
209 ggloblsym(Sym *s, int32 width, int dupok, int rodata) 220 ggloblsym(Sym *s, int32 width, int dupok, int rodata)
210 { 221 {
211 Prog *p; 222 Prog *p;
212 223
213 p = gins(AGLOBL, N, N); 224 p = gins(AGLOBL, N, N);
214 p->from.type = D_EXTERN; 225 p->from.type = D_EXTERN;
215 p->from.index = D_NONE; 226 p->from.index = D_NONE;
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 case ODOTPTR: 1954 case ODOTPTR:
1944 cleani += 2; 1955 cleani += 2;
1945 reg = &clean[cleani-1]; 1956 reg = &clean[cleani-1];
1946 reg1 = &clean[cleani-2]; 1957 reg1 = &clean[cleani-2];
1947 reg->op = OEMPTY; 1958 reg->op = OEMPTY;
1948 reg1->op = OEMPTY; 1959 reg1->op = OEMPTY;
1949 goto odot; 1960 goto odot;
1950 1961
1951 case OINDEX: 1962 case OINDEX:
1952 return 0; 1963 return 0;
1964 // disabled: OINDEX case is now covered by agenr
1965 // for a more suitable register allocation pattern.
1953 if(n->left->type->etype == TSTRING) 1966 if(n->left->type->etype == TSTRING)
1954 return 0; 1967 return 0;
1955 goto oindex; 1968 goto oindex;
1956 } 1969 }
1957 return 0; 1970 return 0;
1958 1971
1959 lit: 1972 lit:
1960 switch(as) { 1973 switch(as) {
1961 default: 1974 default:
1962 return 0; 1975 return 0;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 naddr(&n2, a, 1); 2249 naddr(&n2, a, 1);
2237 goto yes; 2250 goto yes;
2238 2251
2239 yes: 2252 yes:
2240 return 1; 2253 return 1;
2241 2254
2242 no: 2255 no:
2243 sudoclean(); 2256 sudoclean();
2244 return 0; 2257 return 0;
2245 } 2258 }
LEFTRIGHT

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