]> Cypherpunks repositories - gostls13.git/log
gostls13.git
13 years agoruntime: implement exception handling on windows/amd64
Hector Chu [Sat, 3 Sep 2011 08:27:16 +0000 (18:27 +1000)]
runtime: implement exception handling on windows/amd64

Fixes #2194.

R=rsc, alex.brainman, vcc.163, jp
CC=golang-dev
https://golang.org/cl/4977044

13 years agoexp/template/html: string replacement refactoring.
Nigel Tao [Sat, 3 Sep 2011 00:30:05 +0000 (10:30 +1000)]
exp/template/html: string replacement refactoring.

R=mikesamuel
CC=golang-dev
https://golang.org/cl/4968063

13 years agogc: introduce temp = nod+tempname
Russ Cox [Fri, 2 Sep 2011 19:35:16 +0000 (15:35 -0400)]
gc: introduce temp = nod+tempname

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

13 years agogc: zero stack-allocated slice backing arrays
Russ Cox [Fri, 2 Sep 2011 19:11:28 +0000 (15:11 -0400)]
gc: zero stack-allocated slice backing arrays

Fixes Han-Wen's termite bug.

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

13 years agogodoc: minor tweaks for app-engine use
Robert Griesemer [Fri, 2 Sep 2011 17:07:29 +0000 (10:07 -0700)]
godoc: minor tweaks for app-engine use

- read search index files in groutine to avoid
  start-up failure on app engine because reading
  the files takes too long
- permit usage of search index files and indexer
- minor cosmetic cleanups

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

13 years agoexp/norm: added Reader and Writer and bug fixes to support these.
Marcel van Lohuizen [Fri, 2 Sep 2011 10:39:35 +0000 (12:39 +0200)]
exp/norm: added Reader and Writer and bug fixes to support these.
Needed to ensure that finding the last boundary does not result in O(n^2)-like behavior.
Now prevents lookbacks beyond 31 characters across the board (starter + 30 non-starters).
composition.go:
- maxCombiningCharacters now means exactly that.
- Bug fix.
- Small performance improvement/ made code consistent with other code.
forminfo.go:
- Bug fix: ccc needs to be 0 for inert runes.
normalize.go:
- A few bug fixes.
- Limit the amount of combining characters considered in FirstBoundary.
- Ditto for LastBoundary.
- Changed semantics of LastBoundary to not consider trailing illegal runes a boundary
  as long as adding bytes might still make them legal.
trie.go:
- As utf8.UTFMax is 4, we should treat UTF-8 encodings of size 5 or greater as illegal.
  This has no impact on the normalization process, but it prevents buffer overflows
  where we expect at most UTFMax bytes.

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

13 years agofmt/fmt_test.go: count mallocs in a few more cases.
Rob Pike [Fri, 2 Sep 2011 01:47:15 +0000 (11:47 +1000)]
fmt/fmt_test.go: count mallocs in a few more cases.
Interesting that Fprintf can do zero mallocs.
(Sprintf must allocate the returned string.)

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

13 years agotemplate: fix deadlock.
Rob Pike [Fri, 2 Sep 2011 01:00:46 +0000 (11:00 +1000)]
template: fix deadlock.
No need for lexInsideAction to loop.
Fixes #2217.

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

13 years agoexp/template/html: non-semantics changing tweaks to js{,_test}.go
Mike Samuel [Fri, 2 Sep 2011 00:28:00 +0000 (10:28 +1000)]
exp/template/html: non-semantics changing tweaks to js{,_test}.go

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

13 years agogoinstall: better usage message
Andrew Gerrand [Fri, 2 Sep 2011 00:07:47 +0000 (10:07 +1000)]
goinstall: better usage message

Fixes #2185.

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

13 years agosync/atomic: add LoadUintptr
Dmitriy Vyukov [Thu, 1 Sep 2011 19:17:25 +0000 (15:17 -0400)]
sync/atomic: add LoadUintptr

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

13 years agogc: fix label recursion bugs
Russ Cox [Thu, 1 Sep 2011 17:44:46 +0000 (13:44 -0400)]
gc: fix label recursion bugs

Was keeping a pointer to the labeled statement in n->right,
which meant that generic traversals of the tree visited it twice.
That combined with aggressive flattening of the block
structure when possible during parsing meant that
the kinds of label: code label: code label: code sequences
generated by yacc were giving the recursion 2ⁿ paths
through the program.

Fixes #2212.

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

13 years agolibmach: fix incorrect use of memset
Dave Cheney [Thu, 1 Sep 2011 17:43:03 +0000 (13:43 -0400)]
libmach: fix incorrect use of memset

Fixes #2213.

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

13 years agotag weekly.2011-09-01
Nigel Tao [Thu, 1 Sep 2011 07:30:41 +0000 (17:30 +1000)]
tag weekly.2011-09-01

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

13 years agosudo.bash: print error/exit if problem with /usr/local/bin
Mike Rosset [Thu, 1 Sep 2011 07:24:32 +0000 (17:24 +1000)]
sudo.bash: print error/exit if problem with /usr/local/bin

When installing profiling tools on Mac OS X print
message if there is a problem with /usr/local/bin

Fixes #2209.

R=golang-dev, r, adg
CC=golang-dev, mike.rosset
https://golang.org/cl/4950057

13 years agoweekly.2011-09-01 weekly.2011-09-01
Nigel Tao [Thu, 1 Sep 2011 07:08:53 +0000 (17:08 +1000)]
weekly.2011-09-01

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

13 years agoexp/template/html: Implement grammar for JS.
Mike Samuel [Thu, 1 Sep 2011 02:03:40 +0000 (12:03 +1000)]
exp/template/html: Implement grammar for JS.

This transitions into a JS state when entering any attribute whose
name starts with "on".

It does not yet enter a JS on entry into a <script> element as script
element handling is introduced in another CL.

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

13 years agogo spec: update section on Implementation Differences
Robert Griesemer [Wed, 31 Aug 2011 22:16:51 +0000 (15:16 -0700)]
go spec: update section on Implementation Differences

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

13 years agounsafe: update doc
Mikio Hara [Wed, 31 Aug 2011 21:59:35 +0000 (17:59 -0400)]
unsafe: update doc

changeset: 8812:3fb3e88d5aa8
gc: unsafe.Alignof, unsafe.Offsetof, unsafe.Sizeof now return uintptr

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

13 years agoflag: add Parsed, restore Usage
Russ Cox [Wed, 31 Aug 2011 21:38:41 +0000 (17:38 -0400)]
flag: add Parsed, restore Usage

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

13 years agogodoc: more index size reduction
Robert Griesemer [Wed, 31 Aug 2011 21:01:58 +0000 (14:01 -0700)]
godoc: more index size reduction

- KindRuns don't need to repeat SpotKind,
  it is stored in each Spot
- removed extra indirection from FileRuns
  to KindRuns
- slight reduction of written index size
  (~500KB)

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

13 years agorpc: add benchmark for async rpc calls
Dmitriy Vyukov [Wed, 31 Aug 2011 17:07:25 +0000 (13:07 -0400)]
rpc: add benchmark for async rpc calls
Also makes sync benchmark concurrent.

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

13 years agosyscall: handle routing entry in ParseRoutingSockaddr on BSD variants
Mikio Hara [Wed, 31 Aug 2011 17:05:49 +0000 (13:05 -0400)]
syscall: handle routing entry in ParseRoutingSockaddr on BSD variants

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

13 years agocgo: explain how to free something
Russ Cox [Wed, 31 Aug 2011 12:17:01 +0000 (08:17 -0400)]
cgo: explain how to free something

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

13 years agogc: make static initialization more static
Russ Cox [Wed, 31 Aug 2011 11:37:14 +0000 (07:37 -0400)]
gc: make static initialization more static

Does as much as possible in data layout instead
of during the init function.

Handles var x = y; var y = z as a special case too,
because it is so prevalent in package unicode
(var Greek = _Greek; var _Greek = []...).

Introduces InitPlan description of initialized data
so that it can be traversed multiple times (for example,
in the copy handler).

Cuts package unicode's init function size by 8x.
All that remains there is map initialization, which
is on the chopping block too.

Fixes sinit.go test case.

Aggregate DATA instructions at end of object file.

Checkpoint.  More to come.

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

13 years agoruntime: handle string + char literals in goc2c
Russ Cox [Wed, 31 Aug 2011 11:11:31 +0000 (07:11 -0400)]
runtime: handle string + char literals in goc2c

My string literal was being rewritten from
"runtime.SysReserve(%p, %D) = error %d"
to
"runtime.SysReserve ( %p , %D ) = error %d"

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

13 years agoruntime: make arm work on Ubuntu Natty qemu
Russ Cox [Wed, 31 Aug 2011 11:02:46 +0000 (07:02 -0400)]
runtime: make arm work on Ubuntu Natty qemu

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

13 years agocgo: note that CString result must be freed
Gustavo Niemeyer [Wed, 31 Aug 2011 09:44:55 +0000 (06:44 -0300)]
cgo: note that CString result must be freed

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

13 years agoexp/wingui: made compatible with windows/amd64
Jaroslavas Počepko [Wed, 31 Aug 2011 05:39:50 +0000 (15:39 +1000)]
exp/wingui: made compatible with windows/amd64

R=golang-dev, alex.brainman
CC=golang-dev, vcc.163
https://golang.org/cl/4974041

13 years agohttp: add file protocol transport
Brad Fitzpatrick [Wed, 31 Aug 2011 04:47:41 +0000 (21:47 -0700)]
http: add file protocol transport

Off by default (security risk), but users can
wire it up if desired.

Fixes #2113

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

13 years agogodoc index: first step towards reducing index size
Robert Griesemer [Wed, 31 Aug 2011 01:47:15 +0000 (18:47 -0700)]
godoc index: first step towards reducing index size

- canonicalize package descriptors
- remove duplicate storage of file paths
- reduces (current) written index file by approx 3.5MB
(from 28434237B to 24686643B, or 13%)

- next step: untangle DAG (when serializing, using
gob, the index dag explodes into an index tree)

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

13 years agoimage: add PalettedImage interface, and make image/png recognize it.
Jaroslavas Počepko [Tue, 30 Aug 2011 22:27:00 +0000 (08:27 +1000)]
image: add PalettedImage interface, and make image/png recognize it.

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

13 years agocgo: fix GoBytes
Gustavo Niemeyer [Tue, 30 Aug 2011 17:33:16 +0000 (14:33 -0300)]
cgo: fix GoBytes

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

13 years agogc: fix for Plan 9 build
Lucio De Re [Tue, 30 Aug 2011 13:40:46 +0000 (09:40 -0400)]
gc: fix for Plan 9 build

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

13 years agodashboard: yet another utf-8 fix
Russ Cox [Tue, 30 Aug 2011 13:00:33 +0000 (09:00 -0400)]
dashboard: yet another utf-8 fix

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

13 years agogc: fix div bug
Russ Cox [Tue, 30 Aug 2011 12:47:28 +0000 (08:47 -0400)]
gc: fix div bug

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

13 years agoruntime: windows/amd64 callbacks fixed and syscall fixed to allow using it in callbacks
Jaroslavas Počepko [Tue, 30 Aug 2011 12:02:02 +0000 (22:02 +1000)]
runtime: windows/amd64 callbacks fixed and syscall fixed to allow using it in callbacks
Fixes #2178.
Patch2: Fixed allocating shadow space for stdcall (must be at least 32 bytes in any case)
Patch3: Made allocated chunk smaller.
Patch4: Typo
Patch5: suppress linktime warning "runtime.callbackasm: nosplit stack overflow"
Patch6: added testcase src/pkg/syscall/callback_windows_test.go
Patch7: weakly related files moved to https://golang.org/cl/4965050 https://golang.org/cl/4974041 https://golang.org/cl/4965051
Patch8: reflect changes https://golang.org/cl/4926042/
Patch9: reflect comments

R=golang-dev, alex.brainman, vcc.163
CC=golang-dev, hectorchu
https://golang.org/cl/4958042

13 years agogc: fix for Plan 9 build
Lucio De Re [Tue, 30 Aug 2011 12:00:07 +0000 (08:00 -0400)]
gc: fix for Plan 9 build

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

13 years agowindows/386: clean stack after syscall (it is necessary after call cdecl functions...
Jaroslavas Počepko [Tue, 30 Aug 2011 04:43:54 +0000 (14:43 +1000)]
windows/386: clean stack after syscall (it is necessary after call cdecl functions and does not have an effect after stdcall)

Result of discussion here: http://groups.google.com/group/golang-nuts/browse_thread/thread/357c806cbb57ca62

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

13 years agoexp/template/html: Added handling for URL attributes.
Mike Samuel [Tue, 30 Aug 2011 01:42:30 +0000 (11:42 +1000)]
exp/template/html: Added handling for URL attributes.

1. adds a urlPart field to context
2. implements tURL to figure out the URL part
3. modifies joinContext to allow common context mismatches
   around branches to be ignored when not material as in
   <a href="/foo{{if .HasQuery}}?q={{.Query}}{{/if}}">
4. adds a pipeline function that filters dynamically inserted
   protocols to prevent code injection via URLs.

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

13 years agogodoc: support for reading/writing (splitted) index files.
Robert Griesemer [Tue, 30 Aug 2011 00:22:20 +0000 (17:22 -0700)]
godoc: support for reading/writing (splitted) index files.

This CL implements a new godoc feature to save the search
index on disk. Use -write_index to create the search
index file named with -index_files. Use -index_files to
provide a glob pattern specifying index file(s) when
starting godoc; in this case the run-time indexer is not
run.

Known issues:
- saving/restoring full text index is not yet supported
- the list of flags and overall usage logic could use a
  cleanup

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

13 years agogodoc: fix bug in zip.go
Robert Griesemer [Mon, 29 Aug 2011 23:49:31 +0000 (16:49 -0700)]
godoc: fix bug in zip.go

The result of sort.Search is in the interval [0,n);
specifically, if no entry is found, the result is n
and not -1.

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

13 years agogoinstall: select the tag that is closest to runtime.Version
Andrew Gerrand [Mon, 29 Aug 2011 23:37:22 +0000 (09:37 +1000)]
goinstall: select the tag that is closest to runtime.Version

release.r50 looks for newest tag <= go.r50
weekly.2010-10-10 looks for newest tag <= go.2010-10-10

Implements behavior for hg, git, and bzr.

R=dsymonds, rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/4873057

13 years agojson: add struct tag option to wrap literals in strings
Brad Fitzpatrick [Mon, 29 Aug 2011 19:46:32 +0000 (12:46 -0700)]
json: add struct tag option to wrap literals in strings

Since JavaScript doesn't have [u]int64 types, some JSON APIs
encode such types as strings to avoid losing precision.

This adds a new struct tag option ",string" to cause
fields to be wrapped in JSON strings on encoding
and unwrapped from strings when decoding.

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

13 years agodoc/progs: fix windows/amd64
Jaroslavas Počepko [Mon, 29 Aug 2011 19:38:12 +0000 (15:38 -0400)]
doc/progs: fix windows/amd64

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

13 years agolibmach: support reading symbols from Windows .exe for nm
Mateusz Czapliński [Mon, 29 Aug 2011 18:25:43 +0000 (14:25 -0400)]
libmach: support reading symbols from Windows .exe for nm

Fixes #979.

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

13 years agoA+C: Mateusz Czapliński (individual CLA)
Russ Cox [Mon, 29 Aug 2011 18:25:29 +0000 (14:25 -0400)]
A+C: Mateusz Czapliński (individual CLA)

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

13 years agoarchive/tar: when writing tar Headers write hdr.Linkname
Mike Rosset [Mon, 29 Aug 2011 18:01:03 +0000 (11:01 -0700)]
archive/tar: when writing tar Headers write hdr.Linkname

This should allow symlinks in tar files. Where previously
as far as I can see they were skipped completely.

R=golang-dev, dsymonds, rsc, bradfitz, bradfitz
CC=golang-dev, mike.rosset
https://golang.org/cl/4973044

13 years agoC+A: add Mike Rosset (individual CLA)
Brad Fitzpatrick [Mon, 29 Aug 2011 16:13:55 +0000 (09:13 -0700)]
C+A: add Mike Rosset (individual CLA)

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

13 years agoruntime: add openbsd 386 defs.h
Joel Sing [Mon, 29 Aug 2011 15:07:19 +0000 (11:07 -0400)]
runtime: add openbsd 386 defs.h

Missed in previous change (4951043).

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

13 years agoruntime: add runtime· prefix to showframe
Russ Cox [Mon, 29 Aug 2011 14:55:21 +0000 (10:55 -0400)]
runtime: add runtime· prefix to showframe

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

13 years agonet: change the internal form of IPMask for IPv4
Mikio Hara [Mon, 29 Aug 2011 14:49:03 +0000 (10:49 -0400)]
net: change the internal form of IPMask for IPv4

This CL changes the internal form of IPMask for IPv4
from 16-byte to 4-byte, also adds Size method to IPMask
struct and changes output string format of IPMask.String
method.

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

13 years agoos: fix WNOHANG Waitmsg
Gustavo Niemeyer [Mon, 29 Aug 2011 14:45:37 +0000 (10:45 -0400)]
os: fix WNOHANG Waitmsg

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

13 years agoruntime: add runtime support for openbsd 386
Joel Sing [Mon, 29 Aug 2011 14:42:16 +0000 (10:42 -0400)]
runtime: add runtime support for openbsd 386

Add openbsd 386 runtime support, partially based on the existing
freebsd 386 runtime.

This requires change 4973043.

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

13 years agoruntime, syscall: use the vdso page on linux x86 for faster syscalls instead of int...
Yuval Pavel Zholkover [Mon, 29 Aug 2011 14:36:06 +0000 (10:36 -0400)]
runtime, syscall: use the vdso page on linux x86 for faster syscalls instead of int $0x80.
8l: fix handling CALL $(constant) code generated by 8a.
8a,8l: add indirect call instruction: CALL *data(SB).

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

13 years agosyscall: add openbsd 386
Joel Sing [Mon, 29 Aug 2011 14:04:28 +0000 (10:04 -0400)]
syscall: add openbsd 386

Add openbsd 386 syscall support, partially based on the existing
freebsd 386 syscall implementation.

FTR zerrors_openbsd_386.go cannot currently be completely built on
openbsd/i386 due to what appears to be a gcc bug. The constants can be
successfully generated with -m32 on openbsd/amd64 and the error
table can then be generated on openbsd/i386.

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

13 years agoruntime: openbsd thread tweaks
Joel Sing [Mon, 29 Aug 2011 13:35:13 +0000 (09:35 -0400)]
runtime: openbsd thread tweaks

- Rename sys_sched_yield() to osyield() as this is now defined in asm.h.
- Only print kern.rtheads message if rfork_thread() failed with ENOTSUP.
- Remove unused variables.

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

13 years agotime: fix Plan 9 build
Fazlul Shahriar [Mon, 29 Aug 2011 13:35:08 +0000 (09:35 -0400)]
time: fix Plan 9 build

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

13 years agogc: fix build on Plan 9
Lucio De Re [Mon, 29 Aug 2011 13:35:04 +0000 (09:35 -0400)]
gc: fix build on Plan 9

gc/bits.c
. improved format with associated cast;
gc/closure.c
gc/dcl.c
gc/range.c
gc/reflect.c
gc/sinit.c
. dropped unnecessary assignments;
gc/gen.c
. dropped unnecessary assignment;
. added static qualifier to local function definition;
gc/go.h
. added varargck pragmas;
gc/lex.c
. used {} instead of ; in if statement to suppress warning;
. replaced exit(0) with exits(0);
. added compilation conditions for SIGBUS/SIGSEGV;
. dropped unnecessary assignment;
gc/mparith2.c
. dropped four unnecessary assignments/initialisations;
gc/obj.c
. added type cast to local pointer;
gc/pgen.c
. added cast and related print format;
gc/subr.c
. replaced exit(1) with exits("error");
. replaced unlink() with remove();
. renamed local cistrmp() as ucistrmp() to remove conflict with
  Plan 9 function by the same name;
gc/swt.c
. added braces instead of ; as empty statment;
gc/typecheck.c
. added static qualifier to local function definition;
. dropped unnecessary assignments;
gc/walk.c
. dropped unnecessary assignments;
. added static qualifier to local function definitions;

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

13 years ago6g: fix build on Plan 9
Lucio De Re [Mon, 29 Aug 2011 13:34:59 +0000 (09:34 -0400)]
6g: fix build on Plan 9

src/cmd/6g/cgen.c
src/cmd/6g/gobj.c
src/cmd/6g/reg.c
. dropped unused assignments;
src/cmd/6g/gg.h
. added varargck pragmas;
src/cmd/6g/list.c
. adjusted print format for ulong casts;
src/cmd/6g/peep.c
. dropped redundant increment;

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

13 years ago5g: fix build on Plan 9
Lucio De Re [Mon, 29 Aug 2011 13:34:52 +0000 (09:34 -0400)]
5g: fix build on Plan 9

5g/cgen.c:
. USED(n4) as it is only mentioned in unreachable code later;
. dropped unused assignments;
. commented out unreachable code;
5g/cgen64.c:
5g/ggen.c:
. dropped unused assignments of function return value;
5g/gg.h:
. added varargck pragmas;
5g/peep.c:
. USED(p1) used only in unreacheable code;
. commented out unreachable code;
5g/reg.c:
. dropped unused assignment;

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

13 years agodoc/codelab/wiki: fix Makefile
Russ Cox [Mon, 29 Aug 2011 13:24:24 +0000 (09:24 -0400)]
doc/codelab/wiki: fix Makefile

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

13 years agoruntime: fix stack cleanup on windows/amd64
Hector Chu [Mon, 29 Aug 2011 12:12:56 +0000 (22:12 +1000)]
runtime: fix stack cleanup on windows/amd64

In amd64 it is the caller who cleans the stack.

R=alex.brainman, vcc.163, jp
CC=golang-dev
https://golang.org/cl/4966046

13 years agofix windows/amd64 build with newest mingw-w64
Hector Chu [Mon, 29 Aug 2011 06:17:08 +0000 (16:17 +1000)]
fix windows/amd64 build with newest mingw-w64

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

13 years agotemplate: range over channel
Rob Pike [Mon, 29 Aug 2011 05:56:52 +0000 (15:56 +1000)]
template: range over channel

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

13 years agogc: fix arm build
Russ Cox [Mon, 29 Aug 2011 03:29:34 +0000 (23:29 -0400)]
gc: fix arm build

Escape analysis was incorrectly assuming that
functions without bodies don't leak their
parameters.  This meant that sync/atomic's
TestAddInt64 was allocating x on its stack,
and then x was not properly aligned for use
with the atomic 64-bit instructions.  Obviously
we should figure out the alignment story on 5g
too, but this fix is correct and should restore the
build to 'ok'.

TBR=lvd
CC=golang-dev
https://golang.org/cl/4964047

13 years agogodashboard: fix utf-8 in user names
Russ Cox [Mon, 29 Aug 2011 02:23:44 +0000 (22:23 -0400)]
godashboard: fix utf-8 in user names

Also standardize on 'utf8' as encoding name.
Apparently either is acceptable.

The user, because it is a StringProperty,
must be of type unicode in order to handle
Unicode correctly.  It must *not* have type string.

The desc, because it is a BlobProperty, must
be of type string in order to handle Unicode correctly.
It must *not* have type unicode.

Yay encoding type pedantry without static typing.

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

13 years agoruntime: go interface to cdecl calbacks
Jaroslavas Počepko [Mon, 29 Aug 2011 00:40:28 +0000 (10:40 +1000)]
runtime: go interface to cdecl calbacks
cdecl calbacks have been implemented in C/ASM code, just Go function is missing

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

13 years agogc: tweak and enable escape analysis
Russ Cox [Sun, 28 Aug 2011 16:05:00 +0000 (12:05 -0400)]
gc: tweak and enable escape analysis

-s now means *disable* escape analysis.

Fix escape leaks for struct/slice/map literals.
Add ... tracking.
Rewrite new(T) and slice literal into stack allocation when safe.

Add annotations to reflect.
Reflect is too chummy with the compiler,
so changes like these affect it more than they should.

R=lvd, dave, gustavo
CC=golang-dev
https://golang.org/cl/4954043

13 years agoruntime: use cgo runtime functions to call windows syscalls
Alex Brainman [Sat, 27 Aug 2011 13:17:00 +0000 (23:17 +1000)]
runtime: use cgo runtime functions to call windows syscalls

R=rsc
CC=golang-dev, jp, vcc.163
https://golang.org/cl/4926042

13 years ago6l, 8l: remove JCXZ; add JCXZW, JCXZL, and JCXZQ
Jaroslavas Počepko [Fri, 26 Aug 2011 21:45:19 +0000 (17:45 -0400)]
6l, 8l: remove JCXZ; add JCXZW, JCXZL, and JCXZQ

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

13 years ago8g: fix build on Plan 9
Lucio De Re [Fri, 26 Aug 2011 21:42:59 +0000 (17:42 -0400)]
8g: fix build on Plan 9

8g/cgen.c:
8g/gobj.c
. dropped unnecessary assignments;
8g/gg.h
. added varargckk pragmas;
8g/ggen.c
. dropped duplicate assignment;
8g/gsubr.c
. adjusted format in print statement;
. dropped unnecessary assignment;
. replaced GCC's _builtin_return_address(0) with Plan 9's
  getcallerpc(&n) which is defined as a macro in <u.h>;
8g/list.c
. adjusted format in snprint statement;
8g/opt.h
. added varargck pragma (Adr*) that is specific for the invoking
  modules;
8g/peep.c
. dropped unnecessary incrementation;

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

13 years ago6l, 8l: handle forward JCXZ
Jaroslavas Počepko [Fri, 26 Aug 2011 21:20:19 +0000 (17:20 -0400)]
6l, 8l: handle forward JCXZ

R=rsc
CC=golang-dev, vcc.163
https://golang.org/cl/4963044

13 years agoA+C: Jaroslavas Počepko (individual CLA)
Russ Cox [Fri, 26 Aug 2011 21:20:01 +0000 (17:20 -0400)]
A+C: Jaroslavas Počepko (individual CLA)

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

13 years agomime: fix build
Russ Cox [Fri, 26 Aug 2011 21:19:52 +0000 (17:19 -0400)]
mime: fix build

The fix is to add ' ' after ';' so that we match
what we used to generate.
Packages like http look for the string with
the space in it, and I don't see a reason to
be so terse.

Also s/buffer/b/

TBR=bradfitz
CC=golang-dev
https://golang.org/cl/4959044

13 years agoio: add TeeReader
Hector Chu [Fri, 26 Aug 2011 21:08:59 +0000 (17:08 -0400)]
io: add TeeReader

TeeReader is a Reader that writes what it reads.

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

13 years agomime: text charset defaults
Pascal S. de Kloe [Fri, 26 Aug 2011 20:55:25 +0000 (16:55 -0400)]
mime: text charset defaults

Enforce + document the UTF-8 default.

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

13 years agomime: media type formatter
Pascal S. de Kloe [Fri, 26 Aug 2011 20:55:18 +0000 (16:55 -0400)]
mime: media type formatter

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

13 years agocgo: fixes callback for windows amd64
Wei Guangjing [Fri, 26 Aug 2011 20:43:37 +0000 (16:43 -0400)]
cgo: fixes callback for windows amd64

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

13 years ago8l: add openbsd
Joel Sing [Fri, 26 Aug 2011 19:39:23 +0000 (15:39 -0400)]
8l: add openbsd

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

13 years agosyscall: Handle RTM_NEWROUTE in ParseNetlinkRouteAttr on Linux.
Albert Strasheim [Fri, 26 Aug 2011 19:38:42 +0000 (15:38 -0400)]
syscall: Handle RTM_NEWROUTE in ParseNetlinkRouteAttr on Linux.

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

13 years agonet: disable "tcp" test on openbsd
Joel Sing [Fri, 26 Aug 2011 19:38:02 +0000 (15:38 -0400)]
net: disable "tcp" test on openbsd

Doing a socket/listen on an unspecified address with an unspecified
address family is likely to result in an AF_INET6 socket on an IPv6
capable system, which under OpenBSD means IPv6 only - not IPv4 *and*
IPv6. In this case trying to connect to this socket from an IPv4
loopback address is not going to end well.

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

13 years agotime: fix zone during windows test
Russ Cox [Fri, 26 Aug 2011 19:15:23 +0000 (15:15 -0400)]
time: fix zone during windows test
Factor out sleep interrupt.

Fixes #1109.

R=alex.brainman, go.peter.90, mattn.jp
CC=golang-dev
https://golang.org/cl/4968041

13 years agoxml: marshal "parent>child" tags correctly
Ross Light [Fri, 26 Aug 2011 15:29:52 +0000 (12:29 -0300)]
xml: marshal "parent>child" tags correctly

Fixes #2119

R=m.n.summerfield, adg, kevlar, rsc, gustavo, n13m3y3r
CC=golang-dev
https://golang.org/cl/4941042

13 years agojson: fix decode bug with struct tag names with ,opts being ignored
Brad Fitzpatrick [Fri, 26 Aug 2011 08:27:33 +0000 (12:27 +0400)]
json: fix decode bug with struct tag names with ,opts being ignored

When the encoder was updated to respect the ",omitempty"
struct tag options, the decoder half was never updated to know
about the new struct tag format. (the format is now an optional
name, followed by zero or more ",option" strings)

This only affected people who used ",omitempty" along with
a field name. In that case, the serialized JSON wouldn't
decode to the original value.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/4965049

13 years agohttp: support setting Transport's TLS client config
Brad Fitzpatrick [Fri, 26 Aug 2011 06:06:35 +0000 (10:06 +0400)]
http: support setting Transport's TLS client config

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

13 years agobytes.Buffer: clarify that NewBuffer is not for beginners
Rob Pike [Fri, 26 Aug 2011 05:09:23 +0000 (15:09 +1000)]
bytes.Buffer: clarify that NewBuffer is not for beginners

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

13 years agowebsocket: Implements new version of WebSocket protocol.
Fumitoshi Ukai [Fri, 26 Aug 2011 03:12:08 +0000 (13:12 +1000)]
websocket: Implements new version of WebSocket protocol.

This introduces new APIs.
- DialConfig can open client connection using Config, so user can specify protocol version, tls.Config if necessary.

- Message can be used to send/receive text/binary data in a frame.
- JSON can be used to send/receive JSON data in a frame.

R=golang-dev, adg, rsc, m, tarmigan, raul.san, yohcop
CC=golang-dev
https://golang.org/cl/4635084

13 years agosyscall: SOMAXCONN should be 0x7fffffff at winsock2.
Yasuhiro Matsumoto [Fri, 26 Aug 2011 02:36:46 +0000 (12:36 +1000)]
syscall: SOMAXCONN should be 0x7fffffff at winsock2.

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

13 years agoimage/tiff: decoder optimization.
Benny Siegert [Fri, 26 Aug 2011 01:36:52 +0000 (11:36 +1000)]
image/tiff: decoder optimization.

Write to image.*.Pix directly in the case of RGB, RGBA and NRGBA
images. For the latter two, the file format matches the memory layout
so a simple copy can be used.

RGB image before/after:
tiff.BenchmarkDecoder 748137 ns/op (62.39 MB/s) 251256 ns/op (185.76 MB/s) x3.0

NRGBA image before/after:
tiff.BenchmarkDecoder 775540 ns/op (80.12 MB/s) 116721 ns/op (532.34 MB/s) x6.6

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

13 years agoimage/tiff: add a decode benchmark.
Benny Siegert [Fri, 26 Aug 2011 01:31:59 +0000 (11:31 +1000)]
image/tiff: add a decode benchmark.

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

13 years agogodoc: added systematic throttling to indexing goroutine
Robert Griesemer [Fri, 26 Aug 2011 00:46:43 +0000 (17:46 -0700)]
godoc: added systematic throttling to indexing goroutine

- implemented stand-alone Throttle mechanism
- added new flag -index_throttle to godoc
- index throttling enables index creation when running
  godoc on app engine as it keeps godoc responsive

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

13 years agogo/build: separate test imports out when scanning
Gustavo Niemeyer [Fri, 26 Aug 2011 00:00:20 +0000 (21:00 -0300)]
go/build: separate test imports out when scanning

This fixes goinstall so it doesn't try to install unneeded
packages or get confused with non-existent loops.

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

13 years agonet: move internal string manipulation routines to parse.go
Mikio Hara [Thu, 25 Aug 2011 23:22:46 +0000 (19:22 -0400)]
net: move internal string manipulation routines to parse.go

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

13 years agonet: make use of IPv4len, IPv6len
Mikio Hara [Thu, 25 Aug 2011 23:00:04 +0000 (19:00 -0400)]
net: make use of IPv4len, IPv6len

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

13 years agogoinstall: report lack of $GOPATH on errors
Gustavo Niemeyer [Thu, 25 Aug 2011 22:12:03 +0000 (19:12 -0300)]
goinstall: report lack of $GOPATH on errors

Fixes #2175.

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

13 years agostrconv: put decimal on stack
Russ Cox [Thu, 25 Aug 2011 21:54:14 +0000 (17:54 -0400)]
strconv: put decimal on stack

This makes decimal a good test
case for the escape analysis.

With escape analysis:

benchmark                 old ns/op    new ns/op    delta
BenchmarkAtof64Decimal         1954          243  -87.56%
BenchmarkAtof64Float           2008          293  -85.41%
BenchmarkAtof64FloatExp       10106         8814  -12.78%
BenchmarkAtof64Big             5113         3486  -31.82%

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

13 years agodoc: emphasize that environment variables are optional
Russ Cox [Thu, 25 Aug 2011 20:53:54 +0000 (16:53 -0400)]
doc: emphasize that environment variables are optional

Also update $GOARM description.

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

13 years agobuild: fix more unused parameters
Russ Cox [Thu, 25 Aug 2011 20:29:56 +0000 (16:29 -0400)]
build: fix more unused parameters

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

13 years agogc: shuffle #includes
Russ Cox [Thu, 25 Aug 2011 20:25:10 +0000 (16:25 -0400)]
gc: shuffle #includes

#include "go.h" (or "gg.h")

becomes

#include <u.h>
#include <libc.h>
#include "go.h"

so that go.y can #include <stdio.h>
after <u.h> but before "go.h".
This is necessary on Plan 9.

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