]> Cypherpunks.ru repositories - gostls13.git/log
gostls13.git
12 years agoweekly.2011-06-09 weekly.2011-06-09
Andrew Gerrand [Fri, 10 Jun 2011 04:26:09 +0000 (14:26 +1000)]
weekly.2011-06-09

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4601052

12 years agoimage: add Paletted.Set, and a basic test of the concrete image types.
Nigel Tao [Fri, 10 Jun 2011 04:07:29 +0000 (14:07 +1000)]
image: add Paletted.Set, and a basic test of the concrete image types.

R=r
CC=golang-dev
https://golang.org/cl/4589045

12 years agosync/atomic: fix arm check64 bug
Andrew Gerrand [Fri, 10 Jun 2011 03:50:19 +0000 (13:50 +1000)]
sync/atomic: fix arm check64 bug

R=r, rsc
CC=golang-dev
https://golang.org/cl/4571059

12 years agogopack: make unused page function a fatal error
Dave Cheney [Fri, 10 Jun 2011 02:41:19 +0000 (22:41 -0400)]
gopack: make unused page function a fatal error

R=iant, rsc
CC=golang-dev
https://golang.org/cl/4601051

12 years agohttp: fix regression permitting io.Copy on HEAD response
Brad Fitzpatrick [Fri, 10 Jun 2011 01:10:21 +0000 (18:10 -0700)]
http: fix regression permitting io.Copy on HEAD response

With the ReadFrom change in the sendfile CL, it became
possible to illegally send a response to a HEAD request if you
did it via io.Copy.

Fixes #1939

R=rsc
CC=golang-dev
https://golang.org/cl/4584049

12 years agogopack: remove warning from the use of mktemp
Dave Cheney [Fri, 10 Jun 2011 01:04:26 +0000 (18:04 -0700)]
gopack: remove warning from the use of mktemp

gcc-4.6 considers mktemp to be racey

R=golang-dev, rsc, iant
CC=golang-dev
https://golang.org/cl/4602050

12 years agomail: decode RFC 2047-encoded words, not phrases.
David Symonds [Thu, 9 Jun 2011 22:47:27 +0000 (08:47 +1000)]
mail: decode RFC 2047-encoded words, not phrases.

R=rsc, r, bradfitz
CC=golang-dev
https://golang.org/cl/4590047

12 years ago5l: fix softfloat nits
Russ Cox [Thu, 9 Jun 2011 22:38:25 +0000 (18:38 -0400)]
5l: fix softfloat nits

Need to load math.a so that sqrtGoC is available.
Also was missing prototype.

R=ken2
CC=golang-dev
https://golang.org/cl/4517148

12 years agogc: compactframe breaks arm - fix build
Russ Cox [Thu, 9 Jun 2011 22:28:27 +0000 (18:28 -0400)]
gc: compactframe breaks arm - fix build

R=lvd
CC=golang-dev
https://golang.org/cl/4591063

12 years agogc: nit
Luuk van Dijk [Thu, 9 Jun 2011 22:08:57 +0000 (00:08 +0200)]
gc: nit

R=rsc
CC=golang-dev
https://golang.org/cl/4604041

12 years ago5l: delete dead code
Russ Cox [Thu, 9 Jun 2011 22:07:56 +0000 (18:07 -0400)]
5l: delete dead code

Thumb code and ARM pre-V4 code is unused,
unmaintained, and almost certainly wrong by now.
Every time I try to change 5l I have to sort out
what's dead code and what's not.

30% of lines of code in this directory deleted.

R=ken2
CC=golang-dev
https://golang.org/cl/4601049

12 years agogc: compact stackframe
Luuk van Dijk [Thu, 9 Jun 2011 22:02:34 +0000 (00:02 +0200)]
gc: compact stackframe

After allocparams and walk, remove unused auto variables
and re-layout the remaining in reverse alignment order.

R=rsc
CC=golang-dev
https://golang.org/cl/4568068

12 years agomath: add sqrt_arm.s and sqrtGoC.go as fallback to soft fp emulation
Fan Hongjian [Thu, 9 Jun 2011 21:19:08 +0000 (17:19 -0400)]
math: add sqrt_arm.s and sqrtGoC.go as fallback to soft fp emulation
5a: add SQRTF and SQRTD
5l: add ASQRTF and ASQRTD

Use ARMv7 VFP VSQRT instruction to speed up math.Sqrt

R=rsc, dave, m
CC=golang-dev
https://golang.org/cl/4551082

12 years agoA+C: Fan Hongjian (individual CLA)
Russ Cox [Thu, 9 Jun 2011 21:18:28 +0000 (17:18 -0400)]
A+C: Fan Hongjian (individual CLA)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4591059

12 years agoruntime: improve memmove
Quan Yong Zhai [Thu, 9 Jun 2011 20:49:47 +0000 (16:49 -0400)]
runtime: improve memmove
check memory overlap

R=rsc, r, ken, edsrzf
CC=golang-dev
https://golang.org/cl/4602047

12 years agogc: nits
Russ Cox [Thu, 9 Jun 2011 15:44:28 +0000 (11:44 -0400)]
gc: nits

R=ken2
CC=golang-dev
https://golang.org/cl/4572052

12 years agoAC: s/Jeffrey M Hodges/Jeff Hodges/
Rob Pike [Thu, 9 Jun 2011 07:47:01 +0000 (17:47 +1000)]
AC: s/Jeffrey M Hodges/Jeff Hodges/
Formality rejected.

R=jeff
CC=golang-dev
https://golang.org/cl/4591057

12 years agoruntime: increase maximum number of windows callbacks
Alex Brainman [Thu, 9 Jun 2011 00:29:25 +0000 (10:29 +1000)]
runtime: increase maximum number of windows callbacks

Fixes #1912.

R=rsc
CC=golang-dev
https://golang.org/cl/4591047

12 years agomail: decode "Q"-encoded mail addresses.
David Symonds [Thu, 9 Jun 2011 00:18:36 +0000 (10:18 +1000)]
mail: decode "Q"-encoded mail addresses.

Supports ISO-8859-1 and UTF-8.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4568064

12 years agocompress/lzw: reduce decoder buffer size from 3*4096 to 2*4096.
Nigel Tao [Wed, 8 Jun 2011 23:50:38 +0000 (09:50 +1000)]
compress/lzw: reduce decoder buffer size from 3*4096 to 2*4096.

This happens to speed up the decoder benchmarks by 50% on my computer
(GOARCH=amd64 GOOS=linux), but I don't have a good intuition as to why.
For example, just adding an unused [4096]byte field to the decoder
struct doesn't significantly change the numbers.

Before:

lzw.BenchmarkDecoder1e4     5000     488057 ns/op   20.49 MB/s
lzw.BenchmarkDecoder1e5      500    4613638 ns/op   21.67 MB/s
lzw.BenchmarkDecoder1e6       50   45672260 ns/op   21.90 MB/s
lzw.BenchmarkEncoder1e4     5000     353563 ns/op   28.28 MB/s
lzw.BenchmarkEncoder1e5      500    3431618 ns/op   29.14 MB/s
lzw.BenchmarkEncoder1e6       50   34009640 ns/op   29.40 MB/s

After:

lzw.BenchmarkDecoder1e4     5000     339725 ns/op   29.44 MB/s
lzw.BenchmarkDecoder1e5      500    3166894 ns/op   31.58 MB/s
lzw.BenchmarkDecoder1e6       50   31317260 ns/op   31.93 MB/s
lzw.BenchmarkEncoder1e4     5000     354909 ns/op   28.18 MB/s
lzw.BenchmarkEncoder1e5      500    3432710 ns/op   29.13 MB/s
lzw.BenchmarkEncoder1e6       50   34010500 ns/op   29.40 MB/s

R=rsc, r
CC=golang-dev
https://golang.org/cl/4535123

12 years agohttp: fix handling of 0-lengthed http requests
Brad Fitzpatrick [Wed, 8 Jun 2011 22:59:23 +0000 (15:59 -0700)]
http: fix handling of 0-lengthed http requests

Via Russ Ross' bug report on golang-nuts, it was not possible
to send an HTTP request with a zero length body with either a
Content-Length (it was stripped) or chunking (it wasn't set).

This means Go couldn't upload 0-length objects to Amazon S3.
(which aren't as silly as they might sound, as S3 objects can
have key/values associated with them, set in the headers)

Amazon further doesn't supported chunked uploads. (not Go's
problem, but we should be able to let users set an explicit
Content-Length, even if it's zero.)

To fix the ambiguity of an explicit zero Content-Length and
the Request struct's default zero value, users need to
explicit set TransferEncoding to []string{"identity"} to force
the Request.Write to include a Content-Length: 0.  identity is
in RFC 2616 but is ignored pretty much everywhere.  We don't
even then serialize it on the wire, since it's kinda useless,
except as an internal sentinel value.

The "identity" value is then documented, but most users can
ignore that because NewRequest now sets that.

And adds more tests.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4603041

12 years agohttp: change most map[string][]string types to new Values type
Brad Fitzpatrick [Wed, 8 Jun 2011 20:38:20 +0000 (13:38 -0700)]
http: change most map[string][]string types to new Values type

This replaces most the map[string][]string usage with
a new Values type name, with the usual methods.

It also changes client.PostForm to take a Values, rather
than a map[string]string, closing a TODO in the code.

R=rsc
CC=golang-dev
https://golang.org/cl/4532123

12 years agogofmt: update test script so that it passes again
Robert Griesemer [Wed, 8 Jun 2011 19:05:40 +0000 (12:05 -0700)]
gofmt: update test script so that it passes again

(TODO: should replace this with a Go program, eventually)

R=bradfitz
CC=golang-dev
https://golang.org/cl/4584047

12 years agobig: removed some gratuitous +/-1's
Robert Griesemer [Wed, 8 Jun 2011 18:24:24 +0000 (11:24 -0700)]
big: removed some gratuitous +/-1's

R=mtj, bradfitz
CC=golang-dev
https://golang.org/cl/4584046

12 years agogo spec: handle a corner case of a special case for shifts...
Robert Griesemer [Wed, 8 Jun 2011 16:11:18 +0000 (09:11 -0700)]
go spec: handle a corner case of a special case for shifts...

- Added some additional examples.
- 6g appears to implement this semantics already.

Fixes #658.

R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/4538119

12 years agoebnf: follow EBNF for EBNF faithfully
Robert Griesemer [Wed, 8 Jun 2011 16:10:30 +0000 (09:10 -0700)]
ebnf: follow EBNF for EBNF faithfully

Apply analogous changes in godoc/spec.go.

Fixes #1829.

R=nmessenger, r
CC=golang-dev
https://golang.org/cl/4528127

12 years agobig: gobs for big rats
Robert Griesemer [Wed, 8 Jun 2011 16:10:01 +0000 (09:10 -0700)]
big: gobs for big rats

Fixes #1926.

R=r
CC=golang-dev
https://golang.org/cl/4550122

12 years agoos: fix Getenv for Plan 9. Truncate the rightmost char if it is '\0'.
Yuval Pavel Zholkover [Wed, 8 Jun 2011 13:44:03 +0000 (09:44 -0400)]
os: fix Getenv for Plan 9. Truncate the rightmost char if it is '\0'.

R=mirtchovski, ality, taruti, rsc
CC=golang-dev
https://golang.org/cl/4386046

12 years agoruntime: SysMap uses MAP_FIXED if needed on 64-bit Linux
Jonathan Mark [Wed, 8 Jun 2011 04:50:10 +0000 (21:50 -0700)]
runtime: SysMap uses MAP_FIXED if needed on 64-bit Linux

This change was adapted from gccgo's libgo/runtime/mem.c at
Ian Taylor's suggestion.  It fixes all.bash failing with
"address space conflict: map() =" on amd64 Linux with kernel
version 2.6.32.8-grsec-2.1.14-modsign-xeon-64.
With this change, SysMap will use MAP_FIXED to allocate its desired
address space, after first calling mincore to check that there is
nothing else mapped there.

R=iant, dave, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/4438091

12 years agoA+C: Jonathan Mark (individual CLA)
Ian Lance Taylor [Wed, 8 Jun 2011 04:49:24 +0000 (21:49 -0700)]
A+C: Jonathan Mark (individual CLA)

R=adg, rsc
CC=golang-dev
https://golang.org/cl/4595042

12 years agomail: format addresseses correctly.
David Symonds [Wed, 8 Jun 2011 03:32:47 +0000 (13:32 +1000)]
mail: format addresseses correctly.

Also remove an obsolete TODO while I'm here.

R=r, rsc
CC=golang-dev
https://golang.org/cl/4588041

12 years agogc: alternative clang compatible abort.
Dave Cheney [Wed, 8 Jun 2011 00:46:15 +0000 (10:46 +1000)]
gc: alternative clang compatible abort.

Tested on clang 2.9/amd64

R=rsc, jeff, r
CC=golang-dev
https://golang.org/cl/4517143

12 years agobig.nat: Improved speed of nat-to-string conversion
Michael T. Jones [Tue, 7 Jun 2011 23:02:34 +0000 (16:02 -0700)]
big.nat: Improved speed of nat-to-string conversion

Three optimizations: First, special-case power of two bases
that partion a Word(), bases 2, 4, 16, and 256. These can
be moved directly from internal Word() storage to the output
without multiprecision operations. Next, same approach for
the other power-of-two bases, 8, 32, 64, and 128. These
don't fill a Word() evenly, so special handling is needed
for those cases where input spans the high-bits of one Word
and the low bis of the next one.  Finally, implement the
general case for others bases in 2 <= base <= 256 using
superbases, the largest power of base representable in a
Word(). For base ten, this is 9 digits and a superbase of
10^9 for 32-bit Words and 19 digits and 10^19 for 64-bit
compiles. This way we do just 1/9th or 1/19th of the expensive
multiprecision divisions, unpacking superdigits using fast
native machine arithmetic. The resulting code runs 7x to
800x the speed of the previous approach, depending on the
length of the number to be converted--longer is relatively
faster.

Also, extended the tests and benchmarks for string to nat
(scan()) and nat to string (string()) functions. A further
enhancement awaits the next CL to make general cases about
7x faster for long cases.

R=gri
CC=golang-dev
https://golang.org/cl/4595041

12 years agoC+A: add Michael T. Jones (Google, gmail account)
Robert Griesemer [Tue, 7 Jun 2011 23:02:12 +0000 (16:02 -0700)]
C+A: add Michael T. Jones (Google, gmail account)

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4598041

12 years agoexec: export the underlying *os.Process in Cmd
Brad Fitzpatrick [Tue, 7 Jun 2011 20:17:34 +0000 (13:17 -0700)]
exec: export the underlying *os.Process in Cmd

R=rsc
CC=golang-dev
https://golang.org/cl/4579044

12 years agonet: fix bug in net.Interfaces: handle elastic sdl_data size correctly
Mikio Hara [Tue, 7 Jun 2011 20:06:36 +0000 (16:06 -0400)]
net: fix bug in net.Interfaces: handle elastic sdl_data size correctly

Fixes #1921.

R=golang-dev, jeff
CC=golang-dev
https://golang.org/cl/4535120

12 years agogofix: fix diff regression from exec change
Brad Fitzpatrick [Tue, 7 Jun 2011 18:53:47 +0000 (11:53 -0700)]
gofix: fix diff regression from exec change

Also pass -u to diff to be consistent with gofmt.

Fixes #1619

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4591041

12 years agocompress/lzw: do not use background goroutines
Russ Cox [Tue, 7 Jun 2011 18:37:06 +0000 (14:37 -0400)]
compress/lzw: do not use background goroutines

Programs expect that Read and Write are synchronous.
The background goroutines make the implementation
a little easier, but they introduce asynchrony that
trips up calling code.  Remove them.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/4548080

12 years agogodefs: do not assume forward type references are enums
Robert Hencke [Tue, 7 Jun 2011 18:28:10 +0000 (14:28 -0400)]
godefs: do not assume forward type references are enums

Fixes #1466.

R=mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/4564043

12 years agold: fix and simplify ELF symbol generation
Anthony Martin [Tue, 7 Jun 2011 18:26:16 +0000 (14:26 -0400)]
ld: fix and simplify ELF symbol generation

I started looking at this code because the nm in GNU
binutils was ignoring the first symbol in the .symtab
section.  Apparently, the System V ABI reserves the
first entry and requires all fields inside to be set
to zero.

The list of changes is as follows:

  · reserve the first symbol entry (as noted above)
  · fix the section indices for .data and .bss symbols
  · factor out common code for Elf32 and Elf64
  · remove the special case for elfsymo in [568]l/asm.c:/^asmb
  · add the "etext" symbol in 6l
  · add static symbols

R=rsc
CC=golang-dev
https://golang.org/cl/4524075

12 years agoC+A: added Michael T. Jones (Google)
Robert Griesemer [Tue, 7 Jun 2011 17:07:50 +0000 (10:07 -0700)]
C+A: added Michael T. Jones (Google)

R=bradfitz
CC=golang-dev
https://golang.org/cl/4528126

12 years agogc/lex.c: fix formatting of #include statement
Caine Tighe [Tue, 7 Jun 2011 16:57:26 +0000 (09:57 -0700)]
gc/lex.c: fix formatting of #include statement

R=rsc, gri
CC=golang-dev
https://golang.org/cl/4564048

12 years agogofmt: fix -d regression from exec change
Brad Fitzpatrick [Tue, 7 Jun 2011 16:38:04 +0000 (09:38 -0700)]
gofmt: fix -d regression from exec change

Fixes #1916

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4590041

12 years agostrconv: change Quote to be Unicode-friendly,
Rob Pike [Tue, 7 Jun 2011 12:23:08 +0000 (12:23 +0000)]
strconv: change Quote to be Unicode-friendly,
add QuoteToASCII.
The Quote and QuoteRune functions now let printable
runes (as defined by unicode.IsPrint) through.  When
true 7-bit clean stuff is necessary, there are now two
new functions: QuoteToASCII and QuoteRuneToASCII.

Printf("%q") uses Quote. To get the old behavior, it
will now be necessary to say
        Printf("%s", strconv.QuoteToASCII(s))
but that should rarely be necessary.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4561061

12 years agoimage/gif: fix buglet in graphics extension.
Rob Pike [Tue, 7 Jun 2011 12:19:36 +0000 (12:19 +0000)]
image/gif: fix buglet in graphics extension.
need to ReadFull, not Read, to get extension data.

R=nigeltao
CC=golang-dev
https://golang.org/cl/4576043

12 years agocgo: support non intel gcc machine flags
Dave Cheney [Tue, 7 Jun 2011 06:59:35 +0000 (16:59 +1000)]
cgo: support non intel gcc machine flags

R=adg
CC=golang-dev
https://golang.org/cl/4528124

12 years agohtml: improve attribute parsing, note package status
Brad Fitzpatrick [Mon, 6 Jun 2011 22:56:15 +0000 (15:56 -0700)]
html: improve attribute parsing, note package status

Fixes #1890

R=nigeltao
CC=golang-dev
https://golang.org/cl/4528102

12 years agotemplate: rearrange the code into separate files.
Rob Pike [Mon, 6 Jun 2011 21:33:02 +0000 (21:33 +0000)]
template: rearrange the code into separate files.
The single file was getting unwieldy.
Also remove use of vector; a slice works fine - although
it's an unusual one.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/4576042

12 years agobig: Rat always outputs the requested precision from FloatString
Graham Miller [Mon, 6 Jun 2011 19:59:58 +0000 (12:59 -0700)]
big: Rat always outputs the requested precision from FloatString

Fixes #1922.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4551098

12 years agocrypto: reorg, cleanup and add function for generating CRLs.
Adam Langley [Mon, 6 Jun 2011 14:35:46 +0000 (10:35 -0400)]
crypto: reorg, cleanup and add function for generating CRLs.

This change moves a number of common PKIX structures into
crypto/x509/pkix, from where x509, and ocsp can reference
them, saving duplication. It also removes x509/crl and merges it into
x509 and x509/pkix.

x509 is changed to take advantage of the big.Int support that now
exists in asn1. Because of this, the public/private key pair in
http/httptest/server.go had to be updated because it was serialised
with an old version of the code that didn't zero pad ASN.1 INTEGERs.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4532115

12 years agogobuilder: number of fixes
Alex Brainman [Mon, 6 Jun 2011 12:17:28 +0000 (22:17 +1000)]
gobuilder: number of fixes

1) runLog to return err==nil if program runs, but returns exitcode!=0;
2) runLog to return err!=nil when fails to create log file;
3) print failed program name, not just "all.bash".

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4532117

12 years agogc: enable building under clang/2.9
Dave Cheney [Mon, 6 Jun 2011 09:53:44 +0000 (19:53 +1000)]
gc: enable building under clang/2.9

To build under clang, pass the path to clang in CC when
calling ./make.bash

CC=/opt/llvm/llvm-2.9/bin/clang ./make.bash

Credit goes to jmhodges for suggestions.

R=jeff, r, ality
CC=golang-dev
https://golang.org/cl/4527098

12 years agoos: add Process.Kill and Process.Signal
Evan Shaw [Mon, 6 Jun 2011 09:53:30 +0000 (19:53 +1000)]
os: add Process.Kill and Process.Signal

R=alex.brainman, r, rsc, krasin, iant, rsc, r
CC=golang-dev
https://golang.org/cl/4437091

12 years agolibmach: use the standardized format for designated initializers.
Jeffrey M Hodges [Mon, 6 Jun 2011 06:56:09 +0000 (06:56 +0000)]
libmach: use the standardized format for designated initializers.
The brace style in these files are a little inconsistent so I rolled with
it on a per-file basis.

R=dave, r
CC=golang-dev
https://golang.org/cl/4515194

12 years agonetchan: added drain method to importer.
David Jakob Fritz [Mon, 6 Jun 2011 06:55:32 +0000 (06:55 +0000)]
netchan: added drain method to importer.

Fixes #1868.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4550093

12 years agoCONTRIBUTORS: C+A for David Jakob Fritz and Jeffrey M Hodges
Rob Pike [Mon, 6 Jun 2011 06:54:40 +0000 (06:54 +0000)]
CONTRIBUTORS: C+A for David Jakob Fritz and Jeffrey M Hodges

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4572043

12 years agomail: address list parsing.
David Symonds [Mon, 6 Jun 2011 06:46:14 +0000 (16:46 +1000)]
mail: address list parsing.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/4547084

12 years agocrypto/twofish: fix Reset index overflow bug.
Andrew Gerrand [Mon, 6 Jun 2011 04:30:48 +0000 (14:30 +1000)]
crypto/twofish: fix Reset index overflow bug.

Fixes #1919.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4530110

12 years agoimage/tiff: support for bit depths other than 8.
Benny Siegert [Mon, 6 Jun 2011 04:11:29 +0000 (14:11 +1000)]
image/tiff: support for bit depths other than 8.

At the moment, 16-bit samples are reduced to 8 bits, this will
be changed in a separate CL.

R=nigeltao
CC=golang-dev
https://golang.org/cl/4552057

12 years agodoc: don't insert paragraphs inside pre blocks
Andrew Gerrand [Mon, 6 Jun 2011 03:33:05 +0000 (13:33 +1000)]
doc: don't insert paragraphs inside pre blocks
doc: update go_tutorial

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4568056

12 years agodashboard: bug fix
Andrew Gerrand [Mon, 6 Jun 2011 00:41:11 +0000 (10:41 +1000)]
dashboard: bug fix

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4535104

12 years agogo/build: fix windows build by commenting out references to stdout and stderr in...
Alex Brainman [Mon, 6 Jun 2011 00:11:41 +0000 (10:11 +1000)]
go/build: fix windows build by commenting out references to stdout and stderr in cgotest

R=golang-dev, r, adg
CC=golang-dev
https://golang.org/cl/4561062

12 years agogo/build: exclude cgo test from arm
Andrew Gerrand [Sun, 5 Jun 2011 23:25:30 +0000 (09:25 +1000)]
go/build: exclude cgo test from arm
go/build: include command output in error values
go/build: add syslist.go to .hgignore

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4550118

13 years agoimage/draw: move exp/draw to image/draw and exp/gui.
Nigel Tao [Sun, 5 Jun 2011 04:27:38 +0000 (14:27 +1000)]
image/draw: move exp/draw to image/draw and exp/gui.

R=r
CC=golang-dev
https://golang.org/cl/4515191

13 years agogo/build: new package for building go programs
Andrew Gerrand [Sat, 4 Jun 2011 02:45:09 +0000 (12:45 +1000)]
go/build: new package for building go programs

R=rsc
CC=golang-dev
https://golang.org/cl/4433047

13 years agounicode: for consistency with MaxRune, s/Latin1Max/MaxLatin1/ and
Rob Pike [Fri, 3 Jun 2011 23:28:27 +0000 (09:28 +1000)]
unicode: for consistency with MaxRune, s/Latin1Max/MaxLatin1/ and
s/ASCIIMax/MaxASCII/

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/4539109

13 years agounicode: add the first few property tests for printing.
Rob Pike [Fri, 3 Jun 2011 21:46:22 +0000 (07:46 +1000)]
unicode: add the first few property tests for printing.

The long-term goal is that %q will use IsPrint to decide
what to show natively vs. as hexadecimal.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4526095

13 years agoebnf: update comment
Robert Griesemer [Fri, 3 Jun 2011 20:02:35 +0000 (13:02 -0700)]
ebnf: update comment

(pointed out by jan.mercl@nic.cz)

R=iant, jan.mercl, rsc
CC=golang-dev
https://golang.org/cl/4515189

13 years agohttp: don't fail on accept hitting EMFILE
Brad Fitzpatrick [Fri, 3 Jun 2011 19:23:50 +0000 (12:23 -0700)]
http: don't fail on accept hitting EMFILE

Fixes #1891

R=rsc
CC=golang-dev
https://golang.org/cl/4550112

13 years agonet: fix windows build
Mikio Hara [Fri, 3 Jun 2011 19:16:05 +0000 (15:16 -0400)]
net: fix windows build

R=rsc
CC=golang-dev
https://golang.org/cl/4539108

13 years agonet: add network interface identification API
Mikio Hara [Fri, 3 Jun 2011 18:35:42 +0000 (14:35 -0400)]
net: add network interface identification API

This CL introduces new API into package net to identify the network
interface.  A functionality of new API is very similar to RFC3493 -
"Interface Identification".

R=r, gri, bradfitz, robert.hencke, fullung, rsc
CC=golang-dev
https://golang.org/cl/4437087

13 years ago8g: compute register liveness during regopt
Russ Cox [Fri, 3 Jun 2011 18:10:39 +0000 (14:10 -0400)]
8g: compute register liveness during regopt

Input code like

0000 (x.go:2) TEXT    main+0(SB),$36-0
0001 (x.go:3) MOVL    $5,i+-8(SP)
0002 (x.go:3) MOVL    $0,i+-4(SP)
0003 (x.go:4) MOVL    $1,BX
0004 (x.go:4) MOVL    i+-8(SP),AX
0005 (x.go:4) MOVL    i+-4(SP),DX
0006 (x.go:4) MOVL    AX,autotmp_0000+-20(SP)
0007 (x.go:4) MOVL    DX,autotmp_0000+-16(SP)
0008 (x.go:4) MOVL    autotmp_0000+-20(SP),CX
0009 (x.go:4) CMPL    autotmp_0000+-16(SP),$0
0010 (x.go:4) JNE     ,13
0011 (x.go:4) CMPL    CX,$32
0012 (x.go:4) JCS     ,14
0013 (x.go:4) MOVL    $0,BX
0014 (x.go:4) SHLL    CX,BX
0015 (x.go:4) MOVL    BX,x+-12(SP)
0016 (x.go:5) MOVL    x+-12(SP),AX
0017 (x.go:5) CDQ     ,
0018 (x.go:5) MOVL    AX,autotmp_0001+-28(SP)
0019 (x.go:5) MOVL    DX,autotmp_0001+-24(SP)
0020 (x.go:5) MOVL    autotmp_0001+-28(SP),AX
0021 (x.go:5) MOVL    autotmp_0001+-24(SP),DX
0022 (x.go:5) MOVL    AX,(SP)
0023 (x.go:5) MOVL    DX,4(SP)
0024 (x.go:5) CALL    ,runtime.printint+0(SB)
0025 (x.go:5) CALL    ,runtime.printnl+0(SB)
0026 (x.go:6) RET     ,

is problematic because the liveness range for
autotmp_0000 (0006-0009) is nested completely
inside a span where BX holds a live value (0003-0015).
Because the register allocator only looks at 0006-0009
to see which registers are used, it misses the fact that
BX is unavailable and uses it anyway.

The n->pun = anyregalloc() check in tempname is
a workaround for this bug, but I hit it again because
I did the tempname call before allocating BX, even
though I then used the temporary after storing in BX.
This should fix the real bug, and then we can remove
the workaround in tempname.

The code creates pseudo-variables for each register
and includes that information in the liveness propagation.
Then the regu fields can be populated using that more
complete information.  With that approach, BX is marked
as in use on every line in the whole span 0003-0015,
so that the decision about autotmp_0000
(using only 0006-0009) still has all the information
it needs.

This is not specific to the 386, but it only happens in
generated code of the form

        load R1
        ...
        load var into R2
        ...
        store R2 back into var
        ...
        use R1

and for the most part the other compilers generate
the loads for a given compiled line before any of
the stores.  Even so, this may not be the case everywhere,
so the change is worth making in all three.

R=ken2, ken, ken
CC=golang-dev
https://golang.org/cl/4529106

13 years agotesting: check that tests and benchmarks do not affect GOMAXPROCS
Dmitriy Vyukov [Fri, 3 Jun 2011 17:50:44 +0000 (13:50 -0400)]
testing: check that tests and benchmarks do not affect GOMAXPROCS

Plus fix spoiling of GOMAXPROCS in 2 existing rwmutex tests.
Plus fix benchmark output to stdout (now it outputs to stderr like all other output).

R=rsc
CC=golang-dev
https://golang.org/cl/4529111

13 years ago8l, ld: Initial adjustments for Plan 9 native compilation of 8l
Lucio De Re [Fri, 3 Jun 2011 17:20:31 +0000 (13:20 -0400)]
8l, ld: Initial adjustments for Plan 9 native compilation of 8l

These changes are not particularly invasive and have been tested
as broadly as possible.

8l/l.h:
  - #pragma varargck: added some, removed duplicates.

ld/dwarf.c:
  - As Plan 9 has no NULL, changed all occurrences to nil.
  - Added USED(size); where necessary.
  - Added (void) argument in definition of finddebugruntimepath().
  - Plan 9 compiler was complaining about multiple
        assignments, repeaired by breaking up the commands.
  - Correction: havedynamic = 1; restored.

ld/go.c:
  - Needed USED(file); in two functions.
  - Removed unused assignments flagged by the Plan 9 compiler.

ld/lib.c:
  - Replaced unlink() with remove() which seems available everywhere.
  - Removed USED(c4); and USED(magic) no longer required.
  - Removed code flagged as unused by the Plan 9 compiler.
  - Added attributes to a number of format strings.

R=rsc
CC=golang-dev
https://golang.org/cl/4435047

13 years agogc: renamed walkdef to typecheckdef and moved from walk to typedef.
Luuk van Dijk [Fri, 3 Jun 2011 15:44:02 +0000 (17:44 +0200)]
gc: renamed walkdef to typecheckdef and moved from walk to typedef.

also inlined a typechecking function in dcl away.

R=rsc
CC=golang-dev
https://golang.org/cl/4550115

13 years agodashboard: add favicon.ico
Andrew Gerrand [Fri, 3 Jun 2011 05:27:28 +0000 (15:27 +1000)]
dashboard: add favicon.ico

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4547082

13 years agoimage: rename Contains and ContainsRectangle to In.
Nigel Tao [Fri, 3 Jun 2011 03:18:15 +0000 (13:18 +1000)]
image: rename Contains and ContainsRectangle to In.

R=r
CC=golang-dev
https://golang.org/cl/4539104

13 years agogc: allow tags on parameters in export section of object files.
Luuk van Dijk [Fri, 3 Jun 2011 01:54:56 +0000 (03:54 +0200)]
gc: allow tags on parameters in export section of object files.

This is in preparation of escape analysis; function parameters
can now be tagged with interesting bits by the compiler by
assigning to n->note.

tested by having typecheck put a fake tag on all parameters of
pointer type and compiling the tree.

R=rsc
CC=golang-dev
https://golang.org/cl/4524092

13 years agoexp/draw: fix clipping bug where sp/mp were not shifted when r.Min was.
Nigel Tao [Fri, 3 Jun 2011 01:43:54 +0000 (11:43 +1000)]
exp/draw: fix clipping bug where sp/mp were not shifted when r.Min was.

image: add Rectangle.ContainsRectangle method.

R=r, rsc
CC=golang-dev
https://golang.org/cl/4517130

13 years agotag weekly.2011-06-02
Andrew Gerrand [Fri, 3 Jun 2011 01:20:02 +0000 (11:20 +1000)]
tag weekly.2011-06-02

R=r
CC=golang-dev
https://golang.org/cl/4551092

13 years agoweekly.2011-06-02 weekly.2011-06-02
Andrew Gerrand [Fri, 3 Jun 2011 01:18:34 +0000 (11:18 +1000)]
weekly.2011-06-02

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4548091

13 years agodoc: add Belarusian FAQ translation
Andrew Gerrand [Thu, 2 Jun 2011 23:48:42 +0000 (09:48 +1000)]
doc: add Belarusian FAQ translation

R=golang-dev, dchest
CC=golang-dev
https://golang.org/cl/4564057

13 years agofmt: fix bug in UnreadRune: must clear memory of previous
Rob Pike [Thu, 2 Jun 2011 21:53:50 +0000 (07:53 +1000)]
fmt: fix bug in UnreadRune: must clear memory of previous
rune if input implements UnreadRune; otherwise the lookahead
will lie.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4548082

13 years agoexec: change exec.PathError to exec.Error
Rob Pike [Thu, 2 Jun 2011 21:48:06 +0000 (07:48 +1000)]
exec: change exec.PathError to exec.Error
There were two issues:
1) It might not be a path error, it might be 'permission denied'.
2) The concept of $PATH is Unix-specific.

R=alex.brainman, rsc, r, mattn.jp
CC=golang-dev
https://golang.org/cl/4530096

13 years agohttp: ServeFile shouldn't send Content-Length when Content-Encoding is set
Brad Fitzpatrick [Thu, 2 Jun 2011 20:36:52 +0000 (13:36 -0700)]
http: ServeFile shouldn't send Content-Length when Content-Encoding is set

Fixes #1905

R=rsc
CC=golang-dev
https://golang.org/cl/4538111

13 years agobig: remove some unnecessary conversions
Robert Griesemer [Thu, 2 Jun 2011 19:58:26 +0000 (12:58 -0700)]
big: remove some unnecessary conversions

R=rsc
CC=golang-dev
https://golang.org/cl/4529110

13 years agohttp: catch panics
Brad Fitzpatrick [Thu, 2 Jun 2011 19:00:26 +0000 (12:00 -0700)]
http: catch panics

R=rsc
CC=golang-dev
https://golang.org/cl/4559067

13 years agobig: do not modify divisor
Robert Griesemer [Thu, 2 Jun 2011 18:07:41 +0000 (11:07 -0700)]
big: do not modify divisor

Fixes #1907.

R=rsc
CC=golang-dev
https://golang.org/cl/4527096

13 years agoexec: add Cmd methods StdinPipe, StdoutPipe, StderrPipe
Brad Fitzpatrick [Thu, 2 Jun 2011 17:26:09 +0000 (10:26 -0700)]
exec: add Cmd methods StdinPipe, StdoutPipe, StderrPipe

It gets annoying to do this in caller code otherwise,
especially having to remember to Close one side.

R=rsc
CC=golang-dev
https://golang.org/cl/4517134

13 years agosync/atomic: fix check64
Russ Cox [Thu, 2 Jun 2011 17:13:51 +0000 (13:13 -0400)]
sync/atomic: fix check64

The LDREXD and STREXD instructions require
aligned addresses, and the ARM stack is not
guaranteed to be aligned during the check.
This may cause other problems later (on the ARM
not all 64-bit pointers may be 64-bit aligned)
but at least the check is correct now.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4564053

13 years agoexec: missing docs, errors
Brad Fitzpatrick [Thu, 2 Jun 2011 16:57:24 +0000 (09:57 -0700)]
exec: missing docs, errors

R=rsc
CC=golang-dev
https://golang.org/cl/4550111

13 years agogc: typecheck the whole tree before walking. preparation for some escape-analysis...
Luuk van Dijk [Thu, 2 Jun 2011 16:48:17 +0000 (18:48 +0200)]
gc: typecheck the whole tree before walking.  preparation for some escape-analysis related changes.

R=rsc
CC=golang-dev
https://golang.org/cl/4528116

13 years agopath/filepath: skip permission test in all.bash
Russ Cox [Thu, 2 Jun 2011 16:26:43 +0000 (12:26 -0400)]
path/filepath: skip permission test in all.bash

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4517132

13 years agotesting: fix MB/s computation, documentation
Dmitriy Vyukov [Thu, 2 Jun 2011 14:52:46 +0000 (10:52 -0400)]
testing: fix MB/s computation, documentation

R=rsc
CC=golang-dev
https://golang.org/cl/4529100

13 years agonet, syscall: update IP multicast socket options for darwin, freebsd, linux
Mikio Hara [Thu, 2 Jun 2011 14:10:17 +0000 (10:10 -0400)]
net, syscall: update IP multicast socket options for darwin, freebsd, linux

Add IPv6Mreq and Inet6Pktinfo for specifying the network interface.
Rename IpMreq to IPMreq, SetsockoptIpMreq to SetsockoptIPMreq.

R=rsc, dave, robert.hencke
CC=golang-dev
https://golang.org/cl/4532098

13 years agotemplate: explain that fields must be exported.
Rob Pike [Thu, 2 Jun 2011 14:09:42 +0000 (00:09 +1000)]
template: explain that fields must be exported.
Fixes #1792.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4548083

13 years agocompress/flate: do not use background goroutines
Russ Cox [Thu, 2 Jun 2011 13:32:38 +0000 (09:32 -0400)]
compress/flate: do not use background goroutines

Programs expect that Read and Write are synchronous.
The background goroutines make the implementation
a little easier, but they introduce asynchrony that
trips up calling code.  Remove them.

R=golang-dev, krasin
CC=golang-dev
https://golang.org/cl/4548079

13 years agoimage: add a SubImage method.
Nigel Tao [Thu, 2 Jun 2011 08:51:41 +0000 (18:51 +1000)]
image: add a SubImage method.

R=r
CC=golang-dev
https://golang.org/cl/4515179

13 years agoruntime: do not garbage collect windows callbacks
Alex Brainman [Thu, 2 Jun 2011 07:08:56 +0000 (17:08 +1000)]
runtime: do not garbage collect windows callbacks

Fixes #1883.
Fixes #1702.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4532103

13 years agodoc: add link to App Engine docs to front page
Andrew Gerrand [Thu, 2 Jun 2011 01:00:24 +0000 (11:00 +1000)]
doc: add link to App Engine docs to front page

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4539100