]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
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.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.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.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.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.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.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.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 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

9 years agogc: abort if given an unknown debug (-d) flag
Austin Clements [Tue, 4 Nov 2014 14:43:37 +0000 (09:43 -0500)]
gc: abort if given an unknown debug (-d) flag

The check for unknown command line debug flags in gc was
incorrect: the loop over debugtab terminates when it reaches a
nil entry, but it was only reporting an error if the parser
had passed the last entry of debugtab (which it never did).
Fix this by reporting the usage error if the loop reaches a
nil entry.

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

9 years ago[dev.power64] test: "fix" live.go test on power64x
Austin Clements [Mon, 3 Nov 2014 22:25:36 +0000 (17:25 -0500)]
[dev.power64] test: "fix" live.go test on power64x

On power64x, this one line in live.go reports that t is live
because of missing optimization passes.  This isn't what this
test is trying to test, so shuffle bad40 so that it still
accomplishes the intent of the test without also depending on
optimization.

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

9 years ago[dev.power64] test: disable nilptr3 test on power64x
Austin Clements [Mon, 3 Nov 2014 22:25:03 +0000 (17:25 -0500)]
[dev.power64] test: disable nilptr3 test on power64x

The remaining failures in this test are because of incomplete
optimization support on power64x.  Tracked in issue 9058.

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

9 years ago[dev.power64] liblink: fix printing of branch targets
Austin Clements [Mon, 3 Nov 2014 22:24:13 +0000 (17:24 -0500)]
[dev.power64] liblink: fix printing of branch targets

Print PC stored in target Prog* of branch instructions when
available instead of the offset stored in the branch
instruction.  The offset tends to be wrong after code
transformations, so previously this led to confusing listings.

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

9 years ago[dev.power64] 9g: fix nilopt
Austin Clements [Mon, 3 Nov 2014 20:48:51 +0000 (15:48 -0500)]
[dev.power64] 9g: fix nilopt

Previously, nilopt was disabled on power64x because it threw
away "seemly random segments of code."  Indeed, excise on
power64x failed to preserve the link field, so it excised not
only the requested instruction but all following instructions
in the function.  Fix excise to retain the link field while
otherwise zeroing the instruction.

This makes nilopt safe on power64x.  It still fails
nilptr3.go's tests for removal of repeated nil checks because
those depend on also optimizing away repeated loads, which
doesn't currently happen on power64x.

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

9 years agomisc/cgo/test: fix freebsd test failure by moving test to its own package.
Alan Donovan [Mon, 3 Nov 2014 18:41:03 +0000 (13:41 -0500)]
misc/cgo/test: fix freebsd test failure by moving test to its own package.

(The assertion depends on a per-package gensym counter whose
value varies based on what else is in the package.)

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

9 years agoruntime: make Go and C mallocgc signatures match
Austin Clements [Mon, 3 Nov 2014 18:26:46 +0000 (13:26 -0500)]
runtime: make Go and C mallocgc signatures match

Previously, the flags argument to mallocgc was an int in Go,
but a uint32 in C.  Change the Go type to use uint32 so these
agree.  The largest flag value is 2 (and of course no flag
values are negative), so this won't change anything on little
endian architectures, but it matters on big endian.

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

9 years ago[dev.power64] all: merge default into dev.power64
Austin Clements [Mon, 3 Nov 2014 15:53:11 +0000 (10:53 -0500)]
[dev.power64] all: merge default into dev.power64

Trivial merge except for src/runtime/asm_power64x.s and
src/runtime/signal_power64x.c

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

9 years agodoc: document go get -f flag in 1.4 release notes
Andrew Gerrand [Mon, 3 Nov 2014 06:01:17 +0000 (17:01 +1100)]
doc: document go get -f flag in 1.4 release notes

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

9 years ago[dev.power64] cmd/objdump: disable tests on power64/power64le
Dave Cheney [Sun, 2 Nov 2014 00:23:41 +0000 (11:23 +1100)]
[dev.power64] cmd/objdump: disable tests on power64/power64le

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

9 years agomisc: Increase issue 6997's test timeout to prevent spurious failures.
Benoit Sigoure [Sat, 1 Nov 2014 15:28:09 +0000 (08:28 -0700)]
misc: Increase issue 6997's test timeout to prevent spurious failures.

On heavily loaded build servers, a 5 second timeout is too aggressive,
which causes this test to fail spuriously.

LGTM=iant
R=iant
CC=golang-codereviews, sqweek
https://golang.org/cl/170850043

9 years agoA+C: add Benoit Sigoure (individual CLA)
Ian Lance Taylor [Sat, 1 Nov 2014 15:27:55 +0000 (08:27 -0700)]
A+C: add Benoit Sigoure (individual CLA)

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

9 years ago[dev.power64] runtime: fix gcinfo_test on power64x
Austin Clements [Fri, 31 Oct 2014 20:58:12 +0000 (16:58 -0400)]
[dev.power64] runtime: fix gcinfo_test on power64x

The GC info masks for slices and strings were changed in
commit caab29a25f68, but the reference masks used by
gcinfo_test for power64x hadn't caught up.  Now they're
identical to amd64, so this CL fixes this test by combining
the reference masks for these platforms.

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

9 years ago[dev.power64] reflect: fix asm on power64x
Austin Clements [Fri, 31 Oct 2014 19:29:03 +0000 (15:29 -0400)]
[dev.power64] reflect: fix asm on power64x

reflect/asm_power64x.s was missing changes made to other
platforms for stack maps.  This CL ports those changes.  With
this fix, the reflect test passes on power64x.

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

9 years ago[dev.power64] runtime: fix fastrand1 on power64x
Austin Clements [Fri, 31 Oct 2014 17:39:36 +0000 (13:39 -0400)]
[dev.power64] runtime: fix fastrand1 on power64x

fastrand1 depends on testing the high bit of its uint32 state.
For efficiency, all of the architectures implement this as a
sign bit test.  However, on power64, fastrand1 was using a
64-bit sign test on the zero-extended 32-bit state.  This
always failed, causing fastrand1 to have very short periods
and often decay to 0 and get stuck.

Fix this by using a 32-bit signed compare instead of a 64-bit
compare.  This fixes various tests for the randomization of
select of map iteration.

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

9 years agonet/http: add missing newline in list of leaked goroutines
Ian Lance Taylor [Fri, 31 Oct 2014 17:20:36 +0000 (10:20 -0700)]
net/http: add missing newline in list of leaked goroutines

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/168860044

9 years agodatabase/sql: make TestDrivers not crash on second run
Brad Fitzpatrick [Fri, 31 Oct 2014 16:49:42 +0000 (09:49 -0700)]
database/sql: make TestDrivers not crash on second run

Using -test.cpu=1,1 made it crash before.

Fixes #9024

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

9 years agocmd/go: fixed typo in doc and generator
Gabriel Aszalos [Fri, 31 Oct 2014 16:38:41 +0000 (09:38 -0700)]
cmd/go: fixed typo in doc and generator

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

9 years agoA+C: add Gabriel Aszalos (individual CLA)
Ian Lance Taylor [Fri, 31 Oct 2014 16:37:11 +0000 (09:37 -0700)]
A+C: add Gabriel Aszalos (individual CLA)

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

9 years ago[dev.power64] 9g: fix under-zeroing in clearfat
Austin Clements [Fri, 31 Oct 2014 15:08:27 +0000 (11:08 -0400)]
[dev.power64] 9g: fix under-zeroing in clearfat

All three cases of clearfat were wrong on power64x.

The cases that handle 1032 bytes and up and 32 bytes and up
both use MOVDU (one directly generated in a loop and the other
via duffzero), which leaves the pointer register pointing at
the *last written* address.  The generated code was not
accounting for this, so the byte fill loop was re-zeroing the
last zeroed dword, rather than the bytes following the last
zeroed dword.  Fix this by simply adding an additional 8 byte
offset to the byte zeroing loop.

The case that handled under 32 bytes was also wrong.  It
didn't update the pointer register at all, so the byte zeroing
loop was simply re-zeroing the beginning of region.  Again,
the fix is to add an offset to the byte zeroing loop to
account for this.

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

9 years agosync/atomic: fix comment referencing Value.Store's argument name
Brad Fitzpatrick [Fri, 31 Oct 2014 03:48:57 +0000 (00:48 -0300)]
sync/atomic: fix comment referencing Value.Store's argument name

Fixes #9029

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

9 years ago[dev.power64] runtime: fix a syntax error that slipped in to asm_power64x.s
Austin Clements [Thu, 30 Oct 2014 20:44:42 +0000 (16:44 -0400)]
[dev.power64] runtime: fix a syntax error that slipped in to asm_power64x.s

Apparently I had already moved on to fixing another problem
when I submitted CL 169790043.

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

9 years agocmd/go: fix minor typo
Nathan P Finch [Thu, 30 Oct 2014 20:20:43 +0000 (13:20 -0700)]
cmd/go: fix minor typo

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

9 years agoA+C: Nathan P Finch (individual CLA)
Brad Fitzpatrick [Thu, 30 Oct 2014 20:19:29 +0000 (17:19 -0300)]
A+C: Nathan P Finch (individual CLA)

TBR=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/155560045

9 years agoA+C: add Jed Denlea (Fastly corporate CLA)
Brad Fitzpatrick [Thu, 30 Oct 2014 20:15:43 +0000 (13:15 -0700)]
A+C: add Jed Denlea (Fastly corporate CLA)

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

9 years ago[dev.power64] runtime: make asm_power64x.s go vet-clean
Austin Clements [Thu, 30 Oct 2014 19:58:30 +0000 (15:58 -0400)]
[dev.power64] runtime: make asm_power64x.s go vet-clean

No real problems found.  Just lots of argument names that
didn't quite match up.

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

9 years agomisc/cgo/test: fix bad C test code that fails on some configurations
Alan Donovan [Thu, 30 Oct 2014 18:08:55 +0000 (14:08 -0400)]
misc/cgo/test: fix bad C test code that fails on some configurations

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

9 years agocmd/cgo: avoid worklist nondeterminism.
Alan Donovan [Thu, 30 Oct 2014 18:01:14 +0000 (14:01 -0400)]
cmd/cgo: avoid worklist nondeterminism.

+ Regression test.

Fixes #9026.

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

9 years ago[dev.power64] runtime: fix out-of-date comment in panic
Austin Clements [Thu, 30 Oct 2014 16:08:21 +0000 (12:08 -0400)]
[dev.power64] runtime: fix out-of-date comment in panic

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

9 years ago[dev.power64] runtime: test CAS on large unsigned 32-bit numbers
Austin Clements [Thu, 30 Oct 2014 15:17:26 +0000 (11:17 -0400)]
[dev.power64] runtime: test CAS on large unsigned 32-bit numbers

This adds a test to runtime·check to ensure CAS of large
unsigned 32-bit numbers does not accidentally sign-extend its
arguments.

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

9 years ago[dev.power64] runtime: match argument/return type signedness in power64x assembly
Austin Clements [Thu, 30 Oct 2014 14:45:41 +0000 (10:45 -0400)]
[dev.power64] runtime: match argument/return type signedness in power64x assembly

Previously, the power64x runtime assembly was sloppy about
using sign-extending versus zero-extending moves of arguments
and return values.  I think all of the cases that actually
mattered have been fixed in recent CLs; this CL fixes up the
few remaining mismatches.

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

9 years ago[dev.garbage] cmd/gc, runtime: implement write barriers in terms of writebarrierptr
Russ Cox [Thu, 30 Oct 2014 14:16:03 +0000 (10:16 -0400)]
[dev.garbage] cmd/gc, runtime: implement write barriers in terms of writebarrierptr

This CL implements the many multiword write barriers by calling
writebarrierptr, so that only writebarrierptr needs the actual barrier.
In lieu of an actual barrier, writebarrierptr checks that the value
being copied is not a small non-zero integer. This is enough to
shake out bugs where the barrier is being called when it should not
(for non-pointer values). It also found a few tests in sync/atomic
that were being too clever.

This CL adds a write barrier for the memory moved during the
builtin copy function, which I forgot when inserting barriers for Go 1.4.

This CL re-enables some write barriers that were disabled for Go 1.4.
Those were disabled because it is possible to change the generated
code so that they are unnecessary most of the time, but we have not
changed the generated code yet. For safety they must be enabled.

None of this is terribly efficient. We are aiming for correct first.

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

9 years agodoc/go1.4.html: tweak http.Transport.DialTLS wording
Brad Fitzpatrick [Thu, 30 Oct 2014 13:58:31 +0000 (10:58 -0300)]
doc/go1.4.html: tweak http.Transport.DialTLS wording

It doesn't simplify, because it wasn't even possible before.

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

9 years agodoc/go1.4.html: fix typo
Mikio Hara [Thu, 30 Oct 2014 05:15:00 +0000 (14:15 +0900)]
doc/go1.4.html: fix typo

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

9 years agotag go1.4beta1
Andrew Gerrand [Thu, 30 Oct 2014 01:33:57 +0000 (12:33 +1100)]
tag go1.4beta1

TBR=rsc
R=r, rsc
CC=golang-codereviews
https://golang.org/cl/164240043

9 years agocmd/objdump: disable test failing on arm5 go1.4beta1
Russ Cox [Thu, 30 Oct 2014 01:02:58 +0000 (21:02 -0400)]
cmd/objdump: disable test failing on arm5

TBR=adg
CC=golang-codereviews
https://golang.org/cl/167890043

9 years agoruntime: change top-most return PC from goexit to goexit+PCQuantum
Russ Cox [Thu, 30 Oct 2014 00:37:44 +0000 (20:37 -0400)]
runtime: change top-most return PC from goexit to goexit+PCQuantum

If you get a stack of PCs from Callers, it would be expected
that every PC is immediately after a call instruction, so to find
the line of the call, you look up the line for PC-1.
CL 163550043 now explicitly documents that.

The most common exception to this is the top-most return PC
on the stack, which is the entry address of the runtime.goexit
function. Subtracting 1 from that PC will end up in a different
function entirely.

To remove this special case, make the top-most return PC
goexit+PCQuantum and then implement goexit in assembly
so that the first instruction can be skipped.

Fixes #7690.

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

9 years agoruntime: make TestCgoExternalThreadPanic run on windows
Alex Brainman [Wed, 29 Oct 2014 23:24:37 +0000 (10:24 +1100)]
runtime: make TestCgoExternalThreadPanic run on windows

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

9 years agodoc/go1.4.html: final library changes
Rob Pike [Wed, 29 Oct 2014 22:35:48 +0000 (15:35 -0700)]
doc/go1.4.html: final library changes
First draft now complete.

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

9 years agocmd/objdump: use cmd/internal/objfile
Russ Cox [Wed, 29 Oct 2014 22:07:24 +0000 (18:07 -0400)]
cmd/objdump: use cmd/internal/objfile

This removes a bunch of ugly duplicate code.
The end goal is to factor the disassembly code
into cmd/internal/objfile too, so that pprof can use it,
but one step at a time.

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

9 years agodoc/go1.4.html: gccgo status
Rob Pike [Wed, 29 Oct 2014 20:07:34 +0000 (13:07 -0700)]
doc/go1.4.html: gccgo status

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

9 years agoruntime: fix line number in first stack frame in printed stack trace
Russ Cox [Wed, 29 Oct 2014 19:14:24 +0000 (15:14 -0400)]
runtime: fix line number in first stack frame in printed stack trace

Originally traceback was only used for printing the stack
when an unexpected signal came in. In that case, the
initial PC is taken from the signal and should be used
unaltered. For the callers, the PC is the return address,
which might be on the line after the call; we subtract 1
to get to the CALL instruction.

Traceback is now used for a variety of things, and for
almost all of those the initial PC is a return address,
whether from getcallerpc, or gp->sched.pc, or gp->syscallpc.
In those cases, we need to subtract 1 from this initial PC,
but the traceback code had a hard rule "never subtract 1
from the initial PC", left over from the signal handling days.

Change gentraceback to take a flag that specifies whether
we are tracing a trap.

Change traceback to default to "starting with a return PC",
which is the overwhelmingly common case.

Add tracebacktrap, like traceback but starting with a trap PC.

Use tracebacktrap in signal handlers.

Fixes #7690.

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

9 years agoruntime: update comment for Callers
Russ Cox [Wed, 29 Oct 2014 19:14:04 +0000 (15:14 -0400)]
runtime: update comment for Callers

Attempt to clear up confusion about how to turn
the PCs reported by Callers into the file and line
number people actually want.

Fixes #7690.

LGTM=r, chris.cs.guy
R=r, chris.cs.guy
CC=golang-codereviews
https://golang.org/cl/163550043

9 years ago[dev.garbage] all: merge dev.power64 (5ad5e85cfb99) into dev.garbage
Russ Cox [Wed, 29 Oct 2014 16:25:24 +0000 (12:25 -0400)]
[dev.garbage] all: merge dev.power64 (5ad5e85cfb99) into dev.garbage

The goal here is to get the big-endian fixes so that
in some upcoming code movement for write barriers
I don't make them unmergeable.

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