Make sure we never pass a timer into timerproc with
a negative duration since it will cause other timers
to never expire.
Fixes#5321.
R=golang-dev, minux.ma, remyoudompheng, mikioh.mikioh, r, bradfitz, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/9035047
But keep their case for ease of searching.
They were added recently. We don't want them part of go1.2's API.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13569044
cmd/cc: bv.c imports libc.h twice
When using the Plan 9 compiler, the invocation
#include <../ld/textflag.h>
works for the toolchain, but not for the MACH library.
Module cmd/cc/bv.c includes libc.h and "cc.h", which in
turn also includes libc.h. In the Plan 9 context, this
causes a number of duplicate definitions.
R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/13303047
Flushing after every token negates the point of buffering. A different approach is required.
««« original CL description
encoding/xml: flush buffer after encoding token
R=rsc, bradfitz, adg
CC=golang-dev
https://golang.org/cl/13004046
»»»
R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/13515043
This should have been part of revision 16731:cdedb129e020, but
I missed it. This fixes printing local variables when doing
an external link.
No test because we aren't doing any debug info testing yet.
Fixes#5719.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13464046
DeepEqual caches addresses of compared values
each time it visits addressable values. This is
more expensive than actually comparing them in
the common case of large slices of bytes or integers.
Also add a fast path for slices with identical
underlying array.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13000044
The underlying parse tree is visible in text/template, so it should be visible here.
Done by copying the underlying *parse.Tree up to the top level of the struct, and then making sure it's kept up to date.
Fixes#6318.
R=mikesamuel
CC=golang-dev
https://golang.org/cl/13479044
Based on an old suggestion by rsc, it compares the second
and following arguments to the first.
Unfortunately the code cannot be as pretty as rsc's original
because it doesn't require identical types.
R=golang-dev, dsymonds, adg
CC=golang-dev
https://golang.org/cl/13509046
This CL makes resolveInternetAddr return a list of addresses that
contain a pair of different address family IP addresses if possible,
but doesn't contain any API behavioral changes yet. A simple IP
address selection mechanism for Resolve{TCP,UDP,IP}Addr and Dial API
still prefers IPv4.
This is in preparation for TCP connection setup with fast failover on
dual IP stack node as described in RFC 6555.
Update #3610
Update #5267
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13374043
Update #4805
Add the ability to set an open connection limit.
Fixed case where the Conn finalCloser was being called with db.mu locked.
Added separate benchmarks for each path for Exec and Query.
Replaced slice based idle pool with list based idle pool.
R=bradfitz
CC=golang-dev
https://golang.org/cl/10726044
This change allows people who want to parse or set odd X.509 extensions
to do so without having to add support for them all to the package.
I tried to make it so that only a single member: Extensions would be
needed. However, that would mean detecting when the caller had altered
the contents of it so that parsing and marshaling a certificate
wouldn't ignore all changes to the other members. This ended up being
messy, thus the current design where there are two members: one for
reading and another for writing.
As crypto/x509 adds support for more extensions in the future, the raw
extensions will still be in Extensions for older code that expects it
there. Also, future extensions will be overridden by any raw extensions
added to ExtraExtensions by code that was written before support was
added.
R=golang-dev, r
CC=golang-dev, jpsugar
https://golang.org/cl/12056043
Also introduce BGET2/4, BPUT2/4 as they are widely used.
Slightly improve BGETC/BPUTC implementation.
This gives ~5% CPU time improvement on go install -a -p1 std.
Before:
real user sys
0m23.561s 0m16.625s 0m5.848s
0m23.766s 0m16.624s 0m5.846s
0m23.742s 0m16.621s 0m5.868s
after:
0m22.999s 0m15.841s 0m5.889s
0m22.845s 0m15.808s 0m5.850s
0m22.889s 0m15.832s 0m5.848s
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12745047
image/color package into their own package. They require some non-
trivial init-time code (interface conversions, currently 40KiB of text)
that would otherwise burden any Go program that imported image/color.
R=r
CC=golang-dev
https://golang.org/cl/13256046
This CL adds a new type addrList that will carry a short list of IP
addresses to dial helper functions in the upcoming CLs.
This is in preparation for TCP connection setup with fast failover on
dual IP stack node as described in RFC 6555.
Update #3610
Update #5267
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13241046
Breaks build, and has a race.
««« original CL description
database/sql: add SetMaxOpenConns
Update #4805
Add the ability to set an open connection limit.
Fixed case where the Conn finalCloser was being called with db.mu locked.
Added seperate benchmarks for each path for Exec and Query.
Replaced slice based idle pool with list based idle pool.
R=bradfitz
CC=golang-dev
https://golang.org/cl/10726044
»»»
R=golang-dev
CC=golang-dev
https://golang.org/cl/13252046
Update #4805
Add the ability to set an open connection limit.
Fixed case where the Conn finalCloser was being called with db.mu locked.
Added seperate benchmarks for each path for Exec and Query.
Replaced slice based idle pool with list based idle pool.
R=bradfitz
CC=golang-dev
https://golang.org/cl/10726044
This CL adds the netaddr interface that will carry a single network
endpoint address or a short list of IP addresses to dial helper
functions in the upcoming CLs.
This is in preparation for TCP connection setup with fast failover on
dual IP stack node as described in RFC 6555.
Update #3610
Update #5267
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13368044
This replaces the mcall frame with the badmcall frame instead of
leaving the mcall frame on the stack and adding the badmcall frame.
Because mcall is no longer on the stack, traceback will now report what
called mcall, which is what we would like to see in this situation.
R=golang-dev, cshapiro
CC=golang-dev
https://golang.org/cl/13012044
Minor. Saw this in a profile at few percent of CPU and was
curious what it was. Improves overall regexp benchmarks
anywhere from 0 to 3%, but they're a pain to run. You need to
run them in isolation for long runs to get stable numbers.
benchmark old ns/op new ns/op delta
BenchmarkEmptyOpContext 537 473 -11.92%
R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/13407043
AES-GCM is the only current TLS ciphersuite that doesn't have
cryptographic weaknesses (RC4), nor major construction issues (CBC mode
ciphers) and has some deployment (i.e. not-CCM).
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13249044
I noticed that this one benchmark in particular was very
noisy. Looking into it, I saw that the table was wrong
and inconsistent with the lines above and below.
R=golang-dev, crawshaw
CC=golang-dev
https://golang.org/cl/13393045
When searching for an allocated bit, flushptrbuf would search
backward in the bitmap word containing the bit of pointer
being looked-up before searching the span. This extra check
was not replicated in markonly which, instead, after not
finding an allocated bit for a pointer would directly look in
the span.
Using statistics generated from godoc, before this change span
lookups were, on average, more common than word lookups. It
was common for markonly to consult spans for one third of its
pointer lookups. With this change in place, what were
previously span lookups are overwhelmingly become by the word
lookups making the total number of span lookups a relatively
small fraction of the whole.
This change also introduces some statistics gathering about
lookups guarded by the CollectStats enum.
R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/13311043
#pragma textflag and #pragma dataflag directives.
Update dataflag directives to use symbols instead of integer constants.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13310043
Types in function scope can have methods on them if they embed another type, but we didn't make the name unique, meaning that 2 identically named types in different functions would conflict with eachother.
Fixes#6269.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13326045
These instructions are emitted when GO386=387 or the target
i386 CPU does not have SSE2 capabilities.
Fixes#6215.
R=golang-dev, remyoudompheng
CC=golang-dev
https://golang.org/cl/12812045
The compiler computes initialization order by finding
a spanning tree between a package's global variables.
But it does so by walking both variables and functions
and stops detecting cycles between variables when they
mix with a cycle of mutually recursive functions.
Fixes#4847.
R=golang-dev, daniel.morsing, rsc
CC=golang-dev
https://golang.org/cl/9663047
Before this fix, it was always an error to use the Close method on the
io.WriteCloser obtained from Cmd.StdinPipe, as it would race with the
Close performed by Cmd.Wait.
Fixes#6270.
R=golang-dev, r, remyoudompheng, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/13329043
See how it flies. We'll disable it again if the underlying issue is not resolved.
See issue 4155 for details.
Fixes#4155.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13368045
Causes the package dependencies to include those for race detection.
Fixes#5653.
R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/13236045
Merge the comment from runtime/time.goc ("at least")
and also note that negative is okay and won't crash.
I see people going out of their way to avoid passing
a negative value to Sleep.
R=golang-dev, adg, r, alex.brainman
CC=golang-dev
https://golang.org/cl/13271045
The method is simple: the parser just parses
{{if A}}a{{else if B}}b{{end}}
to the same tree that would be produced by
{{if A}}a{{else}}{{if B}}b{{end}}{{end}}
Thus no changes are required in text/template itself
or in html/template, only in text/template/parse.
Fixes#6085
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13327043
The previous wording, though accurate, was hard to parse.
In particular, it was tempting to interpret "the method"
as referring to "the function f" instead of "Do", and
required effort to find the correct antecedent for
"this receiver".
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/13307043
Apply the same rules for argument evaluation and indirection that are
used by the regular evaluator.
Fixes#5802
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13257043
Just forgot to include this in CL 12843043.
Also consolidates the code dealing with test environment.
Update #6122
R=alex.brainman
CC=golang-dev
https://golang.org/cl/13184043
RFC 6265 allows a leading dot in a cookie domain attribute
but is clear (see section 4.1.1) that a Set-Cookie header
should be sent without these dots.
R=bradfitz
CC=golang-dev
https://golang.org/cl/13111043
OS X in particular deletes tmp files (but not directories)
pretty reliably.
Ask hg whether the go.tools directory in tmp is good before
using it.
Fixes issue Rob and others were reporting, which I just hit
myself now.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13084049
This was breaking people setting GOARCH=386 before running
all.bash on amd64 machines.
cmd/go puts different architecture binaries where "go tool"
can't find them.
R=golang-dev, r, khr
CC=golang-dev
https://golang.org/cl/13139044
Current for Plan 9 is implemented with /dev/user for
Uid/Gid/Username/Name, and $home environment variable for
HomeDir.
Implementing Lookup/LookupId is not done, which would
require parsing /adm/users. It is unclear of how much benefit
this would be.
R=golang-dev
CC=bradfitz, golang-dev, r
https://golang.org/cl/13203043
the use of the flag, especially for objects which actually do have
pointers but we don't want the GC to scan them.
R=golang-dev, cshapiro
CC=golang-dev
https://golang.org/cl/13181045
slice type to an array type, the haspointer-ness may change.
Before this change, we'd sometimes get types like [1]int marked
as having pointers.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/13189044
Add syscall support for dragonfly/amd64.
Also add support for generating syscall z* files for dragonfly.
R=bradfitz
CC=golang-dev
https://golang.org/cl/13188043
Go runtime support for dragonfly/amd64, largely based of the existing
FreeBSD runtime (with some clues from the varialus/godfly work).
R=bradfitz
CC=golang-dev
https://golang.org/cl/13088044
Also avoids platform-dependent datagram truncation in raw IP tests.
At least it's different between Windows and others.
Fixes#6122.
R=alex.brainman
CC=golang-dev
https://golang.org/cl/12843043
This CL adds minimal information for supporting platforms that don't
have a complete list of internet protocol numbers.
Fixes#5344.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12898045
The net package consists of thin three layers like the follwoing;
- Exposed API, that contains net.Dial, net.DialUDP, net.DialUnix
- Socket and network file descriptor, that contains net.netFD and
its methods, helper functions such as dialUDP, dialUnix
- Network pollster, that contains net.pollDesc and its methods
This CL removes redundant argument check which is already done by
API layer.
R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/13092043
GC acquires worldsema, which is a goroutine-level semaphore
which parks goroutines. g0 can not be parked.
Fixes#6193.
R=khr, khr
CC=golang-dev
https://golang.org/cl/12880045
Update the original change but do not read interface types in
the arguments area. Once the arguments area is zeroed as the
locals area is we can safely read interface type values there
too.
««« original CL description
undo CL 12785045 / 71ce80dc4195
This has broken the 32-bit builds.
««« original CL description
cmd/gc, runtime: use type information to scan interface values
R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/12785045
»»»
R=khr, golang-dev, khr
CC=golang-dev
https://golang.org/cl/13010045
»»»
R=khr, khr
CC=golang-dev
https://golang.org/cl/13073045
Replace linked list walk with memset.
This reduces CPU time taken by 'go install -a std' by ~10%.
Before:
real user sys
0m23.561s 0m16.625s 0m5.848s
0m23.766s 0m16.624s 0m5.846s
0m23.742s 0m16.621s 0m5.868s
after:
0m22.714s 0m14.858s 0m6.138s
0m22.644s 0m14.875s 0m6.120s
0m22.604s 0m14.854s 0m6.081s
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13084043
pointer. An example that triggers the bad behavior on a 64bit
machine http://play.golang.org/p/GrNFakAYLN
rv1 := reflect.ValueOf(complex128(0))
rt := rv1.Type()
rv2 := rv1.Convert(rt)
rv3 := reflect.New(rt).Elem()
rv3.Set(rv2)
Running the code fails with the following:
panic: reflect: internal error: storeIword of 16-byte value
I've tested on a 64bit machine and verified this fixes the panic. I
haven't tested on a 32bit machine so I haven't verified the other
cases, but they follow logically.
R=golang-dev, r, iant
CC=golang-dev
https://golang.org/cl/12805045
Update #5000
Should reduce the flakiness a little. Malloc counting is important
to general testing but not to the build dashboard, which uses -short.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12866047
Add eq, lt, etc. to allow one to do simple comparisons.
It's basic types only (booleans, integers, unsigned integers,
floats, complex, string) because that's easy, easy to define,
and covers the great majority of useful cases, while leaving
open the possibility of a more sweeping definition later.
{{if eq .X .Y}}X and Y are equal{{else}}X and Y are unequal{{end}}
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13091045
This is potentially an API-breaking change, but it is an important bug fix.
The CL https://golang.org/cl/7305072/ added stuff to make
the tar file look more like a file system internally, including providing an
implementation of os.FileInfo for the file headers within the archive.
But the code is incorrect because FileInfo.Name is supposed to return
the base name only; this implementation returns the full path. A round
trip test added in the same shows this in action, as the slashes are
preserved as we create a header using the local implementation of
FileInfo.
The CL here changes the behavior of the tar (and zip) FileInfo to honor
the Go spec for that interface. It also clarifies that the FileInfoHeader
function, which takes a FileInfo as an argument, will therefore create
a header with only the base name of the file recorded, and that
subsequent adjustment may be necessary.
There may be code out there that depends on the broken behavior.
We can call out the risk in the release notes.
Fixes#6180.
R=golang-dev, dsymonds, adg, bradfitz
CC=golang-dev
https://golang.org/cl/13118043
Some crashed, some didn't. Make a nil receiver always
return ErrInvalid rather than crash.
Fixes#5824.
The program in the bug listing is silent now, at least on my Mac.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13108044
This has broken the 32-bit builds.
««« original CL description
cmd/gc, runtime: use type information to scan interface values
R=golang-dev, rsc, dvyukov
CC=golang-dev
https://golang.org/cl/12785045
»»»
R=khr, golang-dev, khr
CC=golang-dev
https://golang.org/cl/13010045
In the crash stack trace race cgocall() calls endcgo(),
this means that m->racecall is wrong.
Indeed this can happen is a goroutine is rescheduled to another M
during race call.
Disable preemption for race calls.
Fixes#6155.
R=golang-dev, rsc, cshapiro
CC=golang-dev
https://golang.org/cl/12866045
Before this CL, the import stack was a) not printed and b) overwritten later
in the build, destroying the information about the cycle. This CL fixes both.
I made time depend on os (os already depends on time) and with this CL the error is:
/Users/r/go/src/pkg/fmt/print.go:10:2: import cycle not allowed
package code.google.com/p/XXX/YYY:
imports fmt
imports os
imports time
imports os
Doesn't give line numbers for the actual imports, as requested in the bug, but
I don't believe that's important.
Fixes#4292.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13100043
Given
if (i == 0)
x++
The old message was
x.go:6: syntax error: unexpected semicolon or newline before {
Now we see
x.go:6: syntax error: missing { after if clause
Fixes#5687
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12822045
Update #5305.
This handles the case where the nil pointers are inside a slice.
A top-level nil pointer is harder, maybe fundamentally broken by gob's model.
Thinking required.
However, a slice is the important case since people don't expect to be sending
top-level nils much, but they can arise easily in slices.
R=golang-dev, josharian, adg
CC=golang-dev
https://golang.org/cl/13042044
The shell's -e doesn't work across "eval"; need to error-check by hand.
The recent spate of Darwin build failures pointed out that if the first
run of cmd/dist fails, we keep going. We shouldn't.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13098043
This might fix the mkdtemp problem on the darwin builders if they
have TMPDIR set to a path ending in a slash; at worse this will
result in cleaner path names.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13097043
The tar/archive code from golang has a problem with linknames with length >
100. A pax header is added but the original header still written with a too
long field length.
As it is clear that pax support is incomplete I have added missing
implementation parts.
This commit contains code from the golang project in the folder tar/archiv.
The following pax header records are now automatically written:
- gname)
- linkpath
- path
- uname
The following fields can be written with PAX, but the default is to use the
star binary extension.
- gid (value > 2097151)
- size (value > 8589934591)
- uid (value > 2097151)
The string fields are written when the value is longer as the field or if the
string contains a char that is not encodable as 7-bit ASCII value.
The change was tested against a current ubuntu-cloud image tarball comparing
the compressed result.
+ added some automated tests for the new functionality.
Fixes#6056.
R=dsymonds
CC=golang-dev
https://golang.org/cl/12561043
The Darwin builders are all failing here but strerror doesn't provide context.
R=golang-dev, bradfitz, adg
CC=golang-dev
https://golang.org/cl/13095043
The limit is 500. There is no way to change it.
This primarily affects name resolution.
If a million goroutines try to resolve DNS names,
only 500 will get to execute cgo calls at a time.
But in return the operating system will not crash.
Fixes#5625.
R=golang-dev, dan.kortschak, r, dvyukov
CC=bradfitz, golang-dev
https://golang.org/cl/13038043
Actually working to stay within the limit could cause subtle deadlocks.
Crashing avoids the subtlety.
Fixes#4056.
R=golang-dev, r, dvyukov
CC=golang-dev
https://golang.org/cl/13037043
When the new call site-specific frame bitmaps are available,
we can cut the zeroing to just those values that need it due
to scope escaping.
R=cshapiro, cshapiro
CC=golang-dev
https://golang.org/cl/13045043
Fixes#6107.
race: output goroutine 1 as main goroutine
Fixes#6130.
race: option to abort program on first detected error
R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/12968044
When the packages the tested package depends on don't build,
we weren't getting out early. Added a simple check for a successful
build to an existing early out.
There may be other ways that double compilation arises, but
this fixes the one listed in the issue.
Fixes#5679
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13036043
The goal is to stop only those programs that would keep
going and run the machine out of memory, but before they do that.
1 GB on 64-bit, 250 MB on 32-bit.
That seems implausibly large, and it can be adjusted.
Fixes#2556.
Fixes#4494.
Fixes#5173.
R=khr, r, dvyukov
CC=golang-dev
https://golang.org/cl/12541052
Rows.Close.
Previously, callers that followed the example code (but not call
rows.Close after "for rows.Next() { ... }") could leak statements if
the driver returned an error other than io.EOF.
R=bradfitz, alex.brainman
CC=golang-dev, rsc
https://golang.org/cl/12677050
Also start of some test helper unification, long overdue.
I refrained from cleaning up the rest in this CL.
Fixes#6157
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13030043
It's next to useless and confusing as well. Let's make godoc better instead.
Fixes#4849.
R=golang-dev, dsymonds, adg, rogpeppe, rsc
CC=golang-dev
https://golang.org/cl/12974043
See golang.org/s/go12nil.
This CL is about getting all the right checks inserted.
A followup CL will add an optimization pass to
remove redundant checks.
R=ken2
CC=golang-dev
https://golang.org/cl/12970043
This CL rearranges the call order for raw networking primitives like
the following;
- For dialers that open active connections, pollDesc.Init will be
called before syscall.Connect.
- For stream listeners that open passive stream connections,
pollDesc.Init will be called just after syscall.Listen.
- For datagram listeners that open datagram connections,
pollDesc.Init will be called just after syscall.Bind.
This is in preparation for runtime-integrated network pollster for BSD
variants.
Update #5199
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/12730043
I tried to make it absolutely correct but there are too many
conflicting definitions for the official list of time zones.
Since when we're parsing we know when to expect
a time zone and we know what they look like if not exactly
what the definitive set is, we compromise. We accept any
three-character sequence of upper case letters, possibly
followed by a capital T (all four-letter zones end in T).
There is one crazy special case (ChST) and the possibility
of a signed hour offset for GMT.
Fixes#3790
I hope forever, but I doubt that very much.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12969043
Took 76 seconds or so before. By avoiding flate and crc32 on
4GB of data, it's now only 12 seconds. Still a slow test, but
not painful to run anymore when you forget -short.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12950043
Was checking for nil map; must check for empty map instead.
Fixes#6065
Before:
go test -cover
# testmain
/var/folders/00/013l0000h01000cxqpysvccm0004fc/T/go-build233480051/_/Users/r/issue/_test/_testmain.go:11: imported and not used: "_/Users/r/issue"
FAIL _/Users/r/issue [build failed]
Now:
go test -cover
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok _/Users/r/issue 0.021s
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12916043
Update #3790
Handle time zones like GMT-8.
The more general time zone-matching problem is not yet resolved.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12922043
Remove custom support for time.Time.
No new tests: the tests for the time.Time special case
now test the general case.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12751045
The baseline architecture had been left to the GCC configured
default which can be more accomodating than the rest of the Go
toolchain. This prevented instructions used by the 5g compiler,
like BLX, from being used in GCC compiled assembler code.
R=golang-dev, dave, rsc, elias.naur, cshapiro
CC=golang-dev
https://golang.org/cl/12954043
It doughtily misses all possible corner cases.
In particular on machines with <1GHz processors,
SetBlockProfileRate(1) disables profiling.
Fixes#6114.
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/12936043
See golang.org/s/go12xml for design.
Repeat of CL 12603044, which was submitted accidentally
and then rolled back.
Fixes#2771.
Fixes#4169.
Fixes#5975.
Fixes#6125.
R=golang-dev
CC=golang-dev
https://golang.org/cl/12919043
Originally the requirement was f(x) where f's argument is
exactly x's type.
CL 11858043 relaxed the requirement in a non-standard
way: f's argument must be exactly x's type or interface{}.
If we're going to relax the requirement, it should be done
in a way consistent with the rest of Go. This CL allows f's
argument to have any type for which x is assignable;
that's the same requirement the compiler would impose
if compiling f(x) directly.
Fixes#5368.
R=dvyukov, bradfitz, pieter
CC=golang-dev
https://golang.org/cl/12895043
The ARM external linking CL used BLX instructions in gcc assembler. Replace with BL to retain support on older ARM processors.
R=rsc
CC=golang-dev
https://golang.org/cl/12938043
The ARM external linking CL left missed changes to sys_freebsd_arm.s and sys_netbsd_arm.s already done to sys_linux_arm.s.
R=rsc
CC=golang-dev
https://golang.org/cl/12842044
The shared library changes broke the windows build because __attribute__ ((visibility ("hidden"))) is not supported in windows gcc. This change removes the attribute, as it is only needed when building shared libraries.
R=rsc
CC=golang-dev
https://golang.org/cl/12829044
Fixes an issue where prepared statements that outlive many
connections become expensive to invoke.
Fixes#6081
R=golang-dev
CC=bradfitz, golang-dev
https://golang.org/cl/12646044
This CL is an aggregate of 10271047, 10499043, 9733044. Descriptions of each follow:
10499043
runtime,cmd/ld: Merge TLS symbols and teach 5l about ARM TLS
This CL prepares for external linking support to ARM.
The pseudo-symbols runtime.g and runtime.m are merged into a single
runtime.tlsgm symbol. When external linking, the offset of a thread local
variable is stored at a memory location instead of being embedded into a offset
of a ldr instruction. With a single runtime.tlsgm symbol for both g and m, only
one such offset is needed.
The larger part of this CL moves TLS code from gcc compiled to internally
compiled. The TLS code now uses the modern MRC instruction, and 5l is taught
about TLS fallbacks in case the instruction is not available or appropriate.
10271047
This CL adds support for -linkmode external to 5l.
For 5l itself, use addrel to allow for D_CALL relocations to be handled by the
host linker. Of the cases listed in rsc's comment in issue 4069, only case 5 and
63 needed an update. One of the TODO: addrel cases was since replaced, and the
rest of the cases are either covered by indirection through addpool (cases with
LTO or LFROM flags) or stubs (case 74). The addpool cases are covered because
addpool emits AWORD instructions, which in turn are handled by case 11.
In the runtime, change the argv argument in the rt0* functions slightly to be a
pointer to the argv list, instead of relying on a particular location of argv.
9733044
The -shared flag to 6l outputs a shared library, implemented in Go
and callable from non-Go programs such as C.
The main part of this CL change the thread local storage model.
Go uses the fastest and least general mode, local exec. TLS data in shared
libraries normally requires at least the local dynamic mode, however, this CL
instead opts for using the initial exec mode. Initial exec mode is faster than
local dynamic mode and can be used in linux since the linker has reserved a
limited amount of TLS space for performance sensitive TLS code.
Initial exec mode requires an extra load from the GOT table to determine the
TLS offset. This penalty will not be paid if ld is not in -shared mode, since
TLS accesses will be reduced to local exec.
The elf sections .init_array and .rela.init_array are added to register the Go
runtime entry with cgo at library load time.
The "hidden" attribute is added to Cgo functions called from Go, since Go
does not generate call through the GOT table, and adding non-GOT relocations for
a global function is not supported by gcc. Cgo symbols don't need to be global
and avoiding the GOT table is also faster.
The changes to 8l are only removes code relevant to the old -shared mode where
internal linking was used.
This CL only address the low level linker work. It can be submitted by itself,
but to be useful, the runtime changes in CL 9738047 is also needed.
Design discussion at
https://groups.google.com/forum/?fromgroups#!topic/golang-nuts/zmjXkGrEx6QFixes#5590.
R=rsc
CC=golang-dev
https://golang.org/cl/12871044
mkvar was taking care of the "LeftAddr" case,
effectively hiding it from the temp-merging optimization.
Move it into prog.c.
R=ken2
CC=golang-dev
https://golang.org/cl/12884045
fat fingers - did not intend to submit.
depends on the Unmarshaler CL anyway.
««« original CL description
encoding/xml: add, support Marshaler interface
See golang.org/s/go12xml for design.
Fixes#2771.
Fixes#4169.
Fixes#5975.
Fixes#6125.
R=golang-dev, iant, dan.kortschak
CC=golang-dev
https://golang.org/cl/12603044
»»»
TBR=golang-dev
CC=golang-dev
https://golang.org/cl/12918043
Update #6138
TestOver65kFiles spends all its time garbage collecting.
Removing the 1.4 MB of allocations per each of the 65k
files brings this from 34 seconds to 0.23 seconds.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12894043
Before,
go test -bench .
would just dump the long generic "go help" message. Confusing and
unhelpful. Now the message is short and on point and also reminds the
user about the oft-forgotten "go help testflag".
% go test -bench
go test: missing argument for flag bench
run "go help test" or "go help testflag" for more information
%
R=rsc
CC=golang-dev
https://golang.org/cl/12662046
Breaks the build. Old bucket arrays kept by iterators
still need to be scanned.
««« original CL description
runtime: tell GC not to scan internal hashmap structures.
We'll do it ourselves via hash_gciter, thanks.
Fixes bug 6119.
R=golang-dev, dvyukov, cookieo9, rsc
CC=golang-dev
https://golang.org/cl/12840043
»»»
R=golang-dev
CC=golang-dev
https://golang.org/cl/12884043
The NetBSD and OpenBSD failures are apparently real,
not due to the test bug fixed in 100b9fc0c46f.
««« original CL description
runtime/pprof: test netbsd and openbsd again
Maybe these will work now.
R=golang-dev, dvyukov, bradfitz
CC=golang-dev
https://golang.org/cl/12787044
»»»
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12873043
Currently it's possible that a goroutine
that periodically executes non-blocking
cgo/syscalls is never preempted.
This change splits scheduler and syscall
ticks to prevent such situation.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12658045
Currently we lose lots of profiling signals.
Most notably, GC is not accounted at all.
But stack splits, scheduler, syscalls, etc are lost as well.
This creates seriously misleading profile.
With this change all profiling signals are accounted.
Now I see these additional entries that were previously absent:
161 29.7% 29.7% 164 30.3% syscall.Syscall
12 2.2% 50.9% 12 2.2% scanblock
11 2.0% 55.0% 11 2.0% markonly
10 1.8% 58.9% 10 1.8% sweepspan
2 0.4% 85.8% 2 0.4% runtime.newstack
It is still impossible to understand what causes stack splits,
but at least it's clear how many time is spent on them.
Update #2197.
Update #5659.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/12179043
* Add a new kind of Name, "fpvar" which stands for function pointer variable
* When walking the AST, find functions used as expressions and create a new Name object for them
* Track functions which are only used in expr contexts, and avoid generating bridge code for them
R=golang-dev, minux.ma, fullung, rsc, iant
CC=golang-dev
https://golang.org/cl/9835047
Just for readability reasons; to prevent overlooking deadline stuff
across over platforms.
R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/8656044
If the timer goroutine is wakeup by timeout,
other goroutines will still notewakeup because sleeping is still set.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12763043
The compilers assume they can generate temporary variables
as needed to preserve the right semantics or simplify code
generation and the back end will still generate good code.
This turns out not to be true. The back ends will only
track the first 128 variables per function and give up
on the remainder. That needs to be fixed too, in a later CL.
This CL merges temporary variables with equal types and
non-overlapping lifetimes using the greedy algorithm in
Poletto and Sarkar, "Linear Scan Register Allocation",
ACM TOPLAS 1999.
The result can be striking in the right functions.
Top 20 frame size changes in a 6g godoc binary by bytes saved:
5464 1984 (-3480, -63.7%) go/build.(*Context).Import
4456 1824 (-2632, -59.1%) go/printer.(*printer).expr1
2560 80 (-2480, -96.9%) time.nextStdChunk
3496 1608 (-1888, -54.0%) go/printer.(*printer).stmt
1896 272 (-1624, -85.7%) net/http.init
2688 1400 (-1288, -47.9%) fmt.(*pp).printReflectValue
2800 1512 (-1288, -46.0%) main.main
3296 2016 (-1280, -38.8%) crypto/tls.(*Conn).clientHandshake
1664 488 (-1176, -70.7%) time.loadZoneZip
1760 608 (-1152, -65.5%) time.parse
4104 3072 (-1032, -25.1%) runtime/pprof.writeHeap
1680 712 ( -968, -57.6%) go/ast.Walk
2488 1560 ( -928, -37.3%) crypto/x509.parseCertificate
1128 392 ( -736, -65.2%) math/big.nat.divLarge
1528 864 ( -664, -43.5%) go/printer.(*printer).fieldList
1360 712 ( -648, -47.6%) regexp/syntax.(*parser).factor
2104 1528 ( -576, -27.4%) encoding/asn1.parseField
1064 504 ( -560, -52.6%) encoding/xml.(*Decoder).text
584 48 ( -536, -91.8%) html.init
1400 864 ( -536, -38.3%) go/doc.playExample
In the same godoc build, cuts the number of functions with
too many vars from 83 to 32.
R=ken2
CC=golang-dev
https://golang.org/cl/12829043
If the hg checkout of go.tools fails, check for Internet
connectivity before failing.
R=golang-dev, shivakumar.gn
CC=golang-dev
https://golang.org/cl/12814043
Now there's only one copy of the flow graph construction
and dominator computation, and different optimizations
can attach different annotations to the instructions.
R=ken2
CC=golang-dev
https://golang.org/cl/12797045