summaryrefslogtreecommitdiffstats
path: root/llgo/third_party/gofrontend/libgo/go/runtime/debug
diff options
context:
space:
mode:
authorAndrew Wilkins <axwalk@gmail.com>2016-03-15 05:36:43 +0000
committerAndrew Wilkins <axwalk@gmail.com>2016-03-15 05:36:43 +0000
commit6436a4abd7a2f3a60b230453295dba199d8a59c3 (patch)
tree125aef80fc2cf46c5d1758a8ece1fde14e7b13fd /llgo/third_party/gofrontend/libgo/go/runtime/debug
parent36761bf92427846ce40fdd849615732c852e44dd (diff)
downloadbcm5719-llvm-6436a4abd7a2f3a60b230453295dba199d8a59c3.tar.gz
bcm5719-llvm-6436a4abd7a2f3a60b230453295dba199d8a59c3.zip
[llgo] Roll gofrontend forward
Switch gofrontend to using go.googlesource.com, and update to 81eb6a3f425b2158c67ee32c0cc973a72ce9d6be. There are various changes required to update to the go 1.5 runtime: typemap.go is changed to accommodate the change in representation for equal/hash algorithms, and the removal of the zero value/type. CMakeLists.txt is updated to add the build tree to the package search path, so internal packages, which are not installed, are found. various files changes due to removal of __go_new_nopointers; the same change as in D11863, but with NoUnwindAttribute added to the added runtime functions which are called with "callOnly". minor cleanups in ssa.go while investigating issues with unwinding/panic handling. Differential Revisision: http://reviews.llvm.org/D15188 llvm-svn: 263536
Diffstat (limited to 'llgo/third_party/gofrontend/libgo/go/runtime/debug')
-rw-r--r--llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage.go2
-rw-r--r--llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage_test.go4
-rw-r--r--llgo/third_party/gofrontend/libgo/go/runtime/debug/heapdump_test.go36
-rw-r--r--llgo/third_party/gofrontend/libgo/go/runtime/debug/stack.go2
4 files changed, 42 insertions, 2 deletions
diff --git a/llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage.go b/llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage.go
index edb3643871e..c3363f9dd58 100644
--- a/llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage.go
+++ b/llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage.go
@@ -149,5 +149,5 @@ func SetPanicOnFault(enabled bool) bool
// WriteHeapDump writes a description of the heap and the objects in
// it to the given file descriptor.
-// The heap dump format is defined at http://golang.org/s/go13heapdump.
+// The heap dump format is defined at https://golang.org/s/go13heapdump.
func WriteHeapDump(fd uintptr)
diff --git a/llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage_test.go b/llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage_test.go
index 149bafc6f3c..13e1845098e 100644
--- a/llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage_test.go
+++ b/llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage_test.go
@@ -75,6 +75,10 @@ func TestReadGCStats(t *testing.T) {
var big = make([]byte, 1<<20)
func TestFreeOSMemory(t *testing.T) {
+ if runtime.GOARCH == "arm64" || runtime.GOARCH == "ppc64" || runtime.GOARCH == "ppc64le" ||
+ runtime.GOOS == "nacl" {
+ t.Skip("issue 9993; scavenger temporarily disabled on systems with physical pages larger than logical pages")
+ }
var ms1, ms2 runtime.MemStats
if big == nil {
diff --git a/llgo/third_party/gofrontend/libgo/go/runtime/debug/heapdump_test.go b/llgo/third_party/gofrontend/libgo/go/runtime/debug/heapdump_test.go
index 9201901151f..cb2f2f06798 100644
--- a/llgo/third_party/gofrontend/libgo/go/runtime/debug/heapdump_test.go
+++ b/llgo/third_party/gofrontend/libgo/go/runtime/debug/heapdump_test.go
@@ -31,3 +31,39 @@ func TestWriteHeapDumpNonempty(t *testing.T) {
t.Fatalf("Heap dump size %d bytes, expected at least %d bytes", size, minSize)
}
}
+
+type Obj struct {
+ x, y int
+}
+
+func objfin(x *Obj) {
+ println("finalized", x)
+}
+
+func TestWriteHeapDumpFinalizers(t *testing.T) {
+ if runtime.GOOS == "nacl" {
+ t.Skip("WriteHeapDump is not available on NaCl.")
+ }
+ f, err := ioutil.TempFile("", "heapdumptest")
+ if err != nil {
+ t.Fatalf("TempFile failed: %v", err)
+ }
+ defer os.Remove(f.Name())
+ defer f.Close()
+
+ // bug 9172: WriteHeapDump couldn't handle more than one finalizer
+ println("allocating objects")
+ x := &Obj{}
+ runtime.SetFinalizer(x, objfin)
+ y := &Obj{}
+ runtime.SetFinalizer(y, objfin)
+
+ // Trigger collection of x and y, queueing of their finalizers.
+ println("starting gc")
+ runtime.GC()
+
+ // Make sure WriteHeapDump doesn't fail with multiple queued finalizers.
+ println("starting dump")
+ WriteHeapDump(f.Fd())
+ println("done dump")
+}
diff --git a/llgo/third_party/gofrontend/libgo/go/runtime/debug/stack.go b/llgo/third_party/gofrontend/libgo/go/runtime/debug/stack.go
index c29b0a226a2..ab12bffa6e5 100644
--- a/llgo/third_party/gofrontend/libgo/go/runtime/debug/stack.go
+++ b/llgo/third_party/gofrontend/libgo/go/runtime/debug/stack.go
@@ -31,7 +31,7 @@ func PrintStack() {
// then attempts to discover, for Go functions, the calling function or
// method and the text of the line containing the invocation.
//
-// This function is deprecated. Use package runtime's Stack instead.
+// Deprecated: Use package runtime's Stack instead.
func Stack() []byte {
return stack()
}
OpenPOWER on IntegriCloud