]> Cypherpunks.ru repositories - gostls13.git/commit
misc, runtime, test: extra tests and benchmarks for defer
authorDan Scales <danscales@google.com>
Tue, 24 Sep 2019 00:46:38 +0000 (17:46 -0700)
committerDan Scales <danscales@google.com>
Wed, 25 Sep 2019 23:27:16 +0000 (23:27 +0000)
commit225f484c880a840046129f16102216ee29271e66
treefdf43712239f32fe62e988f3b4033f1f924eb741
parent8c99e45ef956be18677d862fd64d1ba5346ce403
misc, runtime, test:  extra tests and benchmarks for defer

Add a bunch of extra tests and benchmarks for defer, in preparation for new
low-cost (open-coded) implementation of defers (see #34481),

 - New file defer_test.go that tests a bunch more unusual defer scenarios,
   including things that might have problems for open-coded defers.
 - Additions to callers_test.go actually verifying what the stack trace looks like
   for various panic or panic-recover scenarios.
 - Additions to crash_test.go testing several more crash scenarios involving
   recursive panics.
 - New benchmark in runtime_test.go measuring speed of panic-recover
 - New CGo benchmark in cgo_test.go calling from Go to C back to Go that
   shows defer overhead

Updates #34481

Change-Id: I423523f3e05fc0229d4277dd00073289a5526188
Reviewed-on: https://go-review.googlesource.com/c/go/+/197017
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
misc/cgo/test/cgo_test.go
misc/cgo/test/test.go
src/runtime/callers_test.go
src/runtime/crash_test.go
src/runtime/defer_test.go [new file with mode: 0644]
src/runtime/runtime_test.go
src/runtime/testdata/testprog/deadlock.go
test/codegen/stack.go