diff options
Diffstat (limited to 'libgo/go/runtime/runtime1.go')
-rw-r--r-- | libgo/go/runtime/runtime1.go | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/libgo/go/runtime/runtime1.go b/libgo/go/runtime/runtime1.go index dea19da997f..a41cfc81181 100644 --- a/libgo/go/runtime/runtime1.go +++ b/libgo/go/runtime/runtime1.go @@ -80,7 +80,6 @@ func goargs() { if GOOS == "windows" { return } - argslice = make([]string, argc) for i := int32(0); i < argc; i++ { argslice[i] = gostringnocopy(argv_index(argv, i)) @@ -345,6 +344,7 @@ type debugVars struct { gcshrinkstackoff int32 gcstackbarrieroff int32 gcstackbarrierall int32 + gcrescanstacks int32 gcstoptheworld int32 gctrace int32 invalidptr int32 @@ -370,6 +370,7 @@ var dbgvars = []dbgVar{ {"gcshrinkstackoff", &debug.gcshrinkstackoff}, {"gcstackbarrieroff", &debug.gcstackbarrieroff}, {"gcstackbarrierall", &debug.gcstackbarrierall}, + {"gcrescanstacks", &debug.gcrescanstacks}, {"gcstoptheworld", &debug.gcstoptheworld}, {"gctrace", &debug.gctrace}, {"invalidptr", &debug.invalidptr}, @@ -403,11 +404,15 @@ func parsedebugvars() { // is int, not int32, and should only be updated // if specified in GODEBUG. if key == "memprofilerate" { - MemProfileRate = atoi(value) + if n, ok := atoi(value); ok { + MemProfileRate = n + } } else { for _, v := range dbgvars { if v.name == key { - *v.value = int32(atoi(value)) + if n, ok := atoi32(value); ok { + *v.value = n + } } } } @@ -416,6 +421,13 @@ func parsedebugvars() { setTraceback(gogetenv("GOTRACEBACK")) traceback_env = traceback_cache + if debug.gcrescanstacks == 0 { + // Without rescanning, there's no need for stack + // barriers. + debug.gcstackbarrieroff = 1 + debug.gcstackbarrierall = 0 + } + // if debug.gcstackbarrierall > 0 { // firstStackBarrierOffset = 0 // } @@ -446,7 +458,10 @@ func setTraceback(level string) { case "crash": t = 2<<tracebackShift | tracebackAll | tracebackCrash default: - t = uint32(atoi(level))<<tracebackShift | tracebackAll + t = tracebackAll + if n, ok := atoi(level); ok && n == int(uint32(n)) { + t |= uint32(n) << tracebackShift + } } // when C owns the process, simply exit'ing the process on fatal errors // and panics is surprising. Be louder and abort instead. |