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

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

Issue 6351090: code review 6351090: cmd/gc: Inline pointer sized T2I interface conversions (Closed)
Left Patch Set: diff -r 5d3aaf0b717e https://code.google.com/p/go/ Created 12 years, 8 months ago
Right Patch Set: diff -r 46e193d130ce https://code.google.com/p/go/ Created 12 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/gc/runtime.go ('k') | src/pkg/runtime/iface.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 // 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 <u.h> 5 #include <u.h>
6 #include <libc.h> 6 #include <libc.h>
7 #include "go.h" 7 #include "go.h"
8 8
9 static Node* walkprint(Node*, NodeList**, int); 9 static Node* walkprint(Node*, NodeList**, int);
10 static Node* mapfn(char*, Type*); 10 static Node* mapfn(char*, Type*);
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 /* For pointer types, we can make a special form of optimization 777 /* For pointer types, we can make a special form of optimization
778 * 778 *
779 * These statements are put onto the expression init list: 779 * These statements are put onto the expression init list:
780 * Itab *tab = atomicloadtype(&cache); 780 * Itab *tab = atomicloadtype(&cache);
781 * if(tab == nil) 781 * if(tab == nil)
782 * tab = typ2Itab(type, itype, &cac he); 782 * tab = typ2Itab(type, itype, &cac he);
783 * 783 *
784 * The CONVIFACE expression is replaced with thi s: 784 * The CONVIFACE expression is replaced with thi s:
785 * OEFACE{tab, ptr}; 785 * OEFACE{tab, ptr};
786 */ 786 */
787 r = l->left;
nigeltao 2012/08/24 05:02:51 Just use "sym->def" a few lines below instead of a
788 l = temp(ptrto(types[TUINT8])); 787 l = temp(ptrto(types[TUINT8]));
789 788
790 » » » » n1 = nod(OAS, l, r); 789 » » » » n1 = nod(OAS, l, sym->def);
791 typecheck(&n1, Etop); 790 typecheck(&n1, Etop);
792 *init = list(*init, n1); 791 *init = list(*init, n1);
793 792
794 fn = syslook("typ2Itab", 1); 793 fn = syslook("typ2Itab", 1);
795 n1 = nod(OCALL, fn, N); 794 n1 = nod(OCALL, fn, N);
796 n1->list = ll; 795 n1->list = ll;
797 typecheck(&n1, Erv); 796 typecheck(&n1, Erv);
798 walkexpr(&n1, init); 797 walkexpr(&n1, init);
799 798
800 n2 = nod(OIF, N, N); 799 n2 = nod(OIF, N, N);
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after
2888 bits -= v; 2887 bits -= v;
2889 } 2888 }
2890 break; 2889 break;
2891 } 2890 }
2892 ········ 2891 ········
2893 if(!sign && bits <= 62 && (1LL<<bits) <= max) 2892 if(!sign && bits <= 62 && (1LL<<bits) <= max)
2894 return 1; 2893 return 1;
2895 ········ 2894 ········
2896 return 0; 2895 return 0;
2897 } 2896 }
LEFTRIGHT

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