- func f(int,) is a legal signature
- func f(...int,) is a legal signature
Defer checking for correct use of "..." with last
paremeter type to type checker instead of parser.
R=rsc
CC=golang-dev
https://golang.org/cl/4973059
There may be more fine-tuning down the line,
but this CL fixes the most pressing issue at
hand.
Also: gofmt -w src misc
Fixes#1524.
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4975053
Most web frameworks allow ; as a synonym for &,
following a recommendation in some versions of
the HTML specification. Do the same.
Remove overuse of Split.
Move ParseQuery tests from package http to package url.
Fixes#2210.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4973062
allocparams + tempname + compactframe
all knew about how to place stack variables.
Now only compactframe, renamed to allocauto,
does the work. Until the last minute, each PAUTO
variable is in its own space and has xoffset == 0.
This might break 5g. I get failures in concurrent
code running under qemu and I can't tell whether
it's 5g's fault or qemu's. We'll see what the real
ARM builders say.
R=ken2
CC=golang-dev
https://golang.org/cl/4973057
There's some ambiguity in the U{url: url} case as it could be
both a map or a struct literal, but given context it's more
likely a struct, so U{url: url_} rather than U{url_: url_}.
At least that was the case for me.
R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/4972052
- 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
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
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
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
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
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
- 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
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
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
- 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
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
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
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
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
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
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
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
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
- 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
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
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
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
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
-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
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
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
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
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
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
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
- 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
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