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

Delta Between Two Patch Sets: src/pkg/runtime/mgc0.c

Issue 12250043: code review 12250043: runtime: use gcpc/gcsp during traceback of goroutines i... (Closed)
Left Patch Set: diff -r b5442e956dd0 https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 7 months ago
Right Patch Set: diff -r 01d672e76b57 https://go.googlecode.com/hg/ Created 11 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:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | src/pkg/runtime/proc.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 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 // Garbage collector. 5 // Garbage collector.
6 6
7 #include "runtime.h" 7 #include "runtime.h"
8 #include "arch_GOARCH.h" 8 #include "arch_GOARCH.h"
9 #include "malloc.h" 9 #include "malloc.h"
10 #include "stack.h" 10 #include "stack.h"
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 void *base; 1450 void *base;
1451 uintptr size; 1451 uintptr size;
1452 1452
1453 stk = (Stktop*)gp->stackbase; 1453 stk = (Stktop*)gp->stackbase;
1454 guard = gp->stackguard; 1454 guard = gp->stackguard;
1455 1455
1456 if(gp == g) 1456 if(gp == g)
1457 runtime·throw("can't scan our own stack"); 1457 runtime·throw("can't scan our own stack");
1458 if((mp = gp->m) != nil && mp->helpgc) 1458 if((mp = gp->m) != nil && mp->helpgc)
1459 runtime·throw("can't scan gchelper stack"); 1459 runtime·throw("can't scan gchelper stack");
1460 » if(gp->gcstack != (uintptr)nil) { 1460 » if(gp->syscallstack != (uintptr)nil) {
1461 // Scanning another goroutine that is about to enter or might 1461 // Scanning another goroutine that is about to enter or might
1462 // have just exited a system call. It may be executing code such 1462 // have just exited a system call. It may be executing code such
1463 // as schedlock and may have needed to start a new stack segment . 1463 // as schedlock and may have needed to start a new stack segment .
1464 // Use the stack segment and stack pointer at the time of 1464 // Use the stack segment and stack pointer at the time of
1465 // the system call instead, since that won't change underfoot. 1465 // the system call instead, since that won't change underfoot.
1466 » » sp = gp->gcsp; 1466 » » sp = gp->syscallsp;
1467 » » pc = gp->gcpc; 1467 » » pc = gp->syscallpc;
1468 lr = 0; 1468 lr = 0;
1469 » » stk = (Stktop*)gp->gcstack; 1469 » » stk = (Stktop*)gp->syscallstack;
1470 » » guard = gp->gcguard; 1470 » » guard = gp->syscallguard;
1471 } else { 1471 } else {
1472 // Scanning another goroutine's stack. 1472 // Scanning another goroutine's stack.
1473 // The goroutine is usually asleep (the world is stopped). 1473 // The goroutine is usually asleep (the world is stopped).
1474 sp = gp->sched.sp; 1474 sp = gp->sched.sp;
1475 pc = gp->sched.pc; 1475 pc = gp->sched.pc;
1476 lr = gp->sched.lr; 1476 lr = gp->sched.lr;
1477 1477
1478 // For function about to start, context argument is a root too. 1478 // For function about to start, context argument is a root too.
1479 if(gp->sched.ctxt != 0 && runtime·mlookup(gp->sched.ctxt, &base, &size, nil)) 1479 if(gp->sched.ctxt != 0 && runtime·mlookup(gp->sched.ctxt, &base, &size, nil))
1480 addroot((Obj){base, size, 0}); 1480 addroot((Obj){base, size, 0});
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 uintptr n; 2520 uintptr n;
2521 2521
2522 n = (h->arena_used - h->arena_start) / wordsPerBitmapWord; 2522 n = (h->arena_used - h->arena_start) / wordsPerBitmapWord;
2523 n = ROUND(n, bitmapChunk); 2523 n = ROUND(n, bitmapChunk);
2524 if(h->bitmap_mapped >= n) 2524 if(h->bitmap_mapped >= n)
2525 return; 2525 return;
2526 2526
2527 runtime·SysMap(h->arena_start - n, n - h->bitmap_mapped); 2527 runtime·SysMap(h->arena_start - n, n - h->bitmap_mapped);
2528 h->bitmap_mapped = n; 2528 h->bitmap_mapped = n;
2529 } 2529 }
LEFTRIGHT

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