aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-11-21 07:03:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-11-21 07:03:38 +0000
commitfabcaa8df3d6eb852b87821ef090d31d222870b7 (patch)
tree72455aea0286937aa08cc141e5efc800e4626577 /libgo/go/runtime
parenta51fb17f48428e7cfc96a72a9f9f87901363bb6b (diff)
downloadgcc-fabcaa8df3d6eb852b87821ef090d31d222870b7.zip
gcc-fabcaa8df3d6eb852b87821ef090d31d222870b7.tar.gz
gcc-fabcaa8df3d6eb852b87821ef090d31d222870b7.tar.bz2
libgo: Update to current version of master library.
From-SVN: r193688
Diffstat (limited to 'libgo/go/runtime')
-rw-r--r--libgo/go/runtime/crash_test.go9
-rw-r--r--libgo/go/runtime/debug.go2
-rw-r--r--libgo/go/runtime/mem.go5
-rw-r--r--libgo/go/runtime/mgc0.go10
-rw-r--r--libgo/go/runtime/parfor_test.go14
-rw-r--r--libgo/go/runtime/pprof/pprof.go2
-rw-r--r--libgo/go/runtime/type.go12
-rw-r--r--libgo/go/runtime/vlop_arm_test.go2
8 files changed, 35 insertions, 21 deletions
diff --git a/libgo/go/runtime/crash_test.go b/libgo/go/runtime/crash_test.go
index 1522ec2..2113cbf 100644
--- a/libgo/go/runtime/crash_test.go
+++ b/libgo/go/runtime/crash_test.go
@@ -9,7 +9,6 @@ import (
"os"
// "os/exec"
"path/filepath"
- "runtime"
"testing"
"text/template"
)
@@ -22,14 +21,6 @@ type crashTest struct {
// both main (m0) and non-main threads (m).
func testCrashHandler(t *testing.T, ct *crashTest) {
- if runtime.GOOS == "freebsd" || runtime.GOOS == "netbsd" {
- // TODO(brainman): do not know why this test fails on freebsd
- // TODO(jsing): figure out why this causes delayed failures
- // on NetBSD - http://golang.org/issue/3954
- t.Logf("skipping test on %q", runtime.GOOS)
- return
- }
-
st := template.Must(template.New("crashSource").Parse(crashSource))
dir, err := ioutil.TempDir("", "go-build")
diff --git a/libgo/go/runtime/debug.go b/libgo/go/runtime/debug.go
index e9d7601..0211ce6 100644
--- a/libgo/go/runtime/debug.go
+++ b/libgo/go/runtime/debug.go
@@ -4,7 +4,7 @@
package runtime
-// Breakpoint() executes a breakpoint trap.
+// Breakpoint executes a breakpoint trap.
func Breakpoint()
// LockOSThread wires the calling goroutine to its current operating system thread.
diff --git a/libgo/go/runtime/mem.go b/libgo/go/runtime/mem.go
index 95e8aa7..fd423c8 100644
--- a/libgo/go/runtime/mem.go
+++ b/libgo/go/runtime/mem.go
@@ -6,6 +6,9 @@ package runtime
import "unsafe"
+// Note: the MemStats struct should be kept in sync with
+// struct MStats in malloc.h
+
// A MemStats records statistics about the memory allocator.
type MemStats struct {
// General statistics.
@@ -39,7 +42,7 @@ type MemStats struct {
NextGC uint64 // next run in HeapAlloc time (bytes)
LastGC uint64 // last run in absolute time (ns)
PauseTotalNs uint64
- PauseNs [256]uint64 // most recent GC pause times
+ PauseNs [256]uint64 // circular buffer of recent GC pause times, most recent at [(NumGC+255)%256]
NumGC uint32
EnableGC bool
DebugGC bool
diff --git a/libgo/go/runtime/mgc0.go b/libgo/go/runtime/mgc0.go
new file mode 100644
index 0000000..a7ddaf0
--- /dev/null
+++ b/libgo/go/runtime/mgc0.go
@@ -0,0 +1,10 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package runtime
+
+// Called from C. Returns the Go type *m.
+func gc_m_ptr(ret *interface{}) {
+ *ret = (*m)(nil)
+}
diff --git a/libgo/go/runtime/parfor_test.go b/libgo/go/runtime/parfor_test.go
index 0547db02..b382b76 100644
--- a/libgo/go/runtime/parfor_test.go
+++ b/libgo/go/runtime/parfor_test.go
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// The race detector does not understand ParFor synchronization.
+// +build !race
+
package runtime_test
import (
@@ -106,14 +109,21 @@ func TestParForParallel(t *testing.T) {
data[i] = i
}
P := GOMAXPROCS(-1)
+ c := make(chan bool, P)
desc := NewParFor(uint32(P))
- ParForSetup(desc, uint32(P), uint32(N), nil, true, func(desc *ParFor, i uint32) {
+ ParForSetup(desc, uint32(P), uint32(N), nil, false, func(desc *ParFor, i uint32) {
data[i] = data[i]*data[i] + 1
})
for p := 1; p < P; p++ {
- go ParForDo(desc)
+ go func() {
+ ParForDo(desc)
+ c <- true
+ }()
}
ParForDo(desc)
+ for p := 1; p < P; p++ {
+ <-c
+ }
for i := uint64(0); i < N; i++ {
if data[i] != i*i+1 {
t.Fatalf("Wrong element %d: %d", i, data[i])
diff --git a/libgo/go/runtime/pprof/pprof.go b/libgo/go/runtime/pprof/pprof.go
index 952ccf6..ee81c94 100644
--- a/libgo/go/runtime/pprof/pprof.go
+++ b/libgo/go/runtime/pprof/pprof.go
@@ -38,7 +38,7 @@ import (
// threadcreate - stack traces that led to the creation of new OS threads
// block - stack traces that led to blocking on synchronization primitives
//
-// These predefine profiles maintain themselves and panic on an explicit
+// These predefined profiles maintain themselves and panic on an explicit
// Add or Remove method call.
//
// The CPU profile is not available as a Profile. It has a special API,
diff --git a/libgo/go/runtime/type.go b/libgo/go/runtime/type.go
index c15c1c1..eba34e4 100644
--- a/libgo/go/runtime/type.go
+++ b/libgo/go/runtime/type.go
@@ -14,7 +14,7 @@ package runtime
import "unsafe"
-type commonType struct {
+type rtype struct {
Kind uint8
align uint8
fieldAlign uint8
@@ -26,14 +26,14 @@ type commonType struct {
string *string
*uncommonType
- ptrToThis *commonType
+ ptrToThis *rtype
}
type _method struct {
name *string
pkgPath *string
- mtyp *commonType
- typ *commonType
+ mtyp *rtype
+ typ *rtype
tfn unsafe.Pointer
}
@@ -46,10 +46,10 @@ type uncommonType struct {
type _imethod struct {
name *string
pkgPath *string
- typ *commonType
+ typ *rtype
}
type interfaceType struct {
- commonType
+ rtype
methods []_imethod
}
diff --git a/libgo/go/runtime/vlop_arm_test.go b/libgo/go/runtime/vlop_arm_test.go
index f672f1a..cd28419 100644
--- a/libgo/go/runtime/vlop_arm_test.go
+++ b/libgo/go/runtime/vlop_arm_test.go
@@ -6,7 +6,7 @@ package runtime_test
import "testing"
-// arm soft division benchmarks adapted from
+// arm soft division benchmarks adapted from
// http://ridiculousfish.com/files/division_benchmarks.tar.gz
const numeratorsSize = 1 << 21