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

Side by Side Diff: src/pkg/runtime/proc.c

Issue 2609041: code review 2609041: 6l: correct logic for morestack choice (Closed)
Patch Set: Created 14 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:
View unified diff | Download patch
« no previous file with comments | « src/cmd/6l/pass.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "runtime.h" 5 #include "runtime.h"
6 #include "arch.h" 6 #include "arch.h"
7 #include "defs.h" 7 #include "defs.h"
8 #include "malloc.h" 8 #include "malloc.h"
9 #include "os.h" 9 #include "os.h"
10 10
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 Stktop *top; 742 Stktop *top;
743 byte *stk, *sp; 743 byte *stk, *sp;
744 G *g1; 744 G *g1;
745 Gobuf label; 745 Gobuf label;
746 bool free; 746 bool free;
747 747
748 frame = m->moreframe; 748 frame = m->moreframe;
749 args = m->moreargs; 749 args = m->moreargs;
750 g1 = m->curg; 750 g1 = m->curg;
751 751
752 if(m->morebuf.sp < g1->stackguard - StackGuard)
753 throw("split stack overflow");
752 754
753 if(frame == 1 && args > 0 && m->morebuf.sp - sizeof(Stktop) - args - 32 > g1->stackguard) { 755 if(frame == 1 && args > 0 && m->morebuf.sp - sizeof(Stktop) - args - 32 > g1->stackguard) {
754 // special case: called from reflect.call (frame == 1) 756 // special case: called from reflect.call (frame == 1)
755 // to call code with an arbitrary argument size, 757 // to call code with an arbitrary argument size,
756 // and we have enough space on the current stack. 758 // and we have enough space on the current stack.
757 // the new Stktop* is necessary to unwind, but 759 // the new Stktop* is necessary to unwind, but
758 // we don't need to create a new segment. 760 // we don't need to create a new segment.
759 top = (Stktop*)(m->morebuf.sp - sizeof(*top)); 761 top = (Stktop*)(m->morebuf.sp - sizeof(*top));
760 stk = g1->stackguard - StackGuard; 762 stk = g1->stackguard - StackGuard;
761 free = false; 763 free = false;
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 g->lockedm = nil; 1185 g->lockedm = nil;
1184 } 1186 }
1185 1187
1186 // for testing of wire, unwire 1188 // for testing of wire, unwire
1187 void 1189 void
1188 ·mid(uint32 ret) 1190 ·mid(uint32 ret)
1189 { 1191 {
1190 ret = m->id; 1192 ret = m->id;
1191 FLUSH(&ret); 1193 FLUSH(&ret);
1192 } 1194 }
OLDNEW
« no previous file with comments | « src/cmd/6l/pass.c ('k') | no next file » | no next file with comments »

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