]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
runtime: Merge master revision 19185.
authorIan Lance Taylor <ian@gcc.gnu.org>
Sat, 12 Jul 2014 00:01:09 +0000 (00:01 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 12 Jul 2014 00:01:09 +0000 (00:01 +0000)
This revision renames several files in the runtime directory
from .c to .goc.

From-SVN: r212472

25 files changed:
libgo/MERGE
libgo/Makefile.am
libgo/Makefile.in
libgo/go/runtime/export_test.go
libgo/go/runtime/pprof/pprof_test.go
libgo/merge.sh
libgo/runtime/chan.goc [moved from libgo/runtime/chan.c with 77% similarity]
libgo/runtime/chan.h [new file with mode: 0644]
libgo/runtime/cpuprof.goc [moved from libgo/runtime/cpuprof.c with 98% similarity]
libgo/runtime/go-cgo.c
libgo/runtime/go-getgoroot.c [deleted file]
libgo/runtime/go-typestring.c [deleted file]
libgo/runtime/goc2c.c
libgo/runtime/lfstack.goc [moved from libgo/runtime/lfstack.c with 90% similarity]
libgo/runtime/malloc.goc
libgo/runtime/malloc.h
libgo/runtime/mgc0.c
libgo/runtime/parfor.c
libgo/runtime/print.c
libgo/runtime/proc.c
libgo/runtime/rdebug.goc [new file with mode: 0644]
libgo/runtime/runtime.c
libgo/runtime/runtime.h
libgo/runtime/runtime1.goc
libgo/runtime/string.goc

index 2ef8f7a9489efb31f54aff54e6ca7379e6f790d6..23732d0fc85e94a399c58214a41bd0e59452cfe6 100644 (file)
@@ -1,4 +1,4 @@
-50c8fc924389
+63484e8b6b76
 
 The first line of this file holds the Mercurial revision number of the
 last merge done from the master library sources.
index ad457a459c436233365f6eaf129c284254a38d60..f9bc89f322e017213945a1b3bdadff2de35999f7 100644 (file)
@@ -446,7 +446,6 @@ runtime_files = \
        runtime/go-eface-compare.c \
        runtime/go-eface-val-compare.c \
        runtime/go-fieldtrack.c \
-       runtime/go-getgoroot.c \
        runtime/go-int-array-to-string.c \
        runtime/go-int-to-string.c \
        runtime/go-interface-compare.c \
@@ -487,16 +486,12 @@ runtime_files = \
        runtime/go-type-interface.c \
        runtime/go-type-string.c \
        runtime/go-typedesc-equal.c \
-       runtime/go-typestring.c \
        runtime/go-unsafe-new.c \
        runtime/go-unsafe-newarray.c \
        runtime/go-unsafe-pointer.c \
        runtime/go-unwind.c \
        runtime/go-varargs.c \
-       runtime/chan.c \
-       runtime/cpuprof.c \
        runtime/env_posix.c \
-       runtime/lfstack.c \
        $(runtime_lock_files) \
        runtime/mcache.c \
        runtime/mcentral.c \
@@ -515,11 +510,15 @@ runtime_files = \
        runtime/thread.c \
        runtime/yield.c \
        $(rtems_task_variable_add_file) \
+       chan.c \
+       cpuprof.c \
        go-iface.c \
+       lfstack.c \
        malloc.c \
        map.c \
        mprof.c \
        netpoll.c \
+       rdebug.c \
        reflect.c \
        runtime1.c \
        sema.c \
index 0bff21f1213ea149f7ed2fb8edba2f3f21f3a736..8207e602f8e7a2143c634fcf1fff616aca59c842 100644 (file)
@@ -196,7 +196,7 @@ am__objects_6 = go-append.lo go-assert.lo go-assert-interface.lo \
        go-check-interface.lo go-construct-map.lo \
        go-convert-interface.lo go-copy.lo go-defer.lo \
        go-deferred-recover.lo go-eface-compare.lo \
-       go-eface-val-compare.lo go-fieldtrack.lo go-getgoroot.lo \
+       go-eface-val-compare.lo go-fieldtrack.lo \
        go-int-array-to-string.lo go-int-to-string.lo \
        go-interface-compare.lo go-interface-eface-compare.lo \
        go-interface-val-compare.lo go-make-slice.lo go-map-delete.lo \
@@ -209,16 +209,15 @@ am__objects_6 = go-append.lo go-assert.lo go-assert-interface.lo \
        go-strplus.lo go-strslice.lo go-traceback.lo \
        go-type-complex.lo go-type-eface.lo go-type-error.lo \
        go-type-float.lo go-type-identity.lo go-type-interface.lo \
-       go-type-string.lo go-typedesc-equal.lo go-typestring.lo \
-       go-unsafe-new.lo go-unsafe-newarray.lo go-unsafe-pointer.lo \
-       go-unwind.lo go-varargs.lo chan.lo cpuprof.lo env_posix.lo \
-       lfstack.lo $(am__objects_1) mcache.lo mcentral.lo \
-       $(am__objects_2) mfixalloc.lo mgc0.lo mheap.lo msize.lo \
-       $(am__objects_3) panic.lo parfor.lo print.lo proc.lo \
+       go-type-string.lo go-typedesc-equal.lo go-unsafe-new.lo \
+       go-unsafe-newarray.lo go-unsafe-pointer.lo go-unwind.lo \
+       go-varargs.lo env_posix.lo $(am__objects_1) mcache.lo \
+       mcentral.lo $(am__objects_2) mfixalloc.lo mgc0.lo mheap.lo \
+       msize.lo $(am__objects_3) panic.lo parfor.lo print.lo proc.lo \
        runtime.lo signal_unix.lo thread.lo yield.lo $(am__objects_4) \
-       go-iface.lo malloc.lo map.lo mprof.lo netpoll.lo reflect.lo \
-       runtime1.lo sema.lo sigqueue.lo string.lo time.lo \
-       $(am__objects_5)
+       chan.lo cpuprof.lo go-iface.lo lfstack.lo malloc.lo map.lo \
+       mprof.lo netpoll.lo rdebug.lo reflect.lo runtime1.lo sema.lo \
+       sigqueue.lo string.lo time.lo $(am__objects_5)
 am_libgo_la_OBJECTS = $(am__objects_6)
 libgo_la_OBJECTS = $(am_libgo_la_OBJECTS)
 libgo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -775,7 +774,6 @@ runtime_files = \
        runtime/go-eface-compare.c \
        runtime/go-eface-val-compare.c \
        runtime/go-fieldtrack.c \
-       runtime/go-getgoroot.c \
        runtime/go-int-array-to-string.c \
        runtime/go-int-to-string.c \
        runtime/go-interface-compare.c \
@@ -816,16 +814,12 @@ runtime_files = \
        runtime/go-type-interface.c \
        runtime/go-type-string.c \
        runtime/go-typedesc-equal.c \
-       runtime/go-typestring.c \
        runtime/go-unsafe-new.c \
        runtime/go-unsafe-newarray.c \
        runtime/go-unsafe-pointer.c \
        runtime/go-unwind.c \
        runtime/go-varargs.c \
-       runtime/chan.c \
-       runtime/cpuprof.c \
        runtime/env_posix.c \
-       runtime/lfstack.c \
        $(runtime_lock_files) \
        runtime/mcache.c \
        runtime/mcentral.c \
@@ -844,11 +838,15 @@ runtime_files = \
        runtime/thread.c \
        runtime/yield.c \
        $(rtems_task_variable_add_file) \
+       chan.c \
+       cpuprof.c \
        go-iface.c \
+       lfstack.c \
        malloc.c \
        map.c \
        mprof.c \
        netpoll.c \
+       rdebug.c \
        reflect.c \
        runtime1.c \
        sema.c \
@@ -2428,7 +2426,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-eface-compare.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-eface-val-compare.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-fieldtrack.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-getgoroot.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-iface.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-int-array-to-string.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-int-to-string.Plo@am__quote@
@@ -2471,7 +2468,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-type-interface.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-type-string.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-typedesc-equal.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-typestring.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-unsafe-new.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-unsafe-newarray.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/go-unsafe-pointer.Plo@am__quote@
@@ -2499,6 +2495,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parfor.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdebug.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reflect.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtems-task-variable-add.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtime.Plo@am__quote@
@@ -2681,13 +2678,6 @@ go-fieldtrack.lo: runtime/go-fieldtrack.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-fieldtrack.lo `test -f 'runtime/go-fieldtrack.c' || echo '$(srcdir)/'`runtime/go-fieldtrack.c
 
-go-getgoroot.lo: runtime/go-getgoroot.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-getgoroot.lo -MD -MP -MF $(DEPDIR)/go-getgoroot.Tpo -c -o go-getgoroot.lo `test -f 'runtime/go-getgoroot.c' || echo '$(srcdir)/'`runtime/go-getgoroot.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/go-getgoroot.Tpo $(DEPDIR)/go-getgoroot.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/go-getgoroot.c' object='go-getgoroot.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-getgoroot.lo `test -f 'runtime/go-getgoroot.c' || echo '$(srcdir)/'`runtime/go-getgoroot.c
-
 go-int-array-to-string.lo: runtime/go-int-array-to-string.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-int-array-to-string.lo -MD -MP -MF $(DEPDIR)/go-int-array-to-string.Tpo -c -o go-int-array-to-string.lo `test -f 'runtime/go-int-array-to-string.c' || echo '$(srcdir)/'`runtime/go-int-array-to-string.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/go-int-array-to-string.Tpo $(DEPDIR)/go-int-array-to-string.Plo
@@ -2968,13 +2958,6 @@ go-typedesc-equal.lo: runtime/go-typedesc-equal.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-typedesc-equal.lo `test -f 'runtime/go-typedesc-equal.c' || echo '$(srcdir)/'`runtime/go-typedesc-equal.c
 
-go-typestring.lo: runtime/go-typestring.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-typestring.lo -MD -MP -MF $(DEPDIR)/go-typestring.Tpo -c -o go-typestring.lo `test -f 'runtime/go-typestring.c' || echo '$(srcdir)/'`runtime/go-typestring.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/go-typestring.Tpo $(DEPDIR)/go-typestring.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/go-typestring.c' object='go-typestring.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-typestring.lo `test -f 'runtime/go-typestring.c' || echo '$(srcdir)/'`runtime/go-typestring.c
-
 go-unsafe-new.lo: runtime/go-unsafe-new.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT go-unsafe-new.lo -MD -MP -MF $(DEPDIR)/go-unsafe-new.Tpo -c -o go-unsafe-new.lo `test -f 'runtime/go-unsafe-new.c' || echo '$(srcdir)/'`runtime/go-unsafe-new.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/go-unsafe-new.Tpo $(DEPDIR)/go-unsafe-new.Plo
@@ -3010,20 +2993,6 @@ go-varargs.lo: runtime/go-varargs.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o go-varargs.lo `test -f 'runtime/go-varargs.c' || echo '$(srcdir)/'`runtime/go-varargs.c
 
-chan.lo: runtime/chan.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT chan.lo -MD -MP -MF $(DEPDIR)/chan.Tpo -c -o chan.lo `test -f 'runtime/chan.c' || echo '$(srcdir)/'`runtime/chan.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/chan.Tpo $(DEPDIR)/chan.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/chan.c' object='chan.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o chan.lo `test -f 'runtime/chan.c' || echo '$(srcdir)/'`runtime/chan.c
-
-cpuprof.lo: runtime/cpuprof.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpuprof.lo -MD -MP -MF $(DEPDIR)/cpuprof.Tpo -c -o cpuprof.lo `test -f 'runtime/cpuprof.c' || echo '$(srcdir)/'`runtime/cpuprof.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/cpuprof.Tpo $(DEPDIR)/cpuprof.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/cpuprof.c' object='cpuprof.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpuprof.lo `test -f 'runtime/cpuprof.c' || echo '$(srcdir)/'`runtime/cpuprof.c
-
 env_posix.lo: runtime/env_posix.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT env_posix.lo -MD -MP -MF $(DEPDIR)/env_posix.Tpo -c -o env_posix.lo `test -f 'runtime/env_posix.c' || echo '$(srcdir)/'`runtime/env_posix.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/env_posix.Tpo $(DEPDIR)/env_posix.Plo
@@ -3031,13 +3000,6 @@ env_posix.lo: runtime/env_posix.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o env_posix.lo `test -f 'runtime/env_posix.c' || echo '$(srcdir)/'`runtime/env_posix.c
 
-lfstack.lo: runtime/lfstack.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lfstack.lo -MD -MP -MF $(DEPDIR)/lfstack.Tpo -c -o lfstack.lo `test -f 'runtime/lfstack.c' || echo '$(srcdir)/'`runtime/lfstack.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lfstack.Tpo $(DEPDIR)/lfstack.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='runtime/lfstack.c' object='lfstack.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lfstack.lo `test -f 'runtime/lfstack.c' || echo '$(srcdir)/'`runtime/lfstack.c
-
 lock_sema.lo: runtime/lock_sema.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lock_sema.lo -MD -MP -MF $(DEPDIR)/lock_sema.Tpo -c -o lock_sema.lo `test -f 'runtime/lock_sema.c' || echo '$(srcdir)/'`runtime/lock_sema.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/lock_sema.Tpo $(DEPDIR)/lock_sema.Plo
index 436c28deae99790cbb6ddf37ef4a2aebd808a98d..165bebf6316fe5d66845a0b726dbf68c6f54f166 100644 (file)
@@ -29,11 +29,11 @@ type LFNode struct {
        Pushcnt uintptr
 }
 
-func lfstackpush(head *uint64, node *LFNode)
-func lfstackpop2(head *uint64) *LFNode
+func lfstackpush_go(head *uint64, node *LFNode)
+func lfstackpop_go(head *uint64) *LFNode
 
-var LFStackPush = lfstackpush
-var LFStackPop = lfstackpop2
+var LFStackPush = lfstackpush_go
+var LFStackPop = lfstackpop_go
 
 type ParFor struct {
        body    *byte
@@ -46,17 +46,17 @@ type ParFor struct {
        wait    bool
 }
 
-func parforalloc2(nthrmax uint32) *ParFor
-func parforsetup2(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*ParFor, uint32))
-func parfordo(desc *ParFor)
-func parforiters(desc *ParFor, tid uintptr) (uintptr, uintptr)
+func newParFor(nthrmax uint32) *ParFor
+func parForSetup(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*ParFor, uint32))
+func parForDo(desc *ParFor)
+func parForIters(desc *ParFor, tid uintptr) (uintptr, uintptr)
 
-var NewParFor = parforalloc2
-var ParForSetup = parforsetup2
-var ParForDo = parfordo
+var NewParFor = newParFor
+var ParForSetup = parForSetup
+var ParForDo = parForDo
 
 func ParForIters(desc *ParFor, tid uint32) (uint32, uint32) {
-       begin, end := parforiters(desc, uintptr(tid))
+       begin, end := parForIters(desc, uintptr(tid))
        return uint32(begin), uint32(end)
 }
 
@@ -78,11 +78,13 @@ var TestSchedLocalQueueSteal1 = testSchedLocalQueueSteal
 // var Int32Hash = int32Hash
 // var Int64Hash = int64Hash
 
-// func GogoBytes() int32
-
 var hashLoad float64 // declared in hashmap.c
 var HashLoad = &hashLoad
 
 func memclrBytes(b []byte)
 
 var MemclrBytes = memclrBytes
+
+// func gogoBytes() int32
+
+// var GogoBytes = gogoBytes
index 923c5b384160bf380d4b21b3e7ce0ccc2f36b353..cce60e1be3b94c6f1ce62226be4c4ea67fb0ffd0 100644 (file)
@@ -280,31 +280,31 @@ func TestBlockProfile(t *testing.T) {
        tests := [...]TestCase{
                {"chan recv", blockChanRecv, `
 [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-#      0x[0-9,a-f]+    runtime\.chanrecv1\+0x[0-9,a-f]+        .*/src/pkg/runtime/chan.c:[0-9]+
+#      0x[0-9,a-f]+    runtime\.chanrecv1\+0x[0-9,a-f]+        .*/src/pkg/runtime/chan.goc:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.blockChanRecv\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+      .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 `},
                {"chan send", blockChanSend, `
 [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-#      0x[0-9,a-f]+    runtime\.chansend1\+0x[0-9,a-f]+        .*/src/pkg/runtime/chan.c:[0-9]+
+#      0x[0-9,a-f]+    runtime\.chansend1\+0x[0-9,a-f]+        .*/src/pkg/runtime/chan.goc:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.blockChanSend\+0x[0-9,a-f]+ .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+      .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 `},
                {"chan close", blockChanClose, `
 [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-#      0x[0-9,a-f]+    runtime\.chanrecv1\+0x[0-9,a-f]+        .*/src/pkg/runtime/chan.c:[0-9]+
+#      0x[0-9,a-f]+    runtime\.chanrecv1\+0x[0-9,a-f]+        .*/src/pkg/runtime/chan.goc:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.blockChanClose\+0x[0-9,a-f]+        .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+      .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 `},
                {"select recv async", blockSelectRecvAsync, `
 [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-#      0x[0-9,a-f]+    runtime\.selectgo\+0x[0-9,a-f]+ .*/src/pkg/runtime/chan.c:[0-9]+
+#      0x[0-9,a-f]+    runtime\.selectgo\+0x[0-9,a-f]+ .*/src/pkg/runtime/chan.goc:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.blockSelectRecvAsync\+0x[0-9,a-f]+  .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+      .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 `},
                {"select send sync", blockSelectSendSync, `
 [0-9]+ [0-9]+ @ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+ 0x[0-9,a-f]+
-#      0x[0-9,a-f]+    runtime\.selectgo\+0x[0-9,a-f]+ .*/src/pkg/runtime/chan.c:[0-9]+
+#      0x[0-9,a-f]+    runtime\.selectgo\+0x[0-9,a-f]+ .*/src/pkg/runtime/chan.goc:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.blockSelectSendSync\+0x[0-9,a-f]+   .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 #      0x[0-9,a-f]+    runtime/pprof_test\.TestBlockProfile\+0x[0-9,a-f]+      .*/src/pkg/runtime/pprof/pprof_test.go:[0-9]+
 `},
index 8a3693123b126e7edbe3b12b1c7f24f29e17a9e6..b636b01953f005ff012d5365f00f63a55be8049d 100755 (executable)
@@ -163,7 +163,7 @@ done
   done
 done
 
-runtime="chan.c cpuprof.c env_posix.c lock_futex.c lock_sema.c mcache.c mcentral.c mfixalloc.c mgc0.c mgc0.h mheap.c msize.c netpoll.goc netpoll_epoll.c netpoll_kqueue.c netpoll_stub.c panic.c print.c proc.c race.h runtime.c runtime.h signal_unix.c signal_unix.h malloc.h malloc.goc mprof.goc parfor.c runtime1.goc sema.goc sigqueue.goc string.goc time.goc"
+runtime="chan.goc chan.h cpuprof.goc env_posix.c lock_futex.c lfstack.goc lock_sema.c mcache.c mcentral.c mfixalloc.c mgc0.c mgc0.h mheap.c msize.c netpoll.goc netpoll_epoll.c netpoll_kqueue.c netpoll_stub.c panic.c print.c proc.c race.h rdebug.goc runtime.c runtime.h signal_unix.c signal_unix.h malloc.h malloc.goc mprof.goc parfor.c runtime1.goc sema.goc sigqueue.goc string.goc time.goc"
 for f in $runtime; do
   merge_c $f $f
 done
similarity index 77%
rename from libgo/runtime/chan.c
rename to libgo/runtime/chan.goc
index 2ef78eb3b6fe43ada799cd1de14391ba1effd8d1..ebe0493856f4ef6067d5493ced5dd80af65cad63 100644 (file)
@@ -2,87 +2,16 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+package runtime
 #include "runtime.h"
 #include "arch.h"
 #include "go-type.h"
 #include "race.h"
 #include "malloc.h"
-
-typedef        struct  WaitQ   WaitQ;
-typedef        struct  SudoG   SudoG;
-typedef        struct  Select  Select;
-typedef        struct  Scase   Scase;
-
-typedef struct __go_type_descriptor    Type;
-typedef struct __go_channel_type       ChanType;
-
-struct SudoG
-{
-       G*      g;
-       uint32* selectdone;
-       SudoG*  link;
-       int64   releasetime;
-       byte*   elem;           // data element
-};
-
-struct WaitQ
-{
-       SudoG*  first;
-       SudoG*  last;
-};
-
-// The garbage collector is assuming that Hchan can only contain pointers into the stack
-// and cannot contain pointers into the heap.
-struct Hchan
-{
-       uintgo  qcount;                 // total data in the q
-       uintgo  dataqsiz;               // size of the circular q
-       uint16  elemsize;
-       uint8   elemalign;
-       uint8   pad;                    // ensures proper alignment of the buffer that follows Hchan in memory
-       bool    closed;
-       const Type* elemtype;           // element type
-       uintgo  sendx;                  // send index
-       uintgo  recvx;                  // receive index
-       WaitQ   recvq;                  // list of recv waiters
-       WaitQ   sendq;                  // list of send waiters
-       Lock;
-};
+#include "chan.h"
 
 uint32 runtime_Hchansize = sizeof(Hchan);
 
-// Buffer follows Hchan immediately in memory.
-// chanbuf(c, i) is pointer to the i'th slot in the buffer.
-#define chanbuf(c, i) ((byte*)((c)+1)+(uintptr)(c)->elemsize*(i))
-
-enum
-{
-       debug = 0,
-
-       // Scase.kind
-       CaseRecv,
-       CaseSend,
-       CaseDefault,
-};
-
-struct Scase
-{
-       SudoG   sg;                     // must be first member (cast to Scase)
-       Hchan*  chan;                   // chan
-       uint16  kind;
-       uint16  index;                  // index to return
-       bool*   receivedp;              // pointer to received bool (recv2)
-};
-
-struct Select
-{
-       uint16  tcase;                  // total count of scase[]
-       uint16  ncase;                  // currently filled scase[]
-       uint16* pollorder;              // case poll order
-       Hchan** lockorder;              // channel lock order
-       Scase   scase[1];               // one per case (in order of appearance)
-};
-
 static void    dequeueg(WaitQ*);
 static SudoG*  dequeue(WaitQ*);
 static void    enqueue(WaitQ*, SudoG*);
@@ -120,21 +49,10 @@ makechan(ChanType *t, int64 hint)
        return c;
 }
 
-// For reflect
-//     func makechan(typ *ChanType, size uint64) (chan)
-Hchan *reflect_makechan(ChanType *, uint64)
-  __asm__ (GOSYM_PREFIX "reflect.makechan");
-
-Hchan *
-reflect_makechan(ChanType *t, uint64 size)
-{
-       Hchan *c;
-
+func reflect.makechan(t *ChanType, size uint64) (c *Hchan) {
        c = makechan(t, size);
-       return c;
 }
 
-// makechan(t *ChanType, hint int64) (hchan *chan any);
 Hchan*
 __go_new_channel(ChanType *t, uintptr hint)
 {
@@ -487,8 +405,6 @@ runtime_chanrecv2(ChanType *t, Hchan* c, byte* v)
        return received;
 }
 
-// func selectnbsend(c chan any, elem *any) bool
-//
 // compiler implements
 //
 //     select {
@@ -506,17 +422,10 @@ runtime_chanrecv2(ChanType *t, Hchan* c, byte* v)
 //             ... bar
 //     }
 //
-_Bool
-runtime_selectnbsend(ChanType *t, Hchan *c, byte *val)
-{
-       bool res;
-
-       res = chansend(t, c, val, false, runtime_getcallerpc(&t));
-       return (_Bool)res;
+func selectnbsend(t *ChanType, c *Hchan, elem *byte) (selected bool) {
+       selected = chansend(t, c, elem, false, runtime_getcallerpc(&t));
 }
 
-// func selectnbrecv(elem *any, c chan any) bool
-//
 // compiler implements
 //
 //     select {
@@ -534,17 +443,10 @@ runtime_selectnbsend(ChanType *t, Hchan *c, byte *val)
 //             ... bar
 //     }
 //
-_Bool
-runtime_selectnbrecv(ChanType *t, byte *v, Hchan *c)
-{
-       bool selected;
-
-       selected = chanrecv(t, c, v, false, nil);
-       return (_Bool)selected;
+func selectnbrecv(t *ChanType, elem *byte, c *Hchan) (selected bool) {
+       selected = chanrecv(t, c, elem, false, nil);
 }
 
-// func selectnbrecv2(elem *any, ok *bool, c chan any) bool
-//
 // compiler implements
 //
 //     select {
@@ -562,76 +464,27 @@ runtime_selectnbrecv(ChanType *t, byte *v, Hchan *c)
 //             ... bar
 //     }
 //
-_Bool
-runtime_selectnbrecv2(ChanType *t, byte *v, _Bool *received, Hchan *c)
-{
-       bool selected;
+func selectnbrecv2(t *ChanType, elem *byte, received *bool, c *Hchan) (selected bool) {
        bool r;
 
-       r = false;
-       selected = chanrecv(t, c, v, false, received == nil ? nil : &r);
+       selected = chanrecv(t, c, elem, false, received == nil ? nil : &r);
        if(received != nil)
                *received = r;
-       return selected;
 }
 
-// For reflect:
-//     func chansend(c chan, val *any, nb bool) (selected bool)
-// where val points to the data to be sent.
-//
-// The "uintptr selected" is really "bool selected" but saying
-// uintptr gets us the right alignment for the output parameter block.
-
-_Bool reflect_chansend(ChanType *, Hchan *, byte *, _Bool)
-  __asm__ (GOSYM_PREFIX "reflect.chansend");
-
-_Bool
-reflect_chansend(ChanType *t, Hchan *c, byte *val, _Bool nb)
-{
-       bool selected;
-
-       selected = chansend(t, c, val, !nb, runtime_getcallerpc(&t));
-       return (_Bool)selected;
+func reflect.chansend(t *ChanType, c *Hchan, elem *byte, nb bool) (selected bool) {
+       selected = chansend(t, c, elem, !nb, runtime_getcallerpc(&t));
 }
 
-// For reflect:
-//     func chanrecv(c chan, nb bool, val *any) (selected, received bool)
-// where val points to a data area that will be filled in with the
-// received value.  val must have the size and type of the channel element type.
-
-struct chanrecv_ret
-{
-       _Bool selected;
-       _Bool received;
-};
-
-struct chanrecv_ret reflect_chanrecv(ChanType *, Hchan *, _Bool, byte *val)
-  __asm__ (GOSYM_PREFIX "reflect.chanrecv");
-
-struct chanrecv_ret
-reflect_chanrecv(ChanType *t, Hchan *c, _Bool nb, byte *val)
-{
-       struct chanrecv_ret ret;
-       bool selected;
-       bool received;
-
+func reflect.chanrecv(t *ChanType, c *Hchan, nb bool, elem *byte) (selected bool, received bool) {
        received = false;
-       selected = chanrecv(t, c, val, !nb, &received);
-       ret.selected = (_Bool)selected;
-       ret.received = (_Bool)received;
-       return ret;
+       selected = chanrecv(t, c, elem, !nb, &received);
 }
 
 static Select* newselect(int32);
 
-// newselect(size uint32) (sel *byte);
-
-void* runtime_newselect(int32) __asm__ (GOSYM_PREFIX "runtime.newselect");
-
-void*
-runtime_newselect(int32 size)
-{
-       return (void*)newselect(size);
+func newselect(size int32) (sel *byte) {
+       sel = (byte*)newselect(size);
 }
 
 static Select*
@@ -666,19 +519,10 @@ newselect(int32 size)
 // cut in half to give stack a chance to split
 static void selectsend(Select *sel, Hchan *c, int index, void *elem);
 
-// selectsend(sel *byte, hchan *chan any, elem *any) (selected bool);
-
-void runtime_selectsend(Select *, Hchan *, void *, int32)
-  __asm__ (GOSYM_PREFIX "runtime.selectsend");
-
-void
-runtime_selectsend(Select *sel, Hchan *c, void *elem, int32 index)
-{
+func selectsend(sel *Select, c *Hchan, elem *byte, index int32) {
        // nil cases do not compete
-       if(c == nil)
-               return;
-
-       selectsend(sel, c, index, elem);
+       if(c != nil)
+               selectsend(sel, c, index, elem);
 }
 
 static void
@@ -706,34 +550,16 @@ selectsend(Select *sel, Hchan *c, int index, void *elem)
 // cut in half to give stack a chance to split
 static void selectrecv(Select *sel, Hchan *c, int index, void *elem, bool*);
 
-// selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool);
-
-void runtime_selectrecv(Select *, Hchan *, void *, int32)
-  __asm__ (GOSYM_PREFIX "runtime.selectrecv");
-
-void
-runtime_selectrecv(Select *sel, Hchan *c, void *elem, int32 index)
-{
+func selectrecv(sel *Select, c *Hchan, elem *byte, index int32) {
        // nil cases do not compete
-       if(c == nil)
-               return;
-
-       selectrecv(sel, c, index, elem, nil);
+       if(c != nil)
+               selectrecv(sel, c, index, elem, nil);
 }
 
-// selectrecv2(sel *byte, hchan *chan any, elem *any, received *bool) (selected bool);
-
-void runtime_selectrecv2(Select *, Hchan *, void *, bool *, int32)
-  __asm__ (GOSYM_PREFIX "runtime.selectrecv2");
-
-void
-runtime_selectrecv2(Select *sel, Hchan *c, void *elem, bool *received, int32 index)
-{
+func selectrecv2(sel *Select, c *Hchan, elem *byte, received *bool, index int32) {
        // nil cases do not compete
-       if(c == nil)
-               return;
-
-       selectrecv(sel, c, index, elem, received);
+       if(c != nil)
+               selectrecv(sel, c, index, elem, received);
 }
 
 static void
@@ -762,13 +588,7 @@ selectrecv(Select *sel, Hchan *c, int index, void *elem, bool *received)
 // cut in half to give stack a chance to split
 static void selectdefault(Select*, int);
 
-// selectdefault(sel *byte) (selected bool);
-
-void runtime_selectdefault(Select *, int32) __asm__ (GOSYM_PREFIX "runtime.selectdefault");
-
-void
-runtime_selectdefault(Select *sel, int32 index)
-{
+func selectdefault(sel *Select, index int32) {
        selectdefault(sel, index);
 }
 
@@ -844,9 +664,7 @@ selparkcommit(G *gp, void *sel)
        return true;
 }
 
-void
-runtime_block(void)
-{
+func block() {
        runtime_park(nil, nil, "select (no cases)");    // forever
 }
 
@@ -854,11 +672,7 @@ static int selectgo(Select**);
 
 // selectgo(sel *byte);
 
-int runtime_selectgo(Select *) __asm__ (GOSYM_PREFIX "runtime.selectgo");
-
-int
-runtime_selectgo(Select *sel)
-{
+func selectgo(sel *Select) (ret int32) {
        return selectgo(&sel);
 }
 
@@ -1196,22 +1010,7 @@ enum SelectDir {
        SelectDefault,
 };
 
-// func rselect(cases []runtimeSelect) (chosen int, recvOK bool)
-
-struct rselect_ret {
-       intgo chosen;
-       _Bool recvOK;
-};
-
-struct rselect_ret reflect_rselect(Slice)
-     __asm__ (GOSYM_PREFIX "reflect.rselect");
-
-struct rselect_ret
-reflect_rselect(Slice cases)
-{
-       struct rselect_ret ret;
-       intgo chosen;
-       bool recvOK;
+func reflect.rselect(cases Slice) (chosen int, recvOK bool) {
        int32 i;
        Select *sel;
        runtimeSelect* rcase, *rc;
@@ -1242,29 +1041,15 @@ reflect_rselect(Slice cases)
        }
 
        chosen = (intgo)(uintptr)selectgo(&sel);
-
-       ret.chosen = chosen;
-       ret.recvOK = (_Bool)recvOK;
-       return ret;
 }
 
 static void closechan(Hchan *c, void *pc);
 
-// closechan(sel *byte);
-void
-runtime_closechan(Hchan *c)
-{
+func closechan(c *Hchan) {
        closechan(c, runtime_getcallerpc(&c));
 }
 
-// For reflect
-//     func chanclose(c chan)
-
-void reflect_chanclose(Hchan *) __asm__ (GOSYM_PREFIX "reflect.chanclose");
-
-void
-reflect_chanclose(Hchan *c)
-{
+func reflect.chanclose(c *Hchan) {
        closechan(c, runtime_getcallerpc(&c));
 }
 
@@ -1326,21 +1111,11 @@ __go_builtin_close(Hchan *c)
        runtime_closechan(c);
 }
 
-// For reflect
-//     func chanlen(c chan) (len int)
-
-intgo reflect_chanlen(Hchan *) __asm__ (GOSYM_PREFIX "reflect.chanlen");
-
-intgo
-reflect_chanlen(Hchan *c)
-{
-       intgo len;
-
+func reflect.chanlen(c *Hchan) (len int) {
        if(c == nil)
                len = 0;
        else
                len = c->qcount;
-       return len;
 }
 
 intgo
@@ -1349,21 +1124,11 @@ __go_chan_len(Hchan *c)
        return reflect_chanlen(c);
 }
 
-// For reflect
-//     func chancap(c chan) int
-
-intgo reflect_chancap(Hchan *) __asm__ (GOSYM_PREFIX "reflect.chancap");
-
-intgo
-reflect_chancap(Hchan *c)
-{
-       intgo cap;
-
+func reflect.chancap(c *Hchan) (cap int) {
        if(c == nil)
                cap = 0;
        else
                cap = c->dataqsiz;
-       return cap;
 }
 
 intgo
diff --git a/libgo/runtime/chan.h b/libgo/runtime/chan.h
new file mode 100644 (file)
index 0000000..70b0b9d
--- /dev/null
@@ -0,0 +1,75 @@
+// Copyright 2009 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.
+
+typedef        struct  WaitQ   WaitQ;
+typedef        struct  SudoG   SudoG;
+typedef        struct  Select  Select;
+typedef        struct  Scase   Scase;
+
+typedef struct __go_type_descriptor    Type;
+typedef struct __go_channel_type       ChanType;
+
+struct SudoG
+{
+       G*      g;
+       uint32* selectdone;
+       SudoG*  link;
+       int64   releasetime;
+       byte*   elem;           // data element
+};
+
+struct WaitQ
+{
+       SudoG*  first;
+       SudoG*  last;
+};
+
+// The garbage collector is assuming that Hchan can only contain pointers into the stack
+// and cannot contain pointers into the heap.
+struct Hchan
+{
+       uintgo  qcount;                 // total data in the q
+       uintgo  dataqsiz;               // size of the circular q
+       uint16  elemsize;
+       uint16  pad;                    // ensures proper alignment of the buffer that follows Hchan in memory
+       bool    closed;
+       const Type* elemtype;           // element type
+       uintgo  sendx;                  // send index
+       uintgo  recvx;                  // receive index
+       WaitQ   recvq;                  // list of recv waiters
+       WaitQ   sendq;                  // list of send waiters
+       Lock;
+};
+
+// Buffer follows Hchan immediately in memory.
+// chanbuf(c, i) is pointer to the i'th slot in the buffer.
+#define chanbuf(c, i) ((byte*)((c)+1)+(uintptr)(c)->elemsize*(i))
+
+enum
+{
+       debug = 0,
+
+       // Scase.kind
+       CaseRecv,
+       CaseSend,
+       CaseDefault,
+};
+
+struct Scase
+{
+       SudoG   sg;                     // must be first member (cast to Scase)
+       Hchan*  chan;                   // chan
+       uint16  kind;
+       uint16  index;                  // index to return
+       bool*   receivedp;              // pointer to received bool (recv2)
+};
+
+struct Select
+{
+       uint16  tcase;                  // total count of scase[]
+       uint16  ncase;                  // currently filled scase[]
+       uint16* pollorder;              // case poll order
+       Hchan** lockorder;              // channel lock order
+       Scase   scase[1];               // one per case (in order of appearance)
+};
similarity index 98%
rename from libgo/runtime/cpuprof.c
rename to libgo/runtime/cpuprof.goc
index a07029c4c4f00070cfa24a7295db2efefa4ffe1d..28ae9bbfa184707041ed2497d7d07f6a8da46f34 100644 (file)
@@ -48,6 +48,7 @@
 // in order to let the log closer set the high bit to indicate "EOF" safely
 // in the situation when normally the goroutine "owns" handoff.
 
+package runtime
 #include "runtime.h"
 #include "arch.h"
 #include "malloc.h"
@@ -435,13 +436,8 @@ breakflush:
        return ret;  // set to nil at top of function
 }
 
-extern Slice runtime_CPUProfile(void)
-     __asm__ (GOSYM_PREFIX "runtime.CPUProfile");
-
 // CPUProfile returns the next cpu profile block as a []byte.
 // The user documentation is in debug.go.
-Slice
-runtime_CPUProfile(void)
-{
-       return getprofile(prof);
+func CPUProfile() (ret Slice) {
+       ret = getprofile(prof);
 }
index 9ba1ea7d042e11ec3303dd6b3c82d1432b248736..2b7baa4df9c1c0a6013227d06674646adbcaf185 100644 (file)
@@ -177,19 +177,3 @@ _cgo_panic (const char *p)
 
   __go_panic (e);
 }
-
-/* Return the number of CGO calls.  */
-
-int64 runtime_NumCgoCall (void) __asm__ (GOSYM_PREFIX "runtime.NumCgoCall");
-
-int64
-runtime_NumCgoCall (void)
-{
-  int64 ret;
-  M* m;
-
-  ret = 0;
-  for (m = runtime_atomicloadp (&runtime_allm); m != NULL; m = m->alllink)
-    ret += m->ncgocall;
-  return ret;
-}
diff --git a/libgo/runtime/go-getgoroot.c b/libgo/runtime/go-getgoroot.c
deleted file mode 100644 (file)
index 1b52d44..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* go-getgoroot.c -- getgoroot function for runtime package.
-
-   Copyright 2010 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.  */
-
-#include <stdlib.h>
-
-#include "runtime.h"
-
-String getgoroot (void) __asm__ (GOSYM_PREFIX "runtime.getgoroot");
-
-String
-getgoroot ()
-{
-  const char *p;
-  String ret;
-
-  p = getenv ("GOROOT");
-  ret.str = (const byte *) p;
-  if (ret.str == NULL)
-    ret.len = 0;
-  else
-    ret.len = __builtin_strlen (p);
-  return ret;
-}
diff --git a/libgo/runtime/go-typestring.c b/libgo/runtime/go-typestring.c
deleted file mode 100644 (file)
index 0a90e84..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* go-typestring.c -- the runtime.typestring function.
-
-   Copyright 2010 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.  */
-
-#include "runtime.h"
-#include "interface.h"
-#include "go-type.h"
-
-String typestring(struct __go_empty_interface) __asm__ (GOSYM_PREFIX "runtime.typestring");
-
-String
-typestring (struct __go_empty_interface e)
-{
-  return *e.__type_descriptor->__reflection;
-}
index 87db58f50e533decb04fb8d317c3c143ed917882..68281c36bca4ad453400c6ac092fb60c581a5898 100644 (file)
@@ -617,9 +617,22 @@ process_file(void)
        package = read_package();
        read_preprocessor_lines();
        while (read_func_header(&name, &params, &rets)) {
-               write_func_header(package, name, params, rets);
+               char *p;
+               char *pkg;
+               char *nm;
+
+               p = strchr(name, '.');
+               if (p == NULL) {
+                       pkg = package;
+                       nm = name;
+               } else {
+                       pkg = name;
+                       nm = p + 1;
+                       *p = '\0';
+               }
+               write_func_header(pkg, nm, params, rets);
                copy_body();
-               write_func_trailer(package, name, rets);
+               write_func_trailer(pkg, nm, rets);
                free(name);
                free_params(params);
                free_params(rets);
similarity index 90%
rename from libgo/runtime/lfstack.c
rename to libgo/runtime/lfstack.goc
index 132783c3644639088ec8fe633184a46e0716a289..060a0cc5941be71d295c8fc7ba39e407618fa6fa 100644 (file)
@@ -4,6 +4,7 @@
 
 // Lock-free stack.
 
+package runtime
 #include "runtime.h"
 #include "arch.h"
 
@@ -69,11 +70,10 @@ runtime_lfstackpop(uint64 *head)
        }
 }
 
-LFNode* runtime_lfstackpop2(uint64*)
-  __asm__ (GOSYM_PREFIX "runtime.lfstackpop2");
+func lfstackpush_go(head *uint64, node *LFNode) {
+       runtime_lfstackpush(head, node);
+}
 
-LFNode*
-runtime_lfstackpop2(uint64 *head)
-{
-       return runtime_lfstackpop(head);
+func lfstackpop_go(head *uint64) (node *LFNode) {
+       node = runtime_lfstackpop(head);
 }
index 798d875b9bc98877aa8e888b4fbb9f516a906058..9c8b8c1c74cd7a2cf7525f10306ce0ea1455089c 100644 (file)
@@ -905,10 +905,8 @@ runtime_mal(uintptr n)
        return runtime_mallocgc(n, 0, 0);
 }
 
-void *
-runtime_new(const Type *typ)
-{
-       return runtime_mallocgc(typ->__size, (uintptr)typ | TypeInfo_SingleObject, typ->kind&KindNoPointers ? FlagNoScan : 0);
+func new(typ *Type) (ret *uint8) {
+       ret = runtime_mallocgc(typ->__size, (uintptr)typ | TypeInfo_SingleObject, typ->kind&KindNoPointers ? FlagNoScan : 0);
 }
 
 static void*
index b5dc5a43aba3077af1d4121c9a4cabc8f54fb1bc..30fbb64c27523d85cf9c2990012c903dbf95962d 100644 (file)
@@ -586,6 +586,7 @@ void        runtime_gc_m_ptr(Eface*);
 void   runtime_gc_itab_ptr(Eface*);
 
 void   runtime_memorydump(void);
+int32  runtime_setgcpercent(int32);
 
 void   runtime_proc_scan(struct Workbuf**, void (*)(struct Workbuf**, Obj));
 void   runtime_time_scan(struct Workbuf**, void (*)(struct Workbuf**, Obj));
index 10dd412eea6d94a4de4c2c211427aefeafaabf91..e67c5b983fb9b6ace32858ce121df43892603bc3 100644 (file)
@@ -1174,6 +1174,7 @@ scanblock(Workbuf *wbuf, bool keepworking)
 #endif
 
                default:
+                       runtime_printf("runtime: invalid GC instruction %p at %p\n", pc[0], pc);
                        runtime_throw("scanblock: invalid GC instruction");
                        return;
                }
@@ -2449,13 +2450,9 @@ runtime_debug_readGCStats(Slice *pauses)
        pauses->__count = n+3;
 }
 
-intgo runtime_debug_setGCPercent(intgo)
-  __asm__("runtime_debug.setGCPercent");
-
-intgo
-runtime_debug_setGCPercent(intgo in)
-{
-       intgo out;
+int32
+runtime_setgcpercent(int32 in) {
+       int32 out;
 
        runtime_lock(&runtime_mheap);
        if(gcpercent == GcpercentUnknown)
index 9489d8dc2ec98eafee14c3ecc0ae37c426d44a57..386faea512cfbec0c6189bc202d246be94b943fe 100644 (file)
@@ -33,18 +33,6 @@ runtime_parforalloc(uint32 nthrmax)
        return desc;
 }
 
-// For testing from Go
-// func parforalloc2(nthrmax uint32) *ParFor
-
-ParFor *runtime_parforalloc2(uint32)
-   __asm__ (GOSYM_PREFIX "runtime.parforalloc2");
-
-ParFor *
-runtime_parforalloc2(uint32 nthrmax)
-{
-       return runtime_parforalloc(nthrmax);
-}
-
 void
 runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void (*body)(ParFor*, uint32))
 {
@@ -78,18 +66,6 @@ runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, v
        }
 }
 
-// For testing from Go
-// func parforsetup2(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*ParFor, uint32))
-
-void runtime_parforsetup2(ParFor *, uint32, uint32, void *, bool, void *)
-  __asm__ (GOSYM_PREFIX "runtime.parforsetup2");
-
-void
-runtime_parforsetup2(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void *body)
-{
-       runtime_parforsetup(desc, nthr, n, ctx, wait, *(void(**)(ParFor*, uint32))body);
-}
-
 void
 runtime_parfordo(ParFor *desc)
 {
@@ -214,23 +190,10 @@ exit:
        me->nsleep = 0;
 }
 
-// For testing from Go
-// func parforiters(desc *ParFor, tid uintptr) (uintptr, uintptr)
-
-struct parforiters_ret {
-  uintptr start;
-  uintptr end;
-};
-
-struct parforiters_ret runtime_parforiters(ParFor *, uintptr)
-  __asm__ (GOSYM_PREFIX "runtime.parforiters");
-
-struct parforiters_ret
-runtime_parforiters(ParFor *desc, uintptr tid)
+// For testing from Go.
+void
+runtime_parforiters(ParFor *desc, uintptr tid, uintptr *start, uintptr *end)
 {
-       struct parforiters_ret ret;
-
-       ret.start = (uint32)desc->thr[tid].pos;
-       ret.end = (uint32)(desc->thr[tid].pos>>32);
-       return ret;
+       *start = (uint32)desc->thr[tid].pos;
+       *end = (uint32)(desc->thr[tid].pos>>32);
 }
index d00b63809a8902daa99a3e8b7b7084496791f975..f602e9a671662e6e12b5540c812260a784d98bb0 100644 (file)
@@ -320,7 +320,7 @@ runtime_printhex(uint64 v)
 void
 runtime_printpointer(void *p)
 {
-       runtime_printhex((uint64)(uintptr)p);
+       runtime_printhex((uintptr)p);
 }
 
 void
index d21308447171ad0b96eed2fe406a3ad7d6dff44f..8e32f78a2a202468ef4b927b258b9a154fca83d0 100644 (file)
@@ -2456,26 +2456,6 @@ runtime_lockedOSThread(void)
        return g->lockedm != nil && m->lockedg != nil;
 }
 
-// for testing of callbacks
-
-_Bool runtime_golockedOSThread(void)
-  __asm__ (GOSYM_PREFIX "runtime.golockedOSThread");
-
-_Bool
-runtime_golockedOSThread(void)
-{
-       return runtime_lockedOSThread();
-}
-
-intgo runtime_NumGoroutine (void)
-  __asm__ (GOSYM_PREFIX "runtime.NumGoroutine");
-
-intgo
-runtime_NumGoroutine()
-{
-       return runtime_gcount();
-}
-
 int32
 runtime_gcount(void)
 {
@@ -3321,13 +3301,10 @@ runtime_testSchedLocalQueueSteal(void)
        }
 }
 
-intgo runtime_debug_setMaxThreads(intgo)
-     __asm__(GOSYM_PREFIX "runtime_debug.setMaxThreads");
-
-intgo
-runtime_debug_setMaxThreads(intgo in)
+int32
+runtime_setmaxthreads(int32 in)
 {
-       intgo out;
+       int32 out;
 
        runtime_lock(&runtime_sched);
        out = runtime_sched.maxmcount;
@@ -3370,30 +3347,3 @@ runtime_gcwaiting(void)
 {
        return runtime_sched.gcwaiting;
 }
-
-// func runtime_procPin() int
-
-intgo sync_runtime_procPin(void)
-  __asm__(GOSYM_PREFIX "sync.runtime_procPin");
-
-intgo
-sync_runtime_procPin()
-{
-       M *mp;
-
-       mp = m;
-       // Disable preemption.
-       mp->locks++;
-       return mp->p->id;
-}
-
-// func runtime_procUnpin()
-
-void sync_runtime_procUnpin(void)
-  __asm__ (GOSYM_PREFIX "sync.runtime_procUnpin");
-
-void
-sync_runtime_procUnpin(void)
-{
-       m->locks--;
-}
diff --git a/libgo/runtime/rdebug.goc b/libgo/runtime/rdebug.goc
new file mode 100644 (file)
index 0000000..230e8fa
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2013 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_debug
+#include "runtime.h"
+#include "arch.h"
+#include "malloc.h"
+
+func setMaxStack(in int) (out int) {
+       out = runtime_maxstacksize;
+       runtime_maxstacksize = in;
+}
+
+func setGCPercent(in int) (out int) {
+       out = runtime_setgcpercent(in);
+}
+
+func setMaxThreads(in int) (out int) {
+       out = runtime_setmaxthreads(in);
+}
index eb32a8d7fe89132d33f20f872898fae97600d591..1678a45d40a5ba38eb1af7f6a085c6970c2eb296 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "runtime.h"
 #include "array.h"
-#include "go-panic.h"
 
 // The GOTRACEBACK environment variable controls the
 // behavior of a Go program that is crashing and exiting.
@@ -221,15 +220,6 @@ runtime_tickspersecond(void)
        return res;
 }
 
-int64 runtime_pprof_runtime_cyclesPerSecond(void)
-     __asm__ (GOSYM_PREFIX "runtime_pprof.runtime_cyclesPerSecond");
-
-int64
-runtime_pprof_runtime_cyclesPerSecond(void)
-{
-       return runtime_tickspersecond();
-}
-
 // Called to initialize a new m (including the bootstrap m).
 // Called on the parent thread (main thread in case of bootstrap), can allocate memory.
 void
@@ -341,19 +331,6 @@ runtime_timediv(int64 v, int32 div, int32 *rem)
 
 uintptr runtime_maxstacksize = 1<<20; // enough until runtime.main sets it for real
 
-intgo runtime_debug_setMaxStack(intgo)
-       __asm__ (GOSYM_PREFIX "runtime_debug.setMaxStack");
-
-intgo
-runtime_debug_setMaxStack(intgo in)
-{
-       intgo out;
-
-       out = runtime_maxstacksize;
-       runtime_maxstacksize = in;
-       return out;
-}
-
 void memclrBytes(Slice)
      __asm__ (GOSYM_PREFIX "runtime.memclrBytes");
 
index 9d5e42f50dc66626034f738724c7a12862d9ccf4..6bd53a852b40709d58cca59fbd94cb72b7a326ae 100644 (file)
@@ -455,7 +455,7 @@ extern bool runtime_precisestack;
 #define        nelem(x)        (sizeof(x)/sizeof((x)[0]))
 #define        nil             ((void*)0)
 #define USED(v)                ((void) v)
-#define        ROUND(x, n)     (((x)+(n)-1)&~((n)-1)) /* all-caps to mark as macro: it evaluates n twice */
+#define        ROUND(x, n)     (((x)+(n)-1)&~(uintptr)((n)-1)) /* all-caps to mark as macro: it evaluates n twice */
 
 byte*  runtime_startup_random_data;
 uint32 runtime_startup_random_data_len;
@@ -491,6 +491,7 @@ extern      int8*   runtime_goos;
 extern int32   runtime_ncpu;
 extern         void    (*runtime_sysargs)(int32, uint8**);
 extern DebugVars       runtime_debug;
+extern uintptr runtime_maxstacksize;
 
 /*
  * common functions and data
@@ -501,9 +502,6 @@ intgo       runtime_findnull(const byte*);
 intgo  runtime_findnullw(const uint16*);
 void   runtime_dump(byte*, int32);
 
-/*
- * very low level c-called
- */
 void   runtime_gogo(G*);
 struct __go_func_type;
 void   runtime_args(int32, byte**);
@@ -618,6 +616,7 @@ void        runtime_crash(void);
 void   runtime_parsedebugvars(void);
 void   _rt0_go(void);
 void*  runtime_funcdata(Func*, int32);
+int32  runtime_setmaxthreads(int32);
 
 void   runtime_stoptheworld(void);
 void   runtime_starttheworld(void);
@@ -690,7 +689,8 @@ LFNode*     runtime_lfstackpop(uint64 *head);
  */
 ParFor*        runtime_parforalloc(uint32 nthrmax);
 void   runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void (*body)(ParFor*, uint32));
-void   runtime_parfordo(ParFor *desc) __asm__ (GOSYM_PREFIX "runtime.parfordo");
+void   runtime_parfordo(ParFor *desc);
+void   runtime_parforiters(ParFor*, uintptr, uintptr*, uintptr*);
 
 /*
  * low level C-called
@@ -762,6 +762,7 @@ void        runtime_procyield(uint32);
 void   runtime_osyield(void);
 void   runtime_lockOSThread(void);
 void   runtime_unlockOSThread(void);
+bool   runtime_lockedOSThread(void);
 
 bool   runtime_showframe(String, bool);
 void   runtime_printcreatedby(G*);
index 9ce83000b83388fadda64f298d5bab8ffb400847..e643965fda50086fb913a1067be53e0de4a54c18 100644 (file)
@@ -4,6 +4,8 @@
 
 package runtime
 #include "runtime.h"
+#include "arch.h"
+#include "go-type.h"
 
 func GOMAXPROCS(n int) (ret int) {
        ret = runtime_gomaxprocsfunc(n);
@@ -12,3 +14,63 @@ func GOMAXPROCS(n int) (ret int) {
 func NumCPU() (ret int) {
        ret = runtime_ncpu;
 }
+
+func NumCgoCall() (ret int64) {
+       M *mp;
+
+       ret = 0;
+       for(mp=runtime_atomicloadp(&runtime_allm); mp; mp=mp->alllink)
+               ret += mp->ncgocall;
+}
+
+func newParFor(nthrmax uint32) (desc *ParFor) {
+       desc = runtime_parforalloc(nthrmax);
+}
+
+func parForSetup(desc *ParFor, nthr uint32, n uint32, ctx *byte, wait bool, body *byte) {
+       runtime_parforsetup(desc, nthr, n, ctx, wait, *(void(**)(ParFor*, uint32))body);
+}
+
+func parForDo(desc *ParFor) {
+       runtime_parfordo(desc);
+}
+
+func parForIters(desc *ParFor, tid uintptr) (start uintptr, end uintptr) {
+       runtime_parforiters(desc, tid, &start, &end);
+}
+
+func typestring(e Eface) (s String) {
+       s = *e.__type_descriptor->__reflection;
+}
+
+func golockedOSThread() (ret bool) {
+       ret = runtime_lockedOSThread();
+}
+
+func NumGoroutine() (ret int) {
+       ret = runtime_gcount();
+}
+
+func getgoroot() (out String) {
+       const byte *p;
+
+       p = runtime_getenv("GOROOT");
+       out = runtime_gostringnocopy(p);
+}
+
+func runtime_pprof.runtime_cyclesPerSecond() (res int64) {
+       res = runtime_tickspersecond();
+}
+
+func sync.runtime_procPin() (p int) {
+       M *mp;
+
+       mp = runtime_m();
+       // Disable preemption.
+       mp->locks++;
+       p = mp->p->id;
+}
+
+func sync.runtime_procUnpin() {
+       runtime_m()->locks--;
+}
index a0e80ccf45b4af10c75548adc87072b73f566b8b..f656318d15cb6dbfa98c08e25cc121dbd9c558cc 100644 (file)
@@ -73,13 +73,8 @@ runtime_gostringnocopy(const byte *str)
        return s;
 }
 
-String runtime_cstringToGo(byte*)
-  __asm__ (GOSYM_PREFIX "runtime.cstringToGo");
-
-String
-runtime_cstringToGo(byte *str)
-{
-       return runtime_gostringnocopy(str);
+func cstringToGo(str *byte) (s String) {
+       s = runtime_gostringnocopy(str);
 }
 
 enum