LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 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 // The racewalk pass modifies the code tree for the function as follows: | 5 // The racewalk pass modifies the code tree for the function as follows: |
6 // | 6 // |
7 // 1. It inserts a call to racefuncenter at the beginning of each function. | 7 // 1. It inserts a call to racefuncenter at the beginning of each function. |
8 // 2. It inserts a call to racefuncexit at the end of each function. | 8 // 2. It inserts a call to racefuncexit at the end of each function. |
9 // 3. It inserts a call to raceread before each memory read. | 9 // 3. It inserts a call to raceread before each memory read. |
10 // 4. It inserts a call to racewrite before each memory write. | 10 // 4. It inserts a call to racewrite before each memory write. |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 racewalknode(&n->right, init, 0, 0); | 297 racewalknode(&n->right, init, 0, 0); |
298 goto ret; | 298 goto ret; |
299 } | 299 } |
300 racewalknode(&n->right, init, 0, 0); | 300 racewalknode(&n->right, init, 0, 0); |
301 if(n->left->type->etype != TSTRING) | 301 if(n->left->type->etype != TSTRING) |
302 callinstr(&n, init, wr, skip); | 302 callinstr(&n, init, wr, skip); |
303 goto ret; | 303 goto ret; |
304 | 304 |
305 case OSLICE: | 305 case OSLICE: |
306 case OSLICEARR: | 306 case OSLICEARR: |
| 307 case OSLICE3: |
| 308 case OSLICE3ARR: |
307 // Seems to only lead to double instrumentation. | 309 // Seems to only lead to double instrumentation. |
308 //racewalknode(&n->left, init, 0, 0); | 310 //racewalknode(&n->left, init, 0, 0); |
309 goto ret; | 311 goto ret; |
310 | 312 |
311 case OADDR: | 313 case OADDR: |
312 racewalknode(&n->left, init, 0, 1); | 314 racewalknode(&n->left, init, 0, 1); |
313 goto ret; | 315 goto ret; |
314 | 316 |
315 case OEFACE: | 317 case OEFACE: |
316 racewalknode(&n->left, init, 0, 0); | 318 racewalknode(&n->left, init, 0, 0); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 n = nod(OCONVNOP, n, N); | 621 n = nod(OCONVNOP, n, N); |
620 n->type = n->left->type; | 622 n->type = n->left->type; |
621 n->typecheck = 1; | 623 n->typecheck = 1; |
622 *np = n; | 624 *np = n; |
623 break; | 625 break; |
624 } | 626 } |
625 n->ninit = concat(n->ninit, init); | 627 n->ninit = concat(n->ninit, init); |
626 n->ullman = UINF; | 628 n->ullman = UINF; |
627 } | 629 } |
628 | 630 |
LEFT | RIGHT |