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

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

Issue 160200044: [dev.power64] code review 160200044: build: merge default into dev.power64 (Closed)
Left Patch Set: Created 10 years, 4 months ago
Right Patch Set: diff -r be0c14f62257b42485019e9e1db23cf40d2e249f https://code.google.com/p/go Created 10 years, 4 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:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/gc/popt.c ('k') | src/cmd/gc/reflect.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
(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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 case ONONAME: 412 case ONONAME:
413 case OLITERAL: 413 case OLITERAL:
414 case OSLICESTR: // always preceded by bounds checking, avoid double ins trumentation. 414 case OSLICESTR: // always preceded by bounds checking, avoid double ins trumentation.
415 case OTYPESW: // ignored by code generation, do not instrument. 415 case OTYPESW: // ignored by code generation, do not instrument.
416 goto ret; 416 goto ret;
417 } 417 }
418 418
419 ret: 419 ret:
420 if(n->op != OBLOCK) // OBLOCK is handled above in a special way. 420 if(n->op != OBLOCK) // OBLOCK is handled above in a special way.
421 racewalklist(n->list, init); 421 racewalklist(n->list, init);
422 » racewalknode(&n->ntest, &n->ntest->ninit, 0, 0); 422 » if(n->ntest != N)
423 » racewalknode(&n->nincr, &n->nincr->ninit, 0, 0); 423 » » racewalknode(&n->ntest, &n->ntest->ninit, 0, 0);
424 » if(n->nincr != N)
425 » » racewalknode(&n->nincr, &n->nincr->ninit, 0, 0);
424 racewalklist(n->nbody, nil); 426 racewalklist(n->nbody, nil);
425 racewalklist(n->nelse, nil); 427 racewalklist(n->nelse, nil);
426 racewalklist(n->rlist, nil); 428 racewalklist(n->rlist, nil);
427 *np = n; 429 *np = n;
428 } 430 }
429 431
430 static int 432 static int
431 isartificial(Node *n) 433 isartificial(Node *n)
432 { 434 {
433 // compiler-emitted artificial things that we do not want to instrument, 435 // compiler-emitted artificial things that we do not want to instrument,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 n = nod(OCONVNOP, n, N); 635 n = nod(OCONVNOP, n, N);
634 n->type = n->left->type; 636 n->type = n->left->type;
635 n->typecheck = 1; 637 n->typecheck = 1;
636 *np = n; 638 *np = n;
637 break; 639 break;
638 } 640 }
639 n->ninit = concat(n->ninit, init); 641 n->ninit = concat(n->ninit, init);
640 n->ullman = UINF; 642 n->ullman = UINF;
641 } 643 }
642 644
LEFTRIGHT

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