]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
9 years ago[dev.garbage] all: merge dev.cc into dev.garbage
Russ Cox [Sat, 15 Nov 2014 13:00:38 +0000 (08:00 -0500)]
[dev.garbage] all: merge dev.cc into dev.garbage

The garbage collector is now written in Go.
There is plenty to clean up (just like on dev.cc).

all.bash passes on darwin/amd64, darwin/386, linux/amd64, linux/386.

TBR=rlh
R=austin, rlh, bradfitz
CC=golang-codereviews
https://golang.org/cl/173250043

9 years ago[dev.cc] runtime: fix lfstack for amd64 addresses in top half of addr space
Russ Cox [Fri, 14 Nov 2014 17:55:23 +0000 (12:55 -0500)]
[dev.cc] runtime: fix lfstack for amd64 addresses in top half of addr space

While we are here, add the linux/power64 version.

LGTM=austin
R=austin
CC=aram, dvyukov, golang-codereviews
https://golang.org/cl/177750043

9 years ago[dev.cc] runtime: fix linux build
Russ Cox [Fri, 14 Nov 2014 17:55:10 +0000 (12:55 -0500)]
[dev.cc] runtime: fix linux build

TBR=austin
CC=golang-codereviews
https://golang.org/cl/176760044

9 years ago[dev.cc] runtime: convert dragonfly/amd64 port to Go
Joel Sing [Fri, 14 Nov 2014 17:47:20 +0000 (04:47 +1100)]
[dev.cc] runtime: convert dragonfly/amd64 port to Go

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/176750043

9 years ago[dev.cc] all: merge dev.power64 (7667e41f3ced) into dev.cc
Russ Cox [Fri, 14 Nov 2014 17:10:52 +0000 (12:10 -0500)]
[dev.cc] all: merge dev.power64 (7667e41f3ced) into dev.cc

This is to reduce the delta between dev.cc and dev.garbage to just garbage collector changes.

These are the files that had merge conflicts and have been edited by hand:
        malloc.go
        mem_linux.go
        mgc.go
        os1_linux.go
        proc1.go
        panic1.go
        runtime1.go

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/174180043

9 years ago[dev.garbage] all: merge dev.power64 (7667e41f3ced) into dev.garbage
Russ Cox [Fri, 14 Nov 2014 17:09:42 +0000 (12:09 -0500)]
[dev.garbage] all: merge dev.power64 (7667e41f3ced) into dev.garbage

Now the only difference between dev.cc and dev.garbage
is the runtime conversion on the one side and the
garbage collection on the other. They both have the
same set of changes from default and dev.power64.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/172570043

9 years ago[dev.cc] runtime: convert openbsd/386 port to Go
Joel Sing [Fri, 14 Nov 2014 16:55:14 +0000 (03:55 +1100)]
[dev.cc] runtime: convert openbsd/386 port to Go

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/173200044

9 years ago[dev.garbage] all: merge default (f38460037b72) into dev.garbage
Russ Cox [Fri, 14 Nov 2014 16:37:54 +0000 (11:37 -0500)]
[dev.garbage] all: merge default (f38460037b72) into dev.garbage

This is the revision that dev.cc is branched from.

LGTM=austin
R=austin
CC=golang-codereviews
https://golang.org/cl/169590043

9 years ago[dev.cc] runtime: fix nil pointer crash handler bug on Solaris
Aram Hăvărneanu [Fri, 14 Nov 2014 13:25:49 +0000 (14:25 +0100)]
[dev.cc] runtime: fix nil pointer crash handler bug on Solaris

This change fixes the Solaris port.

LGTM=dave, rsc
R=rsc, dave
CC=brad, golang-codereviews
https://golang.org/cl/168600045

9 years ago[dev.cc] runtime: convert netpoll_windows.c to Go
Alex Brainman [Fri, 14 Nov 2014 03:07:28 +0000 (14:07 +1100)]
[dev.cc] runtime: convert netpoll_windows.c to Go

LGTM=rsc
R=rsc
CC=dvyukov, golang-codereviews
https://golang.org/cl/172530043

9 years ago[dev.cc] runtime: convert openbsd/amd64 port to Go
Joel Sing [Fri, 14 Nov 2014 02:01:12 +0000 (13:01 +1100)]
[dev.cc] runtime: convert openbsd/amd64 port to Go

LGTM=rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/171660043

9 years ago[dev.power64] 9g: implement regopt
Austin Clements [Thu, 13 Nov 2014 18:51:44 +0000 (13:51 -0500)]
[dev.power64] 9g: implement regopt

This adds registerization support to 9g equivalent to what the
other compilers have.

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/174980043

9 years ago[dev.power64] 9l: remove enum as's tag for c2go
Austin Clements [Thu, 13 Nov 2014 18:48:59 +0000 (13:48 -0500)]
[dev.power64] 9l: remove enum as's tag for c2go

None of the other compilers have a tag for this enum.
Cleaning all of this up to use proper types will happen after
the conversion.

LGTM=minux, rsc
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/166690043

9 years ago[dev.power64] 6g,8g: remove unnecessary and incorrect reg use scanning
Austin Clements [Thu, 13 Nov 2014 18:34:20 +0000 (13:34 -0500)]
[dev.power64] 6g,8g: remove unnecessary and incorrect reg use scanning

Previously, the 6g and 8g registerizers scanned for used
registers beyond the end of a region being considered for
registerization.  This ancient artifact was copied from the C
compilers, where it was probably necessary to track implicitly
used registers.  In the Go compilers it's harmless (because it
can only over-restrict the set of available registers), but no
longer necessary because the Go compilers correctly track
register use/set information.  The consequences of this extra
scan were (at least) that 1) we would not consider allocating
the AX register if there was a deferproc call in the future
because deferproc uses AX as a return register, so we see the
use of AX, but don't track that AX is set by the CALL, and 2)
we could not consider allocating the DX register if there was
a MUL in the future because MUL implicitly sets DX and (thanks
to an abuse of copyu in this code) we would also consider DX
used.

This commit fixes these problems by nuking this code.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/174110043

9 years ago[dev.cc] runtime: make SIGSYS notifiable on freebsd (again)
Joel Sing [Thu, 13 Nov 2014 17:29:03 +0000 (04:29 +1100)]
[dev.cc] runtime: make SIGSYS notifiable on freebsd (again)

This was originally done to the C port in rev 17d3b45534b5 and
seemingly got lost during the conversion.

LGTM=bradfitz
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/167700043

9 years ago[dev.cc] runtime: convert Solaris port to Go
Aram Hăvărneanu [Thu, 13 Nov 2014 15:07:10 +0000 (16:07 +0100)]
[dev.cc] runtime: convert Solaris port to Go

Memory management was consolitated with the BSD ports, since
it was almost identical.

Assembly thunks are gone, being replaced by the new //go:linkname
feature.

This change supersedes CL 138390043 (runtime: convert solaris
netpoll to Go), which was previously reviewed and tested.

This change is only the first step, the port now builds,
but doesn't run. Binaries fail to exec:

    ld.so.1: 6.out: fatal: 6.out: TLS requirement failure : TLS support is unavailable
    Killed

This seems to happen because binaries don't link with libc.so
anymore. We will have to solve that in a different CL.

Also this change is just a rough translation of the original
C code, cleanup will come in a different CL.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=rsc
R=rsc, dave
CC=golang-codereviews, iant, khr, minux, r, rlh
https://golang.org/cl/174960043

9 years ago[dev.cc] runtime: convert mem_windows.c to Go
Alex Brainman [Thu, 13 Nov 2014 03:53:13 +0000 (14:53 +1100)]
[dev.cc] runtime: convert mem_windows.c to Go

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/175000043

9 years ago[dev.cc] runtime: add missing cb_max const
Alex Brainman [Thu, 13 Nov 2014 01:05:36 +0000 (12:05 +1100)]
[dev.cc] runtime: add missing cb_max const

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169490043

9 years ago[dev.power64] liblink: improve documentation of struct Prog
Austin Clements [Wed, 12 Nov 2014 22:19:02 +0000 (17:19 -0500)]
[dev.power64] liblink: improve documentation of struct Prog

LGTM=dave, rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/169460043

9 years ago[dev.cc] [dev.cc] runtime: fix freebsd cgo __progname export
Joel Sing [Wed, 12 Nov 2014 22:18:22 +0000 (17:18 -0500)]
[dev.cc] [dev.cc] runtime: fix freebsd cgo __progname export

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/174050043

9 years ago[dev.power64] 9g: proginfo fixes
Austin Clements [Wed, 12 Nov 2014 19:58:43 +0000 (14:58 -0500)]
[dev.power64] 9g: proginfo fixes

For D_OREG addresses, store the used registers in regindex
instead of reguse because they're really part of addressing.

Add implicit register use/set for DUFFZERO/DUFFCOPY.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/174050044

9 years ago[dev.cc] runtime: delete scalararg, ptrarg; rename onM to systemstack
Russ Cox [Wed, 12 Nov 2014 19:54:31 +0000 (14:54 -0500)]
[dev.cc] runtime: delete scalararg, ptrarg; rename onM to systemstack

Scalararg and ptrarg are not "signal safe".
Go code filling them out can be interrupted by a signal,
and then the signal handler runs, and if it also ends up
in Go code that uses scalararg or ptrarg, now the old
values have been smashed.
For the pieces of code that do need to run in a signal handler,
we introduced onM_signalok, which is really just onM
except that the _signalok is meant to convey that the caller
asserts that scalarg and ptrarg will be restored to their old
values after the call (instead of the usual behavior, zeroing them).

Scalararg and ptrarg are also untyped and therefore error-prone.

Go code can always pass a closure instead of using scalararg
and ptrarg; they were only really necessary for C code.
And there's no more C code.

For all these reasons, delete scalararg and ptrarg, converting
the few remaining references to use closures.

Once those are gone, there is no need for a distinction between
onM and onM_signalok, so replace both with a single function
equivalent to the current onM_signalok (that is, it can be called
on any of the curg, g0, and gsignal stacks).

The name onM and the phrase 'm stack' are misnomers,
because on most system an M has two system stacks:
the main thread stack and the signal handling stack.

Correct the misnomer by naming the replacement function systemstack.

Fix a few references to "M stack" in code.

The main motivation for this change is to eliminate scalararg/ptrarg.
Rick and I have already seen them cause problems because
the calling sequence m.ptrarg[0] = p is a heap pointer assignment,
so it gets a write barrier. The write barrier also uses onM, so it has
all the same problems as if it were being invoked by a signal handler.
We worked around this by saving and restoring the old values
and by calling onM_signalok, but there's no point in keeping this nice
home for bugs around any longer.

This CL also changes funcline to return the file name as a result
instead of filling in a passed-in *string. (The *string signature is
left over from when the code was written in and called from C.)
That's arguably an unrelated change, except that once I had done
the ptrarg/scalararg/onM cleanup I started getting false positives
about the *string argument escaping (not allowed in package runtime).
The compiler is wrong, but the easiest fix is to write the code like
Go code instead of like C code. I am a bit worried that the compiler
is wrong because of some use of uninitialized memory in the escape
analysis. If that's the reason, it will go away when we convert the
compiler to Go. (And if not, we'll debug it the next time.)

LGTM=khr
R=r, khr
CC=austin, golang-codereviews, iant, rlh
https://golang.org/cl/174950043

9 years ago[dev.cc] runtime/cgo: add comment about import _ "unsafe"
Russ Cox [Wed, 12 Nov 2014 19:54:04 +0000 (14:54 -0500)]
[dev.cc] runtime/cgo: add comment about import _ "unsafe"

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/167650043

9 years ago[dev.garbage] runtime: Add write barriers to c code
Rick Hudson [Wed, 12 Nov 2014 19:20:53 +0000 (14:20 -0500)]
[dev.garbage] runtime: Add write barriers to c code
Also improve missing GC mark diagnostics.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169450043

9 years ago[dev.power64] 9g: fix width check and width calculation for OADDR
Austin Clements [Wed, 12 Nov 2014 19:16:49 +0000 (14:16 -0500)]
[dev.power64] 9g: fix width check and width calculation for OADDR

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/174970043

9 years ago[dev.cc] runtime/cgo: fix freebsd build?
Russ Cox [Wed, 12 Nov 2014 04:28:26 +0000 (23:28 -0500)]
[dev.cc] runtime/cgo: fix freebsd build?

Last try and then someone with a FreeBSD has to do it.

TBR=r
CC=golang-codereviews
https://golang.org/cl/171590043

9 years ago[dev.cc] runtime: fix arm5 build
Russ Cox [Wed, 12 Nov 2014 04:24:54 +0000 (23:24 -0500)]
[dev.cc] runtime: fix arm5 build

TBR=r
CC=golang-codereviews
https://golang.org/cl/168600043

9 years ago[dev.cc] runtime/cgo: add missing import _ "unsafe" for //go:linkname
Russ Cox [Wed, 12 Nov 2014 04:19:59 +0000 (23:19 -0500)]
[dev.cc] runtime/cgo: add missing import _ "unsafe" for //go:linkname

Will prod freebsd build along.
Not claiming it will fix it.

TBR=r
CC=golang-codereviews
https://golang.org/cl/171580044

9 years ago[dev.cc] runtime: convert freebsd to Go
Russ Cox [Wed, 12 Nov 2014 04:00:29 +0000 (23:00 -0500)]
[dev.cc] runtime: convert freebsd to Go

It builds.
Don't know if it works, but it's a lot closer than having everything in C.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/168590043

9 years ago[dev.cc] runtime: convert softfloat_arm.c to Go + build fixes
Russ Cox [Wed, 12 Nov 2014 03:30:02 +0000 (22:30 -0500)]
[dev.cc] runtime: convert softfloat_arm.c to Go + build fixes

Also include onM_signalok fix from issue 8995.

Fixes linux/arm build.
Fixes #8995.

LGTM=r
R=r, dave
CC=golang-codereviews
https://golang.org/cl/168580043

9 years ago[dev.cc] runtime: bring back mgc0.h
Russ Cox [Tue, 11 Nov 2014 23:50:02 +0000 (18:50 -0500)]
[dev.cc] runtime: bring back mgc0.h

This was recorded as an hg mv instead of an hg cp.
For now a C version is needed for the Go compiler.

TBR=r
CC=golang-codereviews
https://golang.org/cl/174020043

9 years ago[dev.cc] runtime: convert arch-specific .c and .h files to Go
Russ Cox [Tue, 11 Nov 2014 22:09:09 +0000 (17:09 -0500)]
[dev.cc] runtime: convert arch-specific .c and .h files to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

vlrt.c was only called from C. Pure delete.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, austin
CC=dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/174860043

9 years ago[dev.cc] runtime: convert operating system support code from C to Go
Russ Cox [Tue, 11 Nov 2014 22:08:54 +0000 (17:08 -0500)]
[dev.cc] runtime: convert operating system support code from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/174830044

9 years ago[dev.cc] runtime: convert scheduler from C to Go
Russ Cox [Tue, 11 Nov 2014 22:08:33 +0000 (17:08 -0500)]
[dev.cc] runtime: convert scheduler from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, daniel.morsing
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/172260043

9 years ago[dev.cc] runtime: convert race implementation from C to Go
Russ Cox [Tue, 11 Nov 2014 22:08:14 +0000 (17:08 -0500)]
[dev.cc] runtime: convert race implementation from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/172250044

9 years ago[dev.cc] runtime: convert parallel support code from C to Go
Russ Cox [Tue, 11 Nov 2014 22:07:54 +0000 (17:07 -0500)]
[dev.cc] runtime: convert parallel support code from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, austin
CC=dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/172250043

9 years ago[dev.cc] runtime: convert defs_$GOOS_$GOARCH.h to Go
Russ Cox [Tue, 11 Nov 2014 22:07:37 +0000 (17:07 -0500)]
[dev.cc] runtime: convert defs_$GOOS_$GOARCH.h to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

In a few cases, defs_$GOOS_$GOARCH.go already existed,
so the target here is defs1_$GOOS_$GOARCH.go.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/171490043

9 years ago[dev.cc] runtime: convert basic library routines from C to Go
Russ Cox [Tue, 11 Nov 2014 22:07:06 +0000 (17:07 -0500)]
[dev.cc] runtime: convert basic library routines from C to Go

float.c held bit patterns for special float64 values,
hiding from the real uses. Rewrite Go code not to
refer to those values directly.

Convert library routines in runtime.c and string.c.

LGTM=r
R=r, dave
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/170330043

9 years ago[dev.cc] build: disable API check until all systems build
Russ Cox [Tue, 11 Nov 2014 22:06:41 +0000 (17:06 -0500)]
[dev.cc] build: disable API check until all systems build

Otherwise no system will get an 'ok' until they all do.

LGTM=r, dave
R=r, dave
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/170320044

9 years ago[dev.cc] runtime: convert assembly files for C to Go transition
Russ Cox [Tue, 11 Nov 2014 22:06:22 +0000 (17:06 -0500)]
[dev.cc] runtime: convert assembly files for C to Go transition

The main change is that #include "zasm_GOOS_GOARCH.h"
is now #include "go_asm.h" and/or #include "go_tls.h".

Also, because C StackGuard is now Go _StackGuard,
the assembly name changes from const_StackGuard to
const__StackGuard.

In asm_$GOARCH.s, add new function getg, formerly
implemented in C.

The renamed atomics now have Go wrappers, to get
escape analysis annotations right. Those wrappers
are in CL 174860043.

LGTM=r, aram
R=r, aram
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/168510043

9 years ago[dev.cc] runtime: convert signal handlers from C to Go
Russ Cox [Tue, 11 Nov 2014 22:05:55 +0000 (17:05 -0500)]
[dev.cc] runtime: convert signal handlers from C to Go

This code overused macros and could not be
converted automatically. Instead a new sigctxt
type had to be defined for each os/arch combination,
with a common (implicit) interface used by the
arch-specific signal handler code.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/168500044

9 years ago[dev.cc] runtime/cgo: convert from C to Go
Russ Cox [Tue, 11 Nov 2014 22:05:37 +0000 (17:05 -0500)]
[dev.cc] runtime/cgo: convert from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/168500043

9 years ago[dev.cc] runtime: convert header files to Go
Russ Cox [Tue, 11 Nov 2014 22:05:19 +0000 (17:05 -0500)]
[dev.cc] runtime: convert header files to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, austin
CC=dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/167550043

9 years ago[dev.cc] runtime: convert memory allocator and garbage collector to Go
Russ Cox [Tue, 11 Nov 2014 22:05:02 +0000 (17:05 -0500)]
[dev.cc] runtime: convert memory allocator and garbage collector to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/167540043

9 years ago[dev.cc] runtime: convert panic and stack code from C to Go
Russ Cox [Tue, 11 Nov 2014 22:04:34 +0000 (17:04 -0500)]
[dev.cc] runtime: convert panic and stack code from C to Go

The conversion was done with an automated tool and then
modified only as necessary to make it compile and run.

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

LGTM=r
R=r, dave
CC=austin, dvyukov, golang-codereviews, iant, khr
https://golang.org/cl/166520043

9 years ago[dev.garbage] runtime: concurrent mark fixes
Russ Cox [Tue, 11 Nov 2014 21:54:50 +0000 (16:54 -0500)]
[dev.garbage] runtime:  concurrent mark fixes

Add missing write barrier when initializing state
for newly created goroutine. Add write barrier for
same slot when preempting a goroutine.

Disable write barrier during goroutine death,
because dopanic does pointer writes.

With concurrent mark enabled (not in this CL), all.bash passed once.
The second time, TestGoexitCrash-2 failed.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/167610043

9 years ago[dev.cc] cmd/dist: adjust for build process without cmd/cc
Russ Cox [Tue, 11 Nov 2014 06:29:05 +0000 (01:29 -0500)]
[dev.cc] cmd/dist: adjust for build process without cmd/cc

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

- Remove references to C compiler directories.
- Remove generation of special header files.
- Remove generation of Go source files from C declarations.

- Compile Go sources before rest of package (was after),
  so that Go compiler can write go_asm.h for use in assembly.

- Move TLS information from cmd/dist (was embedding in output)
  to src/runtime/go_tls.h, which it can be maintained directly.

LGTM=r
R=r, dave
CC=austin, golang-codereviews, iant, khr
https://golang.org/cl/172960043

9 years ago[dev.cc] liblink: resolve bss vs other conflict regardless of order found
Russ Cox [Tue, 11 Nov 2014 06:28:26 +0000 (01:28 -0500)]
[dev.cc] liblink: resolve bss vs other conflict regardless of order found

If the linker finds the same name given a BSS and a non-BSS
symbol, the assumption is that the non-BSS symbol is the
true one, and the BSS symbol is just the best Go can do toward
an "extern" declaration. This has always been the case,
as long as the object files were read in the right order.

The old code worked when the BSS symbol is found before
the non-BSS symbol. This CL adds equivalent logic for when
the non-BSS symbol is found before the BSS symbol.
This comes up when Go must refer to symbols defined in
host object files.

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://golang.org/cl/171480043

9 years ago[dev.cc] cmd/go: adjust go, cgo builds & disable cc
Russ Cox [Tue, 11 Nov 2014 06:27:55 +0000 (01:27 -0500)]
[dev.cc] cmd/go: adjust go, cgo builds & disable cc

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

Make gcToolchain.cc return an error (no C compiler!).

Adjust expectations of cgo, now that cgo does not write any C files
(no C compiler!).

For packages with .s files, invoke Go compiler with -asmhdr go_asm.h
so that assembly files can use it. This applies to all packages but is only
needed today by package runtime.

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://golang.org/cl/171470043

9 years ago[dev.cc] cmd/gc: changes for removing runtime C code
Russ Cox [Tue, 11 Nov 2014 06:27:30 +0000 (01:27 -0500)]
[dev.cc] cmd/gc: changes for removing runtime C code

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

export.c, lex.c:
Add -asmhdr flag to write assembly header file with struct
field offsets and const values. cmd/dist used to construct this
file by interpreting output from the C compiler.
Generate it from the Go definitions instead.
Also, generate the form we need directly, instead of relying
on cmd/dist for reprocessing.

lex.c, obj.c:
If the C compiler accepted #pragma cgo_xxx, recognize
a directive //go:cgo_xxx instead. The effect is the same as
in the C compiler: accumulate text into a buffer and emit in the
output file, where the linker will find and use it.

lex.c, obj.c:
Accept //go:linkname to control the external symbol name
used for a particular top-level Go variable. This makes it
possible to refer to C symbol names but also symbols from
other packages. It has always been possible to do this from
C and assembly. To drive home the point that this should not
be done lightly, require import "unsafe" in any file containing
//go:linkname.

plive.c, reflect.c, subr.c:
Hard-code that interfaces contain only pointers.
This means code handling multiword values in the garbage
collector and the stack copier can be deleted instead of being
converted. This change is already present in the dev.garbage
branch.

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://golang.org/cl/169360043

9 years ago[dev.cc] cmd/cgo: generate only Go source files
Russ Cox [Tue, 11 Nov 2014 06:23:19 +0000 (01:23 -0500)]
[dev.cc] cmd/cgo: generate only Go source files

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

We changed cgo to write the actual function wrappers in Go
for Go 1.4. The only code left in C output files was the definitions
for pointers to C data and the #pragma cgo directives.
Write both of those to Go outputs instead, using the new
compiler directives introduced in CL 169360043.

(Still generating C files in gccgo mode.)

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://golang.org/cl/169330045

9 years ago[dev.cc] reflect: interfaces contain only pointers
Russ Cox [Tue, 11 Nov 2014 06:23:01 +0000 (01:23 -0500)]
[dev.cc] reflect: interfaces contain only pointers

[This CL is part of the removal of C code from package runtime.
See golang.org/s/dev.cc for an overview.]

Adjustments for changes made in CL 169360043.
This change is already present in the dev.garbage branch.

LGTM=r
R=r
CC=austin, golang-codereviews, iant, khr
https://golang.org/cl/167520044

9 years ago[dev.cc] cmd/5c, cmd/6c, cmd/8c, cmd/cc: remove
Russ Cox [Tue, 11 Nov 2014 03:40:44 +0000 (22:40 -0500)]
[dev.cc] cmd/5c, cmd/6c, cmd/8c, cmd/cc: remove

Let's just do this up front.
This will break the build (here on the dev.cc branch).
The CLs that follow will take care of fixing it.

Leave behind cmd/cc/lexbody and cmd/cc/macbody for the assemblers.
They'll go away later.

LGTM=dave, r
R=r, dave
CC=golang-codereviews
https://golang.org/cl/172170043

9 years ago[dev.garbage] runtime: add write barrier to casp
Russ Cox [Mon, 10 Nov 2014 19:59:36 +0000 (14:59 -0500)]
[dev.garbage] runtime: add write barrier to casp

Also rewrite some casp that don't use real pointers
to use casuintptr instead.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/166440044

9 years ago[dev.garbage] runtime: Coarsen the write barrier to always grey the destination.
Rick Hudson [Mon, 10 Nov 2014 19:32:02 +0000 (14:32 -0500)]
[dev.garbage] runtime: Coarsen the write barrier to always grey the destination.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/174820043

9 years ago[dev.garbage] runtime: Code to implement write barriers
Rick Hudson [Mon, 10 Nov 2014 18:42:34 +0000 (13:42 -0500)]
[dev.garbage] runtime: Code to implement write barriers
To turn concurrent gc on alter the if false in func gogc
currently at line 489 in malloc.go

LGTM=rsc
R=rsc
CC=golang-codereviews, rlh
https://golang.org/cl/172190043

9 years ago[dev.cc] create new branch
Russ Cox [Mon, 10 Nov 2014 02:14:36 +0000 (21:14 -0500)]
[dev.cc] create new branch

This branch is for work on converting the remaining C code in
package runtime to Go and then deleting the cc, 5c, 6c, and 8c
directories. It is targeted to land at the beginning of the 1.5 cycle.

The conversion will proceed one GOOS/GOARCH combination
at a time; red lines on the dashboard are expected and okay.

Once Linux and OS X are converted, help with other systems
will be most welcome.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/174760043

9 years agotest: fix nacl build
Russ Cox [Mon, 10 Nov 2014 02:10:49 +0000 (21:10 -0500)]
test: fix nacl build

Disable linkx_run.go and sinit_run.go, because they
exec subprocesses, which NaCl cannot.

TBR=r
CC=golang-codereviews
https://golang.org/cl/171350043

9 years agocmd/internal/objfile: minor edits
Russ Cox [Mon, 10 Nov 2014 01:21:37 +0000 (20:21 -0500)]
cmd/internal/objfile: minor edits

Follow-up in response to comments on
TBR'ed CL 171260043.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/172080043

9 years agoruntime: fix sudog leak in syncsemrelease
Russ Cox [Mon, 10 Nov 2014 01:21:03 +0000 (20:21 -0500)]
runtime: fix sudog leak in syncsemrelease

Manifested as increased memory usage in a Google production system.

Not an unbounded leak, but can significantly increase the number
of sudogs allocated between garbage collections.

I checked all the other calls to acquireSudog.
This is the only one that was missing a releaseSudog.

LGTM=r, dneil
R=dneil, r
CC=golang-codereviews
https://golang.org/cl/169260043

9 years agoruntime/cgo: add +build tags to files named for $GOOS
Russ Cox [Mon, 10 Nov 2014 01:20:45 +0000 (20:20 -0500)]
runtime/cgo: add +build tags to files named for $GOOS

These are being built into the runtime/cgo for every
operating system. It doesn't seem to matter, but
restore the Go 1.3 behavior anyway.

LGTM=r
R=r, dave
CC=golang-codereviews
https://golang.org/cl/171290043

9 years agocmd/dist: remove old misc/pprof
Russ Cox [Mon, 10 Nov 2014 01:20:26 +0000 (20:20 -0500)]
cmd/dist: remove old misc/pprof

LGTM=dave, bradfitz, r, alex.brainman
R=r, dave, bradfitz, alex.brainman
CC=golang-codereviews
https://golang.org/cl/167350043

9 years agocmd/pprof: install as go tool pprof
Russ Cox [Mon, 10 Nov 2014 01:20:06 +0000 (20:20 -0500)]
cmd/pprof: install as go tool pprof

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/168320043

9 years agoundo CL 169000043 / 05b838013df9
Andrew Gerrand [Sun, 9 Nov 2014 22:46:27 +0000 (09:46 +1100)]
undo CL 169000043 / 05b838013df9

This was a mistake. The cmd/api tool
depends on an old version of go/types.

««« original CL description
cmd/api: use golang.org/x/... import paths

LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/169000043
»»»

TBR=rsc, bradfitz
R=bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/169320043

9 years agoundo CL 166380043 / 0b54a0927656
Andrew Gerrand [Sun, 9 Nov 2014 22:39:17 +0000 (09:39 +1100)]
undo CL 166380043 / 0b54a0927656

This was a mistake; the cmd/api tool
depends on an old version of go/types.

««« original CL description
cmd/api: bump go.tools golden CL hash

TBR=bradfitz
R=rsc
CC=golang-codereviews
https://golang.org/cl/166380043
»»»

TBR=bradfitz, rsc
R=bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/167430043

9 years agocmd/api: bump go.tools golden CL hash
Andrew Gerrand [Sun, 9 Nov 2014 22:30:57 +0000 (09:30 +1100)]
cmd/api: bump go.tools golden CL hash

TBR=bradfitz
R=rsc
CC=golang-codereviews
https://golang.org/cl/166380043

9 years agocmd/go: use golang.org/x/... import paths
Andrew Gerrand [Sun, 9 Nov 2014 22:27:25 +0000 (09:27 +1100)]
cmd/go: use golang.org/x/... import paths

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/168170043

9 years agoall: use golang.org/x/... import paths
Andrew Gerrand [Sun, 9 Nov 2014 22:15:57 +0000 (09:15 +1100)]
all: use golang.org/x/... import paths

LGTM=rsc, r
R=r, rsc
CC=golang-codereview, golang-codereviews
https://golang.org/cl/168050043

9 years agocmd/api: use golang.org/x/... import paths
Andrew Gerrand [Sun, 9 Nov 2014 22:13:04 +0000 (09:13 +1100)]
cmd/api: use golang.org/x/... import paths

LGTM=bradfitz, rsc
R=rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/169000043

9 years agolib/codereview: fix with more recent hg revisions.
Adam Langley [Sun, 9 Nov 2014 01:12:23 +0000 (17:12 -0800)]
lib/codereview: fix with more recent hg revisions.

I've Mercurial version 3.2 and hg submit fails with:

  File "/home/agl/devel/go/lib/codereview/codereview.py", line 3567, in get_hg_status
    ret = hg_commands.status(fui, self.repo, *[], **{'rev': [rev], 'copies': True})
  File "/usr/lib/python2.7/site-packages/mercurial/commands.py", line 5714, in status
    fm = ui.formatter('status', opts)
  File "/home/agl/devel/go/lib/codereview/codereview.py", line 3464, in formatter
    return plainformatter(self, topic, opts)
  File "/usr/lib/python2.7/site-packages/mercurial/formatter.py", line 57, in __init__
    if ui.debugflag:
  AttributeError: 'FakeMercurialUI' object has no attribute 'debugflag'

This change dumbly adds a boolean debugflag and that seems to work.

LGTM=minux
R=rsc, minux
CC=golang-codereviews
https://golang.org/cl/167410043

9 years agonet/http: fix benchmark goroutine leak
Brad Fitzpatrick [Sat, 8 Nov 2014 18:13:28 +0000 (15:13 -0300)]
net/http: fix benchmark goroutine leak

New detection because of net/http now using TestMain.

Fixes #9033

LGTM=iant
R=golang-codereviews, iant
CC=adg, golang-codereviews, rsc
https://golang.org/cl/170210043

9 years agocmd/go: disable warnings from cmd/cc when building for SWIG
Ian Lance Taylor [Fri, 7 Nov 2014 16:19:19 +0000 (08:19 -0800)]
cmd/go: disable warnings from cmd/cc when building for SWIG

Fixes #9065.

LGTM=rsc
R=rsc, misch
CC=golang-codereviews
https://golang.org/cl/171270043

9 years ago[dev.power64] 5g: fix mistaken bit-wise AND in regopt
Austin Clements [Fri, 7 Nov 2014 15:43:55 +0000 (10:43 -0500)]
[dev.power64] 5g: fix mistaken bit-wise AND in regopt

Replace a bit-wise AND with a logical one.  This happened to
work before because bany returns 0 or 1, but the intent here
is clearly logical (and this makes 5g match with 6g and 8g).

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/172850043

9 years agocmd/internal/objfile: add Disasm
Russ Cox [Fri, 7 Nov 2014 01:08:00 +0000 (20:08 -0500)]
cmd/internal/objfile: add Disasm

This was missing from CL 167320043.
Happy to apply comments in a followup.
TBR to fix build.

TBR=r
CC=golang-codereviews
https://golang.org/cl/171260043

9 years agocmd/objdump, cmd/pprof: factor disassembly into cmd/internal/objfile
Russ Cox [Fri, 7 Nov 2014 00:56:55 +0000 (19:56 -0500)]
cmd/objdump, cmd/pprof: factor disassembly into cmd/internal/objfile

Moving so that new Go 1.4 pprof can use it.

The old 'GNU objdump workalike' mode for 'go tool objdump'
is now gone, as are the tests for that mode. It was used only
by pre-Go 1.4 pprof. You can still specify an address range on
the command line; you just get the same output format as
you do when dumping the entire binary (without an address
limitation).

LGTM=r
R=r
CC=golang-codereviews, iant
https://golang.org/cl/167320043

9 years ago[dev.power64] 5g: fix etype and width of itable Addrs
Austin Clements [Thu, 6 Nov 2014 20:35:53 +0000 (15:35 -0500)]
[dev.power64] 5g: fix etype and width of itable Addrs

For OITAB nodes, 5g's naddr was setting the wrong etype and
failing to set the width of the resulting Addr.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/171220043

9 years agodoc/go1.4.html: leave stack size at 2 kB
Russ Cox [Thu, 6 Nov 2014 20:19:16 +0000 (15:19 -0500)]
doc/go1.4.html: leave stack size at 2 kB

LGTM=r
R=khr, r
CC=golang-codereviews
https://golang.org/cl/165590043

9 years agodoc: change "/s/..." links to be on golang.org
Russ Cox [Thu, 6 Nov 2014 20:18:47 +0000 (15:18 -0500)]
doc: change "/s/..." links to be on golang.org

People viewing this locally will not have a /s/ on their local godoc.
tip.golang.org doesn't have one either.

Also change all golang.org links to https, to avoid mixed content
warnings when viewing https://golang.org/.

Fixes #9028.

LGTM=bradfitz, r
R=r, bradfitz
CC=adg, golang-codereviews
https://golang.org/cl/168250043

9 years agotest: move linkx and sinit to run.go
Josh Bleecher Snyder [Thu, 6 Nov 2014 20:14:08 +0000 (15:14 -0500)]
test: move linkx and sinit to run.go

The remaining run-only tests will be migrated to run.go in another CL.

This CL will break the build due to issues 8746 and 8806.

Update #4139
Update #8746
Update #8806

LGTM=rsc
R=rsc, bradfitz, iant
CC=golang-codereviews
https://golang.org/cl/144630044

9 years ago[dev.power64] 9g: fix addr width calculation; enable MOV* width check
Austin Clements [Thu, 6 Nov 2014 19:41:44 +0000 (14:41 -0500)]
[dev.power64] 9g: fix addr width calculation; enable MOV* width check

9g's naddr was missing assignments to a->width in several
cases, so the optimizer was getting bogus width information.
Add them.

This correct width information also lets us enable the width
check in gins for MOV*.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/167310043

9 years ago[dev.power64] gc: fix etype of strings
Austin Clements [Thu, 6 Nov 2014 19:37:39 +0000 (14:37 -0500)]
[dev.power64] gc: fix etype of strings

The etype of references to strings was being incorrectly set
to TINT32 on all platforms.  Change it to TSTRING.  It seems
this doesn't matter for compilation, since x86 uses LEA
instructions to load string addresses and arm and power64
disassemble the string into its constituent pieces (with the
correct types), but it helps when debugging.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170100043

9 years agoruntime: don't stop bitmap dump at BitsDead
Keith Randall [Thu, 6 Nov 2014 17:30:41 +0000 (09:30 -0800)]
runtime: don't stop bitmap dump at BitsDead

Stack bitmaps need to be scanned past any BitsDead entries.

Object bitmaps will not have any BitsDead in them (bitmap extraction stops at
the first BitsDead entry in makeheapobjbv).  data/bss bitmaps also have no BitsDead entries.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/168270043

9 years agoruntime: fix initial gp->sched.pc in newextram
Russ Cox [Thu, 6 Nov 2014 14:37:04 +0000 (09:37 -0500)]
runtime: fix initial gp->sched.pc in newextram

CL 170720043 missed this one when adding +PCQuantum.

LGTM=iant
R=r, iant
CC=golang-codereviews
https://golang.org/cl/168090043

9 years agoos: document that users of Fd should keep f alive
Russ Cox [Thu, 6 Nov 2014 14:36:51 +0000 (09:36 -0500)]
os: document that users of Fd should keep f alive

Fixes #9046.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/162680043

9 years agoos/exec: tell lsof not to block
Keith Randall [Thu, 6 Nov 2014 04:25:20 +0000 (20:25 -0800)]
os/exec: tell lsof not to block

For some reason lsof is now hanging on my workstation
without the -b (avoid blocking in the kernel) option.
Adding -b makes the test pass and shouldn't hurt.

I don't know how recent the -b option is.  If the builders
are ok with it, it's probably ok.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/166220043

9 years agobufio: remove unused 'panicked' variable from test
Andrew Gerrand [Thu, 6 Nov 2014 04:22:29 +0000 (15:22 +1100)]
bufio: remove unused 'panicked' variable from test

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/166230044

9 years agoruntime: avoid gentraceback of self on user goroutine stack
Russ Cox [Thu, 6 Nov 2014 04:01:48 +0000 (23:01 -0500)]
runtime: avoid gentraceback of self on user goroutine stack

Gentraceback may grow the stack.
One of the gentraceback wrappers may grow the stack.
One of the gentraceback callback calls may grow the stack.
Various stack pointers are stored in various stack locations
as type uintptr during the execution of these calls.
If the stack does grow, these stack pointers will not be
updated and will start trying to decode stack memory that
is no longer valid.

It may be possible to change the type of the stack pointer
variables to be unsafe.Pointer, but that's pretty subtle and
may still have problems, even if we catch every last one.
An easier, more obviously correct fix is to require that
gentraceback of the currently running goroutine must run
on the g0 stack, not on the goroutine's own stack.

Not doing this causes faults when you set
        StackFromSystem = 1
        StackFaultOnFree = 1

The new check in gentraceback will catch future lapses.

The more general problem is calling getcallersp but then
calling a function that might relocate the stack, which would
invalidate the result of getcallersp. Add note to stubs.go
declaration of getcallersp explaining the problem, and
check all existing calls to getcallersp. Most needed fixes.

This affects Callers, Stack, and nearly all the runtime
profiling routines. It does not affect stack copying directly
nor garbage collection.

LGTM=khr
R=khr, bradfitz
CC=golang-codereviews, r
https://golang.org/cl/167060043

9 years agobufio: fix reading of many blank lines in a row
Russ Cox [Thu, 6 Nov 2014 03:50:24 +0000 (22:50 -0500)]
bufio: fix reading of many blank lines in a row

Fixes #9020.

LGTM=bradfitz, r
R=r, bradfitz
CC=golang-codereviews
https://golang.org/cl/170030043

9 years agodoc/go1.4.html: document new subrepo import paths
Russ Cox [Thu, 6 Nov 2014 01:15:48 +0000 (20:15 -0500)]
doc/go1.4.html: document new subrepo import paths

LGTM=r, adg
R=adg, r, 0xjnml, dr.volker.dobler
CC=golang-codereviews
https://golang.org/cl/166980044

9 years agobufio: don't loop generating empty tokens
Rob Pike [Wed, 5 Nov 2014 22:57:46 +0000 (09:57 +1100)]
bufio: don't loop generating empty tokens

The new rules for split functions mean that we are exposed
to the common bug of a function that loops forever at EOF.
Pick these off by shutting down the scanner if too many
consecutive empty tokens are delivered.

Fixes #9020.

LGTM=rsc, adg
R=golang-codereviews, rsc, adg, bradfitz
CC=golang-codereviews
https://golang.org/cl/169970043

9 years ago[dev.garbage] cmd/gc: emit pointer write barriers
Russ Cox [Wed, 5 Nov 2014 20:43:41 +0000 (15:43 -0500)]
[dev.garbage] cmd/gc: emit pointer write barriers

This got lost in the change that added the writebarrierfat variants.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/165510043

9 years ago[dev.power64] 6g: don't create variables for indirect addresses
Austin Clements [Wed, 5 Nov 2014 20:36:47 +0000 (15:36 -0500)]
[dev.power64] 6g: don't create variables for indirect addresses

Previously, mkvar treated, for example, 0(AX) the same as AX.
As a result, a move to an indirect address would be marked as
*setting* the register, rather than just using it, resulting
in unnecessary register moves.  Fix this by not producing
variables for indirect addresses.

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/164610043

9 years ago5g: don't generate reg variables for direct-called functions
Austin Clements [Wed, 5 Nov 2014 20:14:47 +0000 (15:14 -0500)]
5g: don't generate reg variables for direct-called functions

The test intended to skip direct calls when creating
registerization variables was testing p->to.type instead of
p->to.name, so it always failed, causing regopt to create
unnecessary variables for these names.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169110043

9 years ago[dev.garbage] cmd/gc, runtime: add locks around print statements
Russ Cox [Wed, 5 Nov 2014 19:42:54 +0000 (14:42 -0500)]
[dev.garbage] cmd/gc, runtime: add locks around print statements

Now each C printf, Go print, or Go println is guaranteed
not to be interleaved with other calls of those functions.
This should help when debugging concurrent failures.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/169120043

9 years ago[dev.garbage] runtime: ignore objects in dead spans
Russ Cox [Wed, 5 Nov 2014 19:42:24 +0000 (14:42 -0500)]
[dev.garbage] runtime: ignore objects in dead spans

We still don't know why this is happening.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/169990043

9 years ago[dev.garbage] runtime: fix a few checkmark bugs
Russ Cox [Wed, 5 Nov 2014 18:37:34 +0000 (13:37 -0500)]
[dev.garbage] runtime: fix a few checkmark bugs

- Some sequencing issues with stopping the first gc_m round
at the right place to set up correctly for the second round.

- atomicxor8 is not idempotent; avoid xor.

- Maintain BitsDead type bits correctly; see long comment added.

- Enable checkmark phase by default for now.

LGTM=rlh
R=rlh
CC=golang-codereviews
https://golang.org/cl/171090043

9 years ago[dev.garbage] runtime: fix 32-bit build
Russ Cox [Wed, 5 Nov 2014 16:09:08 +0000 (11:09 -0500)]
[dev.garbage] runtime: fix 32-bit build

TBR=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/168860046

9 years ago[dev.power64] gc: convert Bits to a uint64 array
Austin Clements [Tue, 4 Nov 2014 21:34:56 +0000 (16:34 -0500)]
[dev.power64] gc: convert Bits to a uint64 array

So far all of our architectures have had at most 32 registers,
so we've been able to use entry 0 in the Bits uint32 array
directly as a register mask.  Power64 has 64 registers, so
this converts Bits to a uint64 array so we can continue to use
entry 0 directly as a register mask on Power64.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/169060043

9 years ago[dev.garbage] runtime: Add gc mark verification pass.
Rick Hudson [Tue, 4 Nov 2014 18:31:34 +0000 (13:31 -0500)]
[dev.garbage] runtime: Add gc mark verification pass.
This adds an independent mark phase to the GC that can be used to
verify the the default concurrent mark phase has found all reachable
objects. It uses the upper 2 bits of the boundary nibble to encode
the mark leaving the lower bits to encode the boundary and the
normal mark bit.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/167130043

9 years agotest: comment out failing cases from sinit.go
Ian Lance Taylor [Tue, 4 Nov 2014 18:20:35 +0000 (10:20 -0800)]
test: comment out failing cases from sinit.go

One failing case this removes is:

var bytes = []byte("hello, world")
var copy_bytes = bytes

We could handle this in the compiler, but it requires special
case for a variable that is initialized to the value of a
variable that is initialized to a string literal converted to
[]byte.  This seems an unlikely case--it never occurs in the
standrd library--and it seems unnecessary to write the code to
handle it.

If we do want to support this case, one approach is
https://golang.org/cl/171840043.

The other failing cases are of the form

var bx bool
var copy_bx = bx

The compiler used to initialize copy_bx to false.  However,
that led to issue 7665, since bx may be initialized in non-Go
code.  The compiler no longer assumes that bx must be false,
so copy_bx can not be statically initialized.

We can fix these with https://golang.org/cl/169040043
if we also pass -complete to the compiler as part of this
test.  This is OK but it's too late in the release cycle.

Fixes #8746.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/165400043