aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/export_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-10-31 00:59:47 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-10-31 00:59:47 +0000
commitaf146490bb04205107cb23e301ec7a8ff927b5fc (patch)
tree13beeaed3698c61903fe93fb1ce70bd9b18d4e7f /libgo/go/runtime/export_test.go
parent725e1be3406315d9bcc8195d7eef0a7082b3c7cc (diff)
downloadgcc-af146490bb04205107cb23e301ec7a8ff927b5fc.zip
gcc-af146490bb04205107cb23e301ec7a8ff927b5fc.tar.gz
gcc-af146490bb04205107cb23e301ec7a8ff927b5fc.tar.bz2
runtime: Remove now unnecessary pad field from ParFor.
It is not needed due to the removal of the ctx field. Reviewed-on: https://go-review.googlesource.com/16525 From-SVN: r229616
Diffstat (limited to 'libgo/go/runtime/export_test.go')
-rw-r--r--libgo/go/runtime/export_test.go168
1 files changed, 126 insertions, 42 deletions
diff --git a/libgo/go/runtime/export_test.go b/libgo/go/runtime/export_test.go
index 165bebf..8782914 100644
--- a/libgo/go/runtime/export_test.go
+++ b/libgo/go/runtime/export_test.go
@@ -6,26 +6,33 @@
package runtime
-var Fadd64 = fadd64
-var Fsub64 = fsub64
-var Fmul64 = fmul64
-var Fdiv64 = fdiv64
-var F64to32 = f64to32
-var F32to64 = f32to64
-var Fcmp64 = fcmp64
-var Fintto64 = fintto64
-var F64toint = f64toint
-
-func entersyscall()
-func exitsyscall()
+import "unsafe"
+
+//var Fadd64 = fadd64
+//var Fsub64 = fsub64
+//var Fmul64 = fmul64
+//var Fdiv64 = fdiv64
+//var F64to32 = f64to32
+//var F32to64 = f32to64
+//var Fcmp64 = fcmp64
+//var Fintto64 = fintto64
+//var F64toint = f64toint
+//var Sqrt = sqrt
+
+func entersyscall(int32)
+func exitsyscall(int32)
func golockedOSThread() bool
var Entersyscall = entersyscall
var Exitsyscall = exitsyscall
var LockedOSThread = golockedOSThread
+// var Xadduintptr = xadduintptr
+
+// var FuncPC = funcPC
+
type LFNode struct {
- Next *LFNode
+ Next uint64
Pushcnt uintptr
}
@@ -36,18 +43,16 @@ var LFStackPush = lfstackpush_go
var LFStackPop = lfstackpop_go
type ParFor struct {
- body *byte
- done uint32
- Nthr uint32
- nthrmax uint32
- thrseq uint32
- Cnt uint32
- Ctx *byte
- wait bool
+ body func(*ParFor, uint32)
+ done uint32
+ Nthr uint32
+ thrseq uint32
+ Cnt uint32
+ wait bool
}
func newParFor(nthrmax uint32) *ParFor
-func parForSetup(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*ParFor, uint32))
+func parForSetup(desc *ParFor, nthr, n uint32, wait bool, body func(*ParFor, uint32))
func parForDo(desc *ParFor)
func parForIters(desc *ParFor, tid uintptr) (uintptr, uintptr)
@@ -60,31 +65,110 @@ func ParForIters(desc *ParFor, tid uint32) (uint32, uint32) {
return uint32(begin), uint32(end)
}
-func testSchedLocalQueue()
-func testSchedLocalQueueSteal()
+func GCMask(x interface{}) (ret []byte) {
+ return nil
+}
+
+//func testSchedLocalQueue()
+//func testSchedLocalQueueSteal()
+//
+//func RunSchedLocalQueueTest() {
+// testSchedLocalQueue()
+//}
+//
+//func RunSchedLocalQueueStealTest() {
+// testSchedLocalQueueSteal()
+//}
+
+//var StringHash = stringHash
+//var BytesHash = bytesHash
+//var Int32Hash = int32Hash
+//var Int64Hash = int64Hash
+//var EfaceHash = efaceHash
+//var IfaceHash = ifaceHash
+//var MemclrBytes = memclrBytes
+
+// var HashLoad = &hashLoad
+
+// entry point for testing
+//func GostringW(w []uint16) (s string) {
+// s = gostringw(&w[0])
+// return
+//}
+
+//var Gostringnocopy = gostringnocopy
+//var Maxstring = &maxstring
+
+//type Uintreg uintreg
+
+//extern __go_open
+func open(path *byte, mode int32, perm int32) int32
+
+func Open(path *byte, mode int32, perm int32) int32 {
+ return open(path, mode, perm)
+}
+
+//extern close
+func close(int32) int32
-var TestSchedLocalQueue1 = testSchedLocalQueue
-var TestSchedLocalQueueSteal1 = testSchedLocalQueueSteal
+func Close(fd int32) int32 {
+ return close(fd)
+}
-// func haveGoodHash() bool
-// func stringHash(s string, seed uintptr) uintptr
-// func bytesHash(b []byte, seed uintptr) uintptr
-// func int32Hash(i uint32, seed uintptr) uintptr
-// func int64Hash(i uint64, seed uintptr) uintptr
+//extern read
+func read(fd int32, buf unsafe.Pointer, size int32) int32
-// var HaveGoodHash = haveGoodHash
-// var StringHash = stringHash
-// var BytesHash = bytesHash
-// var Int32Hash = int32Hash
-// var Int64Hash = int64Hash
+func Read(fd int32, buf unsafe.Pointer, size int32) int32 {
+ return read(fd, buf, size)
+}
-var hashLoad float64 // declared in hashmap.c
-var HashLoad = &hashLoad
+//extern write
+func write(fd int32, buf unsafe.Pointer, size int32) int32
-func memclrBytes(b []byte)
+func Write(fd uintptr, buf unsafe.Pointer, size int32) int32 {
+ return write(int32(fd), buf, size)
+}
-var MemclrBytes = memclrBytes
+func envs() []string
+func setenvs([]string)
+
+var Envs = envs
+var SetEnvs = setenvs
+
+//var BigEndian = _BigEndian
+
+// For benchmarking.
+
+/*
+func BenchSetType(n int, x interface{}) {
+ e := *(*eface)(unsafe.Pointer(&x))
+ t := e._type
+ var size uintptr
+ var p unsafe.Pointer
+ switch t.kind & kindMask {
+ case _KindPtr:
+ t = (*ptrtype)(unsafe.Pointer(t)).elem
+ size = t.size
+ p = e.data
+ case _KindSlice:
+ slice := *(*struct {
+ ptr unsafe.Pointer
+ len, cap uintptr
+ })(e.data)
+ t = (*slicetype)(unsafe.Pointer(t)).elem
+ size = t.size * slice.len
+ p = slice.ptr
+ }
+ allocSize := roundupsize(size)
+ systemstack(func() {
+ for i := 0; i < n; i++ {
+ heapBitsSetType(uintptr(p), allocSize, size, t)
+ }
+ })
+}
-// func gogoBytes() int32
+const PtrSize = ptrSize
-// var GogoBytes = gogoBytes
+var TestingAssertE2I2GC = &testingAssertE2I2GC
+var TestingAssertE2T2GC = &testingAssertE2T2GC
+*/