From c2047754c300b68c05d65faa8dc2925fe67b71b4 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 14 Jan 2017 00:05:42 +0000 Subject: libgo: update to Go 1.8 release candidate 1 Compiler changes: * Change map assignment to use mapassign and assign value directly. * Change string iteration to use decoderune, faster for ASCII strings. * Change makeslice to take int, and use makeslice64 for larger values. * Add new noverflow field to hmap struct used for maps. Unresolved problems, to be fixed later: * Commented out test in go/types/sizes_test.go that doesn't compile. * Commented out reflect.TestStructOf test for padding after zero-sized field. Reviewed-on: https://go-review.googlesource.com/35231 gotools/: Updates for Go 1.8rc1. * Makefile.am (go_cmd_go_files): Add bug.go. (s-zdefaultcc): Write defaultPkgConfig. * Makefile.in: Rebuild. From-SVN: r244456 --- libgo/runtime/proc.c | 60 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 22 deletions(-) (limited to 'libgo/runtime/proc.c') diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c index 90ff352..0ed7ebe 100644 --- a/libgo/runtime/proc.c +++ b/libgo/runtime/proc.c @@ -253,6 +253,7 @@ kickoff(void) fn = (void (*)(void*))(g->entry); param = g->param; + g->entry = nil; g->param = nil; fn(param); runtime_goexit1(); @@ -391,6 +392,8 @@ static bool exitsyscallfast(void); extern void setncpu(int32) __asm__(GOSYM_PREFIX "runtime.setncpu"); +extern void setpagesize(uintptr_t) + __asm__(GOSYM_PREFIX "runtime.setpagesize"); extern void allgadd(G*) __asm__(GOSYM_PREFIX "runtime.allgadd"); extern void mcommoninit(M*) @@ -456,6 +459,7 @@ runtime_schedinit(void) Eface i; setncpu(runtime_ncpu); + setpagesize(getpagesize()); runtime_sched = runtime_getsched(); m = &runtime_m0; @@ -646,15 +650,17 @@ void* runtime_mstart(void* mp) { M *m; + G *gp; m = (M*)mp; g = m->g0; g->m = m; + gp = g; initcontext(); - g->entry = nil; - g->param = nil; + gp->entry = nil; + gp->param = nil; // Record top of stack for use by mcall. // Once we call schedule we're never coming back, @@ -662,19 +668,24 @@ runtime_mstart(void* mp) #ifdef USING_SPLIT_STACK __splitstack_getcontext(&g->stackcontext[0]); #else - g->gcinitialsp = ∓ + gp->gcinitialsp = ∓ // Setting gcstacksize to 0 is a marker meaning that gcinitialsp // is the top of the stack, not the bottom. - g->gcstacksize = 0; - g->gcnextsp = ∓ + gp->gcstacksize = 0; + gp->gcnextsp = ∓ #endif - getcontext(ucontext_arg(&g->context[0])); + getcontext(ucontext_arg(&gp->context[0])); + + if(gp->traceback != nil) + gtraceback(gp); - if(g->entry != nil) { + if(gp->entry != nil) { // Got here from mcall. - void (*pfn)(G*) = (void (*)(G*))g->entry; - G* gp = (G*)g->param; - pfn(gp); + void (*pfn)(G*) = (void (*)(G*))gp->entry; + G* gp1 = (G*)gp->param; + gp->entry = nil; + gp->param = nil; + pfn(gp1); *(int*)0x21 = 0x21; } runtime_minit(); @@ -767,27 +778,31 @@ void setGContext() { int val; + G *gp; initcontext(); - g->entry = nil; - g->param = nil; + gp = g; + gp->entry = nil; + gp->param = nil; #ifdef USING_SPLIT_STACK - __splitstack_getcontext(&g->stackcontext[0]); + __splitstack_getcontext(&gp->stackcontext[0]); val = 0; __splitstack_block_signals(&val, nil); #else - g->gcinitialsp = &val; - g->gcstack = nil; - g->gcstacksize = 0; - g->gcnextsp = &val; + gp->gcinitialsp = &val; + gp->gcstack = nil; + gp->gcstacksize = 0; + gp->gcnextsp = &val; #endif - getcontext(ucontext_arg(&g->context[0])); + getcontext(ucontext_arg(&gp->context[0])); - if(g->entry != nil) { + if(gp->entry != nil) { // Got here from mcall. - void (*pfn)(G*) = (void (*)(G*))g->entry; - G* gp = (G*)g->param; - pfn(gp); + void (*pfn)(G*) = (void (*)(G*))gp->entry; + G* gp1 = (G*)gp->param; + gp->entry = nil; + gp->param = nil; + pfn(gp1); *(int*)0x22 = 0x22; } } @@ -1392,6 +1407,7 @@ __go_go(void (*fn)(void*), void* arg) runtime_throw("bad spsize in __go_go"); newg->gcnextsp = sp; #endif + newg->traceback = nil; } else { uintptr malsize; -- cgit v1.1