]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agogodoc: replace direct OS file system accesses in favor
Robert Griesemer [Wed, 15 Jun 2011 21:06:35 +0000 (14:06 -0700)]
godoc: replace direct OS file system accesses in favor
       of accesses via a FileSystem interface.

Preparation for appengine version which gets its files
via a snapshot or zip file and uses a corresponding
FileSystem implementation.

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

13 years agodoc/effective_go.html: replace tab with spaces.
Rob Pike [Wed, 15 Jun 2011 14:13:18 +0000 (00:13 +1000)]
doc/effective_go.html: replace tab with spaces.

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

13 years agohttp: use runtime/debug.Stack() to dump stack trace on panic.
Rob Pike [Wed, 15 Jun 2011 14:12:50 +0000 (00:12 +1000)]
http: use runtime/debug.Stack() to dump stack trace on panic.
Test output now looks like this:

2011/06/15 21:10:41 http: panic serving 127.0.0.1:59729: intentional death for testing
$GOROOT/src/pkg/http/server.go:495 (0x3f9f8)
        _func_004: buf.Write(debug.Stack())
$GOROOT/src/pkg/runtime/proc.c:1041 (0x12367)
        panic: reflect·call(d->fn, d->args, d->siz);
$GOROOT/src/pkg/http/serve_test.go:775 (0x5831b)
        _func_029: panic("intentional death for testing")
$GOROOT/src/pkg/http/server.go:575 (0x26366)
        HandlerFunc.ServeHTTP: f(w, r)
$GOROOT/src/pkg/http/server.go:541 (0x261a9)
        *conn.serve: c.handler.ServeHTTP(w, w.req)
$GOROOT/src/pkg/runtime/proc.c:178 (0x10a83)
        goexit: runtime·goexit(void)

with $GOROOT expanded, of course.

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

13 years agogo/build: better, self-contained tests
Andrew Gerrand [Wed, 15 Jun 2011 11:35:34 +0000 (21:35 +1000)]
go/build: better, self-contained tests

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

13 years agogofix: Fix inconsistent indentation in help output
Scott Lawrence [Wed, 15 Jun 2011 11:07:21 +0000 (21:07 +1000)]
gofix: Fix inconsistent indentation in help output

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

13 years agogo/build: remove crud in cgotest/_obj
Dave Cheney [Wed, 15 Jun 2011 06:39:17 +0000 (16:39 +1000)]
go/build: remove crud in cgotest/_obj

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

13 years agogo/build: fix build and clean ups
Andrew Gerrand [Wed, 15 Jun 2011 04:56:12 +0000 (14:56 +1000)]
go/build: fix build and clean ups

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

13 years agogo/build: record all cgo intermediate files (fix build)
Andrew Gerrand [Wed, 15 Jun 2011 04:29:26 +0000 (14:29 +1000)]
go/build: record all cgo intermediate files (fix build)

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

13 years agogoinstall: use go/make package to scan and build packages
Andrew Gerrand [Wed, 15 Jun 2011 03:28:35 +0000 (13:28 +1000)]
goinstall: use go/make package to scan and build packages

R=rsc, n13m3y3r, kevlar
CC=golang-dev
https://golang.org/cl/4515180

13 years agosyscall: mksyscall_windows.pl should output unix newline.
Yasuhiro Matsumoto [Wed, 15 Jun 2011 01:50:21 +0000 (11:50 +1000)]
syscall: mksyscall_windows.pl should output unix newline.

R=golang-dev, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/4601058

13 years agomail: cosmetic fixes.
David Symonds [Tue, 14 Jun 2011 23:10:59 +0000 (09:10 +1000)]
mail: cosmetic fixes.

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

13 years agoexp/regexp/syntax: more escapes, character classes
Russ Cox [Tue, 14 Jun 2011 18:30:10 +0000 (14:30 -0400)]
exp/regexp/syntax: more escapes, character classes

Still TODO: parsing optimizations

make_perl_groups.pl is copied with minimal modifications
(just to generate Go syntax instead of C++) from RE2.
Google Inc is "The RE2 Author" of that file and is one of
the Go Authors, so copyright changed to the Go Authors instead.

R=sam.thorogood, r, fvbommel, robert.hencke
CC=golang-dev
https://golang.org/cl/4612041

13 years agobuild: fix header files for Plan 9
Lucio De Re [Tue, 14 Jun 2011 18:14:11 +0000 (14:14 -0400)]
build: fix header files for Plan 9

The "elf.h" header changes involve only comments, the released
Plan 9 C preprocessing function does not cope with multiline
comments following the #define keyword.  All multiline comments
have been moved to the line above the associated definition.
Sigh!  Fixing the Plan 9 compiler is not an option.

<time.h> does not exist in the Plan 9 Native library.  I have
moved it from src/cmd/ld/pe.h to include/u.h. RSC correctly points
out that this copy of <u.h> is not the one used to compile the
Go release on Plan 9 platforms.

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

13 years agold: make .rodata section read-only
Gustavo Niemeyer [Tue, 14 Jun 2011 18:13:54 +0000 (15:13 -0300)]
ld: make .rodata section read-only

Fixes the respective warning from elflint.

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

13 years agodebug/elf: rename test .o files to .obj
Gustavo Niemeyer [Tue, 14 Jun 2011 18:06:39 +0000 (15:06 -0300)]
debug/elf: rename test .o files to .obj

.o files are commonly found in default ignore lists by
source management tools, including dpkg-source, bzr, etc.

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

13 years agonet: export all fields in Interface
Mikio Hara [Tue, 14 Jun 2011 17:32:52 +0000 (13:32 -0400)]
net: export all fields in Interface

Fixes #1942.

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

13 years agosyscall: add ptrace on darwin
Jeff Hodges [Tue, 14 Jun 2011 16:56:46 +0000 (12:56 -0400)]
syscall: add ptrace on darwin

The ptrace syscall remains gutted on darwin, but usable.  This
also makes the syscall addition process reproducible on darwin
instead of relying on a file path in rsc's home directory.
I've also removed an override of $PATH in env.bash that made
tooling harder.

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

13 years agoxml: handle non-string attribute fields
Maxim Ushakov [Tue, 14 Jun 2011 15:51:03 +0000 (11:51 -0400)]
xml: handle non-string attribute fields

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

13 years agoexec: make LookPath work even when PATHEXT env variable is not set on Windows
Alex Brainman [Tue, 14 Jun 2011 15:46:05 +0000 (11:46 -0400)]
exec: make LookPath work even when PATHEXT env variable is not set on Windows

R=golang-dev, mattn.jp
CC=golang-dev
https://golang.org/cl/4559062

13 years agohttp/spdy: improve error handling.
William Chan [Tue, 14 Jun 2011 15:31:18 +0000 (11:31 -0400)]
http/spdy: improve error handling.

Create a new spdy.Error type that includes the enumerated error type and
the associated stream id (0 if not associated with a specific stream).
This will let users handle errors differently (RST_STREAM vs GOAWAY).

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

13 years agosyscall: fix Plan 9 build.
Yuval Pavel Zholkover [Tue, 14 Jun 2011 15:29:51 +0000 (11:29 -0400)]
syscall: fix Plan 9 build.
Move mmapper from syscall.go to syscall_unix.go.
Remove Sendfile from syscall_plan9.go.

R=rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/4368060

13 years agosyscall: update BPF support for BSD variants
Mikio Hara [Tue, 14 Jun 2011 15:28:36 +0000 (11:28 -0400)]
syscall: update BPF support for BSD variants

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

13 years agoos: Plan 9, fix OpenFile & Chmod. Update tests.
Yuval Pavel Zholkover [Tue, 14 Jun 2011 15:20:34 +0000 (11:20 -0400)]
os: Plan 9, fix OpenFile & Chmod. Update tests.
Add Process.Kill.

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

13 years agold: fix link Windows PE __declspec(dllimport) symbol
Wei Guangjing [Tue, 14 Jun 2011 15:05:59 +0000 (11:05 -0400)]
ld:  fix link Windows PE __declspec(dllimport) symbol

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

13 years agogc: frame compaction for arm.
Luuk van Dijk [Tue, 14 Jun 2011 15:03:37 +0000 (17:03 +0200)]
gc: frame compaction for arm.

Required moving some parts of gc/pgen.c to ?g/ggen.c

on linux tests pass for all 3 architectures, and
frames are actually compacted (diagnostic code for
that has been removed from the CL).

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

13 years agosyscall, os, exec: introduce *syscall.SysProcAttr field in os.ProcAttr and exec.Cmd
Russ Cox [Tue, 14 Jun 2011 14:49:34 +0000 (10:49 -0400)]
syscall, os, exec: introduce *syscall.SysProcAttr field in os.ProcAttr and exec.Cmd

R=r, bradfitz, alex.brainman, borman, vincent.vanackere
CC=golang-dev
https://golang.org/cl/4607046

13 years agomail: decode RFC 2047 "B" encoding.
David Symonds [Tue, 14 Jun 2011 07:32:47 +0000 (17:32 +1000)]
mail: decode RFC 2047 "B" encoding.

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

13 years agodoc/gopher: add a small gif to use as an app engine logo on GAE pages.
Rob Pike [Tue, 14 Jun 2011 07:25:57 +0000 (17:25 +1000)]
doc/gopher: add a small gif to use as an app engine logo on GAE pages.

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

13 years agodoc/gopher: add jpgs of the goggled gopher logo for App Engine.
Rob Pike [Tue, 14 Jun 2011 06:42:52 +0000 (16:42 +1000)]
doc/gopher: add jpgs of the goggled gopher logo for App Engine.

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

13 years agoos: be explicit in the package comment that this package is for portable features...
Rob Pike [Tue, 14 Jun 2011 01:49:33 +0000 (11:49 +1000)]
os: be explicit in the package comment that this package is for portable features only.

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

13 years agogo spec: specify constant conversions
Robert Griesemer [Mon, 13 Jun 2011 23:47:33 +0000 (16:47 -0700)]
go spec: specify constant conversions

This is not a language change.

Added paragraphs specifying which conversions
yield results that are constants.

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

13 years agogo spec: unsafe.Alignof/Offsetof/Sizeof return uintptr
Robert Griesemer [Mon, 13 Jun 2011 23:46:42 +0000 (16:46 -0700)]
go spec: unsafe.Alignof/Offsetof/Sizeof return uintptr

This is (indirectly) a language change. Per e-mail discussion
on golang-dev.

Fixes #1943.

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

13 years agobuild: stop early if commands are missing
Russ Cox [Mon, 13 Jun 2011 19:28:54 +0000 (15:28 -0400)]
build: stop early if commands are missing

If we fail due to a missing command (always bison)
during the build, it is running many things in parallel
and the error message gets lost in the noise.
Also diagnose bison++.

$ ./make.bash
Your system's bison is bison++, a buggy copy of the original bison.
Go needs the original bison instead.
See http://golang.org/doc/install.html#ctools
$ sudo apt-get remove bison++
... ridiculous amount of output ...
$ ./make.bash
Cannot find 'bison' on search path.
See http://golang.org/doc/install.html#ctools
$ sudo apt-get install bison
... ridiculous amount of output ...
$ ./make.bash
... works

Fixes #1938.
Fixes #1946.

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

13 years agocgo: handle new Apple LLVM-based gcc from Xcode 4.2
Russ Cox [Mon, 13 Jun 2011 18:43:54 +0000 (14:43 -0400)]
cgo: handle new Apple LLVM-based gcc from Xcode 4.2

That gcc does not include enumerator names and values
in its DWARF debug output.  Create a data block from which
we can read the values instead.

Fixes #1881.

R=iant
CC=golang-dev
https://golang.org/cl/4607045

13 years agocrypto/openpgp: flesh out Encrypt by adding support for signing.
Adam Langley [Mon, 13 Jun 2011 17:04:59 +0000 (13:04 -0400)]
crypto/openpgp: flesh out Encrypt by adding support for signing.

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

13 years agold: dwarf emit filenames in debug_line header instead of as extended opcodes.
Luuk van Dijk [Mon, 13 Jun 2011 14:56:43 +0000 (16:56 +0200)]
ld: dwarf emit filenames in debug_line header instead of as extended opcodes.

Makes it possible for older tools like objdump to find the filenames,
fixes  objdump -d -l --start-address=0x400c00 --stop-address=0x400c36 6.out
fixes #1950

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

13 years agoexp/regexp/syntax: syntax data structures, parser
Russ Cox [Mon, 13 Jun 2011 13:20:23 +0000 (09:20 -0400)]
exp/regexp/syntax: syntax data structures, parser

Parser is a work in progress but can populate most of the
interesting parts of the data structure, so a good checkpoint.
All the complicated Perl syntax is missing, as are various
important optimizations made during parsing to the
syntax tree.

The plan is that exp/regexp's API will mimic regexp,
and exp/regexp/syntax provides the parser directly
for programs that need it (and for implementing exp/regexp).

Once finished, exp/regexp will replace regexp.

R=r, sam.thorogood, kevlar, edsrzf
CC=golang-dev
https://golang.org/cl/4538123

13 years agogc: handle go print() and go println()
Stephen Ma [Mon, 13 Jun 2011 12:50:51 +0000 (22:50 +1000)]
gc: handle go print() and go println()

Fixes #1952.

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

13 years agoexp/template: lexical scanner for new template package.
Rob Pike [Mon, 13 Jun 2011 06:08:35 +0000 (16:08 +1000)]
exp/template: lexical scanner for new template package.
An unusual design using slice and a goroutine makes for a
compact scanner with very little allocation.

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

13 years agonet: rearrange source files so we could run more tests on windows
Alex Brainman [Mon, 13 Jun 2011 00:22:31 +0000 (10:22 +1000)]
net: rearrange source files so we could run more tests on windows

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

13 years agogo spec: clarify rules for append, scope rules for :=
Robert Griesemer [Sun, 12 Jun 2011 19:09:50 +0000 (12:09 -0700)]
go spec: clarify rules for append, scope rules for :=

Fixes #1936.
Fixes #1940.

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

13 years agomime/multipart: allow for temp files to be removed after tests are finished on Windows
Alex Brainman [Sat, 11 Jun 2011 06:23:44 +0000 (16:23 +1000)]
mime/multipart: allow for temp files to be removed after tests are finished on Windows

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

13 years agonet: Sendfile for win32.
Yasuhiro Matsumoto [Sat, 11 Jun 2011 03:24:48 +0000 (13:24 +1000)]
net: Sendfile for win32.
implement using TransmitFile().

R=bsiegert, bradfitz, alex.brainman, rsc, go.peter.90
CC=golang-dev
https://golang.org/cl/4536076

13 years agogo/scanner: partially revert CL4538096 now that we have %#U for runes
Robert Griesemer [Sat, 11 Jun 2011 00:19:01 +0000 (17:19 -0700)]
go/scanner: partially revert CL4538096 now that we have %#U for runes

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

13 years agoio/ioutil: fix typo in comment
Robert Griesemer [Sat, 11 Jun 2011 00:07:22 +0000 (17:07 -0700)]
io/ioutil: fix typo in comment

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

13 years agofmt: debugging formats for characters: %+q %#U
Rob Pike [Sat, 11 Jun 2011 00:03:02 +0000 (00:03 +0000)]
fmt: debugging formats for characters: %+q %#U
%+q uses strconv.Quote[Rune]ToASCII, guaranteeing ASCII-only output.
%#U a quoted character if the rune is printable: 'x'=U+0078; otherwise
it's as before: U+000A.

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

13 years agosort: change IntArray etc. to IntSlice for better name hygiene.
Rob Pike [Fri, 10 Jun 2011 23:25:18 +0000 (09:25 +1000)]
sort: change IntArray etc. to IntSlice for better name hygiene.

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

13 years agoGo memory model: minor clarification
Robert Griesemer [Fri, 10 Jun 2011 19:31:10 +0000 (12:31 -0700)]
Go memory model: minor clarification

Fixes #1941.

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

13 years agocrypto/openpgp: build fix (unreviewed)
Adam Langley [Fri, 10 Jun 2011 17:32:20 +0000 (13:32 -0400)]
crypto/openpgp: build fix (unreviewed)

R=agl
CC=golang-dev
https://golang.org/cl/4572057

13 years agocrypto/openpgp: add ability to encrypt messages.
Adam Langley [Fri, 10 Jun 2011 16:58:14 +0000 (12:58 -0400)]
crypto/openpgp: add ability to encrypt messages.

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

13 years agobike/shed: new package.
David Symonds [Fri, 10 Jun 2011 12:32:45 +0000 (22:32 +1000)]
bike/shed: new package.

It comes up often enough that it's time to provide
the utility of a standard package.

R=r, mirtchovski, adg, rsc, n13m3y3r, ality, go.peter.90, lstoakes, iant, jan.mercl, bsiegert, robert.hencke, rogpeppe, befelemepeseveze, kevlar
CC=golang-dev
https://golang.org/cl/4557047

13 years agoruntime: fix Plan 9 "lingering goroutines bug".
Yuval Pavel Zholkover [Fri, 10 Jun 2011 07:23:54 +0000 (17:23 +1000)]
runtime: fix Plan 9 "lingering goroutines bug".

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

13 years agodocs: Update notes for 3-day Go course.
Rob Pike [Fri, 10 Jun 2011 05:05:51 +0000 (15:05 +1000)]
docs: Update notes for 3-day Go course.

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

13 years agotag weekly.2011-06-09
Andrew Gerrand [Fri, 10 Jun 2011 04:52:11 +0000 (14:52 +1000)]
tag weekly.2011-06-09

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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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

13 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