1
0
mirror of https://github.com/golang/go synced 2024-10-06 06:31:22 -06:00
Commit Graph

23777 Commits

Author SHA1 Message Date
Michael Matloob
73054f5729 [dev.ssa] cmd/compile/internal/ssa: adds for 8,16,32 bit ints
Change-Id: I33025a4a41fd91f6ee317d33a6eebf27fa00ab51
Reviewed-on: https://go-review.googlesource.com/11115
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-17 00:13:58 +00:00
Michael Matloob
0991ec454b [dev.ssa] cmd/compile/internal/ssa: set line in newValue variants
This CL sets line numbers on Values in the newValue variants
introduced in cl/10929.

Change-Id: Ibd15bc90631a1e948177878ea4191d995e8bb19b
Reviewed-on: https://go-review.googlesource.com/11090
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-17 00:12:24 +00:00
Josh Bleecher Snyder
a5c3b6642b [dev.ssa] cmd/compile/ssa: fix string compilation
Compilation of f_ssa was broken by CL 10929.

This CL does not include tests because
I have a work in progress CL that will catch
this and much more.

package p

func f_ssa() string {
	return "ABC"
}

Change-Id: I0ce0e905e4d30ec206cce808da406b9b7f0f38e9
Reviewed-on: https://go-review.googlesource.com/11136
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-16 23:38:59 +00:00
Keith Randall
50ceef26e6 [dev.ssa] cmd/compile/internal/ssa: Fix bootstrap of ssa codegen
The cmd/compile/internal/ssa/gen directory can't depend on cmd/internal/gc
because that package doesn't exist in go1.4.  Use strings instead of
constants from that package.

The asm fields seem somewhat redundant to the opcode names we
conventionally use.  Maybe we can just trim the lowercase from the end
of the op name?  At least by default?

Change-Id: I96e8cda44833763951709e2721588fbd34580989
Reviewed-on: https://go-review.googlesource.com/11129
Reviewed-by: Michael Matloob <michaelmatloob@gmail.com>
2015-06-16 21:28:21 +00:00
Michael Matloob
703ef06039 [dev.ssa] cmd/compile/internal/gc: reduce genValue redundancy
Add an asm field to opcodeTable containing the Prog's as field.
Then instructions that fill the Prog the same way can be collapsed
into a single switch case.

I'm still thinking of a better way to reduce redundancy, but
I think this might be a good temporary solution to prevent duplication
from getting out of control. What do you think?

Change-Id: I0c4a0992741f908bd357ee2707edb82e76e4ce61
Reviewed-on: https://go-review.googlesource.com/11130
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-16 19:37:59 +00:00
Daniel Morsing
3b817ef8f8 [dev.ssa] fix equivalence class after aux/auxint refactor.
This caused the following code snippet to be miscompiled

	var f int
	x := g(&f)
	f = 10

Moving the store of 10 above the function call.

Change-Id: Ic6951f5e7781b122cd881df324a38e519d6d66f0
Reviewed-on: https://go-review.googlesource.com/11073
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-15 12:06:05 +00:00
Daniel Morsing
c31b6dd0be [dev.ssa] initial implementation of PAUTO|PHEAP variables
Call to the runtime to generate escaping variables and use the returned
address when accessing these variables.

Fix a couple of errors on the way. The rule for CALLstatic was missed
during the Aux refactor and OCONVNOP wasn't converted.

Change-Id: I2096beff92cca92d648bfb6e8ec0b120f02f44af
Reviewed-on: https://go-review.googlesource.com/11072
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-14 20:01:03 +00:00
Michael Matloob
ea5cd68646 [dev.ssa] cmd/compile/internal/gc: fix call to newValue1
Change-Id: I235a759e4688358adc088cf5a80f8ce7ad12d2f2
Reviewed-on: https://go-review.googlesource.com/11093
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-14 17:36:24 +00:00
Michael Matloob
3a0df1f82a [dev.ssa] cmd/compile/internal/ssa: set Line in NewValue funcs
In the previous line number CL the NewValue\d? functions took
a line number argument but neglected to set the Line field on
the value struct. Fix that.

Change-Id: I53c79ff93703f66f5f0266178c94803719ae2074
Reviewed-on: https://go-review.googlesource.com/11054
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-14 16:46:01 +00:00
Michael Matloob
47791c1a18 [dev.ssa] cmd/compile/internal/gc: generate TESTQ instruction
TESTQ is produced by the IsNonNil lowering.

Change-Id: I9df8f17e6def7e34d07e3ddf2dd5dd8f0406aa04
Reviewed-on: https://go-review.googlesource.com/11053
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-14 16:45:20 +00:00
Daniel Morsing
2efdaefdb0 [dev.ssa] Protect control value from being moved away from end of block
If there isn't a value dependency between the control value of a
block and some other value, the schedule pass might move the control
value to a spot that is not EOB. Fix by handling the control value
specially like phis.

Change-Id: Iddaf0924d98c5b3d9515c3ced927b0c85722818c
Reviewed-on: https://go-review.googlesource.com/11071
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-14 16:40:40 +00:00
Keith Randall
8f22b5292f [dev.ssa] cmd/compiler/internal/ssa: Add auxint field
Add an additional int64 auxiliary field to Value.

There are two main reasons for doing this:
1) Ints in interfaces require allocation, and we store ints in Aux a lot.
2) I'd like to have both *gc.Sym and int offsets included in lots
   of operations (e.g. MOVQloadidx8).  It will be more efficient to
   store them as separate fields instead of a pointer to a sym/int pair.

It also simplifies a bunch of code.

This is just the refactoring.  I'll start using this some more in a
subsequent changelist.

Change-Id: I1ca797ff572553986cf90cab3ac0a0c1d01ad241
Reviewed-on: https://go-review.googlesource.com/10929
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-06-14 06:00:30 +00:00
Keith Randall
0ad9c8c720 [dev.ssa] cmd/compile/internal/gc: Small fixes
Allow labels to be unreachable via fallthrough from above.
Implement OCONVNOP.

Change-Id: I6869993cad8a27ad134dd637de89a40117daf47b
Reviewed-on: https://go-review.googlesource.com/11001
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2015-06-14 03:56:47 +00:00
Daniel Morsing
d5ad9ced1c [dev.ssa] clarify ODCL todo, remove irrelevant colas todo
ODCL nodes are used as the point where the variable is allocated in
the old pass. colas is irrelevant at this point of the compile. All
the checks on it happen at parse time and an ODCL node will have been
inserted right before it.

Change-Id: I1aca053aaa4363bacd12e1156de86fa7b6190a55
Reviewed-on: https://go-review.googlesource.com/10901
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-12 09:24:08 +00:00
Josh Bleecher Snyder
ba8a146af4 [dev.ssa] cmd/compile/ssa: print reg names in generated code
Change-Id: I6c6196449dd3d5e036d420fa7ae90feb0cf8d417
Reviewed-on: https://go-review.googlesource.com/10928
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-12 03:40:13 +00:00
Keith Randall
e707fbe1d7 [dev.ssa] Merge remote-tracking branch 'origin/master' into mbranch
Semi-regular merge of tip into dev.ssa.

Change-Id: Iec8e4266426bed233892e7dbe4448d16c8b89018
2015-06-11 11:06:21 -07:00
Brad Fitzpatrick
a788c913fa cmd/vet: skip another test on Android
Forgot this one in my previous commit.

Change-Id: Ief089e99bdad24b3bcfb075497dc259d06cc727c
Reviewed-on: https://go-review.googlesource.com/10913
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-11 16:30:56 +00:00
Chris Broadfoot
239ec73e66 cmd/go: reject relative paths that don't start with a dot (.)
Change-Id: Idc4a7fdb561ba5b3b52094d895deaf3fcdf475bf
Reviewed-on: https://go-review.googlesource.com/10716
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-11 16:13:37 +00:00
Brad Fitzpatrick
0beb931c76 cmd/go, cmd/vet: skip tests on Android
Might get the Android build passing, or at least going further.

Change-Id: I08f97156a687abe5a3d95203922f4ffd84fbb212
Reviewed-on: https://go-review.googlesource.com/10924
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-06-11 14:33:40 +00:00
Ainar Garipov
7f9f70e5b6 all: fix misprints in comments
These were found by grepping the comments from the go code and feeding
the output to aspell.

Change-Id: Id734d6c8d1938ec3c36bd94a4dbbad577e3ad395
Reviewed-on: https://go-review.googlesource.com/10941
Reviewed-by: Aamir Khan <syst3m.w0rm@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-11 14:18:57 +00:00
David du Colombier
15c8ab00e8 cmd/go: remove Stat workaround for Plan 9
This issue was fixed in CL 10900.

Change-Id: I88f107cb73c8a515f39e02506ddd2ad1e286b1fb
Reviewed-on: https://go-review.googlesource.com/10940
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-11 14:03:14 +00:00
David du Colombier
bd8e3d028e os: fix error returned by dirstat on Plan 9
When the Stat or Fstat system calls return -1,
dirstat incorrectly returns ErrShortStat.

However, the error returned by Stat or Fstat
could be different. For example, when the
file doesn't exist, they return "does not exist".

Dirstat should return the error returned by
the system call.

Fixes #10911.
Fixes #11132.

Change-Id: Icf242d203d256f12366b1e277f99b1458385104a
Reviewed-on: https://go-review.googlesource.com/10900
Run-TryBot: David du Colombier <0intro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-11 05:47:07 +00:00
Keith Randall
6f1884757f [dev.ssa] cmd/compile/internal/ssa: Complete 64-bit shifts
Implement correct Go shifts.

Allow multi-line rewrite rules.

Fix offset & alignment in stack alloc.

Change-Id: I0ae9e522c83df9205bbe4ab94bc0e43d16dace58
Reviewed-on: https://go-review.googlesource.com/10891
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-11 03:54:06 +00:00
Keith Randall
290d8fc14a [dev.ssa] cmd/compile/internal/ssa: add call opcodes
Add calls, particularly closure calls.

Reorg SSAable variable test for converting to SSA.

Change-Id: Ia75c04295e6b0b040122f97e2381836a393b7f42
Reviewed-on: https://go-review.googlesource.com/10912
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-06-11 03:10:01 +00:00
Patrick Mezard
d574b59fc7 os: fix a race between Process.signal() and wait() on Windows
Process.handle was accessed without synchronization while wait() and
signal() could be called concurrently.

A first solution was to add a Mutex in Process but it was probably too
invasive given Process.handle is only used on Windows.

This version uses atomic operations to read the handle value. There is
still a race between isDone() and the value of the handle, but it only
leads to slightly incorrect error codes. The caller may get a:

  errors.New("os: process already finished")

instead of:

  syscall.EINVAL

which sounds harmless.

Fixes #9382

Change-Id: Iefcc687a1166d5961c8f27154647b9b15a0f748a
Reviewed-on: https://go-review.googlesource.com/9904
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-06-11 01:33:25 +00:00
Ian Lance Taylor
dc32b7f0fd cmd/go: rewrite testsuite from bash to Go
Change-Id: I8473e3f7653d5389d5fcd94862f0831049b8266e
Reviewed-on: https://go-review.googlesource.com/10809
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-10 20:34:56 +00:00
Brad Fitzpatrick
1f029fa6d3 archive/zip: clarify that CreateHeader takes ownership of FileHeader
Fixes #11144

Change-Id: I1da0b72ef00a84c9b5751be0e72ad07d664bc98b
Reviewed-on: https://go-review.googlesource.com/10883
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2015-06-10 19:56:37 +00:00
Michael Matloob
81ccf508aa [dev.ssa] cmd/compile/internal/ssa: add line numbers to Values
Change-Id: I1dfffd75cc1f49307c654f910f7133c03da6c84f
Reviewed-on: https://go-review.googlesource.com/10559
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-10 15:01:13 +00:00
Ainar Garipov
4da658cf96 encoding/csv: fix comment in parseRecord
Change-Id: I82edd9364e1b4634006f5e043202a69f383dcdbe
Reviewed-on: https://go-review.googlesource.com/10826
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-10 14:26:10 +00:00
Alex Brainman
ab08f79af3 cmd/link: stop linker crashing with -s flag on windows
Update #10254

Change-Id: I3ddd26607813ca629e3ab62abf87dc5ab453e36f
Reviewed-on: https://go-review.googlesource.com/10835
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-06-10 06:49:23 +00:00
Yongjian Xu
93e57a22d5 runtime: correct a drifted comment in referencing m->locked.
Change-Id: Ida4b98aa63e57594fa6fa0b8178106bac9b3cd19
Reviewed-on: https://go-review.googlesource.com/10837
Reviewed-by: Minux Ma <minux@golang.org>
2015-06-10 06:15:20 +00:00
Josh Bleecher Snyder
e861c9ba36 .gitignore: ignore y.output
Change-Id: I95b72b6be39fbb923b5f0743d17d7f8bd3ee3814
Reviewed-on: https://go-review.googlesource.com/10860
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-10 00:28:52 +00:00
Burcu Dogan
032811e2ab misc/ios: document the external binary and the required env variables
Change-Id: I1ec2460758b19e5315be061033c1bb5ed9ead4a8
Reviewed-on: https://go-review.googlesource.com/9688
Reviewed-by: Minux Ma <minux@golang.org>
2015-06-09 22:09:52 +00:00
Josh Bleecher Snyder
442959ec47 cmd/compile: fix builtin generation
This was a refactoring bug during
'go tool compile', CL 10289.

Change-Id: Ibfd333be39ec72bba331fdf352df619cc21851a9
Reviewed-on: https://go-review.googlesource.com/10849
Reviewed-by: Minux Ma <minux@golang.org>
2015-06-09 21:26:39 +00:00
Adam Langley
2a5463e3a0 doc/go1.5.txt: mention that 1.5 supports non-standard GCM lengths.
Change-Id: I7cad3f7af2452e29b3dae3da87cbd24013f6dae6
Reviewed-on: https://go-review.googlesource.com/10850
Reviewed-by: Adam Langley <agl@golang.org>
2015-06-09 18:49:15 +00:00
Carl Jackson
50e657fbfa crypto/cipher: Support unusual GCM nonce lengths
GCM is traditionally used with a 96-bit nonce, but the standard allows
for nonces of any size. Non-standard nonce sizes are required in some
protocols, so add support for them in crypto/cipher's GCM
implementation.

Change-Id: I7feca7e903eeba557dcce370412b6ffabf1207ab
Reviewed-on: https://go-review.googlesource.com/8946
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-06-09 18:46:13 +00:00
Dmitry Savintsev
30ab39ac76 doc: updated language about the AUTHORS/CONTRIBUTORS update
Reflect the process changes where AUTHORS and CONTRIBUTORS
files are updated automatically based on commit logs
and Google committers no longer need to do it manually
on the first contributors.

The documentation update will help to avoid requests to be
added from new contributors.

Change-Id: I67daae5bd21246cf79fe3724838889b929bc5e66
Reviewed-on: https://go-review.googlesource.com/10824
Reviewed-by: Rob Pike <r@golang.org>
2015-06-09 18:31:57 +00:00
Josh Bleecher Snyder
a44becef4a cmd/compile: use generated temps in bool codegen
Bool codegen was generating a temp for function calls
and other complex expressions, but was not using it.

This was a refactoring bug introduced by CL 7853.
The cmp code used to do (in short):

	l, r := &n1, &n2

It was changed to:

	l, r := nl, nr

But the requisite assignments:

	nl, nr = &n1, &n2

were only introduced on one of two code paths.

Fixes #10654.

Change-Id: Ie8de0b3a333842a048d4308e02911bb10c6915ce
Reviewed-on: https://go-review.googlesource.com/10844
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-09 17:38:26 +00:00
Adam Langley
c72b8aa3b3 crypto/tls: don't require an explicit client-auth EKU.
Previously we enforced both that the extended key usages of a client
certificate chain allowed for client authentication, and that the
client-auth EKU was in the leaf certificate.

This change removes the latter requirement. It's still the case that the
chain must be compatible with the client-auth EKU (i.e. that a parent
certificate isn't limited to another usage, like S/MIME), but we'll now
accept a leaf certificate with no EKUs for client-auth.

While it would be nice if all client certificates were explicit in their
intended purpose, I no longer feel that this battle is worthwhile.

Fixes #11087.

Change-Id: I777e695101cbeba069b730163533e2977f4dc1fc
Reviewed-on: https://go-review.googlesource.com/10806
Reviewed-by: Andrew Gerrand <adg@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-06-09 15:48:24 +00:00
Michael Matloob
43a2676ff0 [dev.ssa] cmd/compile/internal/ssa: delete lowergeneric.go
It's been replaced by rewritegeneric.go

Change-Id: I2658abbc6201ecfedae4513c6da04ea3cac8bb9c
Reviewed-on: https://go-review.googlesource.com/10846
Reviewed-by: Keith Randall <khr@golang.org>
2015-06-09 15:29:12 +00:00
Shenghou Ma
b39487b68d go/build: add big endian variant of arm and arm64 to goarch list
Change-Id: Icda8475a7879d49e3b8b873303eb0bed5dd5a238
Reviewed-on: https://go-review.googlesource.com/10792
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-06-09 09:56:10 +00:00
Mikio Hara
aff7a573d1 net: disable dualstack listener tests on dragonfly
Change-Id: Ia7914156e4369113dea7c17b3aa51096e25f1901
Reviewed-on: https://go-review.googlesource.com/10834
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-06-09 08:21:21 +00:00
Brad Fitzpatrick
10425507fd cmd/dist: move guts of race.bash into dist
After a little build coordinator change, this will get us sharding of
the race builder.

Update #11074

Change-Id: I4c55267563b6f5e213def7dd6707c837ae2106bf
Reviewed-on: https://go-review.googlesource.com/10845
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-09 05:22:37 +00:00
Hyang-Ah (Hana) Kim
c9778ec302 cmd/link/internal/ld: include table of contents of c-archive output.
Change-Id: If11621985c0a5a1f2133cdc974f37fd944b93e5e
Reviewed-on: https://go-review.googlesource.com/10808
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-06-09 00:55:11 +00:00
Josh Bleecher Snyder
494ff188f8 cmd/compile: early typecheck top level OAS2 nodes
Fixes #10977.

Change-Id: I706c953c16daad48595c7fae2d82124614dfc3ad
Reviewed-on: https://go-review.googlesource.com/10780
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
2015-06-09 00:25:02 +00:00
Adam Langley
e597e63d6a doc/go1.5.txt: mention that testing/quick now generates nil pointers.
Change-Id: I358b17304f95fdd8e6c0a64fa29f185c701fe338
Reviewed-on: https://go-review.googlesource.com/10805
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-09 00:04:06 +00:00
Håvard Haugen
7089ea4e47 testing/quick: probabilistically generate nil pointers
The documentation for quick.Value says that it "returns an arbitrary
value of the given type." In spite of this, nil values for pointers were
never generated, which seems more like an oversight than an intentional
choice.

The lack of nil values meant that testing recursive type like

  type Node struct {
  	Next *Node
  }

with testing/quick would lead to a stack overflow since the data
structure would never terminate.

This change may break tests that don't check for nil with pointers
returned from quick.Value. Two such instances were found in the standard
library, one of which was in the testing/quick package itself.

Fixes #8818.

Change-Id: Id390dcce649d12fbbaa801ce6f58f5defed77e60
Reviewed-on: https://go-review.googlesource.com/10821
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-06-08 21:19:13 +00:00
Keith Randall
0dca7351e9 [dev.ssa] cmd/compile/internal/ssa: autogenerate opcodes
Revamp autogeneration.  Get rid of gogenerate commands, they are more
trouble than they are worth.  (If the code won't compile, gogenerate
doesn't work.)

Generate opcode enums & tables.  This means we only have to specify
opcodes in one place instead of two.

Add arch prefixes to opcodes so they will be globally unique.

Change-Id: I175d0a89b701b2377bbe699f3756731b7c9f5a9f
Reviewed-on: https://go-review.googlesource.com/10812
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-06-08 21:02:03 +00:00
Robert Griesemer
13e2412876 cmd/vet: remove dependency on types.New
- remove TODO on non-existing fmt.Formatter type
  (type exists now)
- guard uses of imported types against nil

Change-Id: I9ae8e5a448e73c84dec1606ea9d9ed5ddeee8dc6
Reviewed-on: https://go-review.googlesource.com/10777
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-06-08 20:52:07 +00:00
Russ Cox
433c0bc769 runtime: avoid fault in heapBitsBulkBarrier
Change-Id: I0512e461de1f25cb2a1cb7f23e7a77d00700667c
Reviewed-on: https://go-review.googlesource.com/10803
Reviewed-by: Russ Cox <rsc@golang.org>
2015-06-08 20:24:00 +00:00