Dmitry Vyukov [Tue, 10 Feb 2015 14:26:26 +0000 (17:26 +0300)]
os: give race detector chance to override Exit(0)
Racy tests do not fail currently, they do os.Exit(0).
So if you run go test without -v, you won't even notice.
This was probably introduced with testing.TestMain.
Racy programs do not have the right to finish successfully.
Mikio Hara [Thu, 26 Mar 2015 14:26:45 +0000 (23:26 +0900)]
net: simplify test helpers
This change consolidates test helpers that test platform capabilities.
testNetwork, testAddress and testListenArgs report whether given
ariguments are testable on the current platform configuration to
mitigate to receive weird test results.
Change-Id: Ie1ed568a1f9cc50f3155945ea01562904bc2c389
Reviewed-on: https://go-review.googlesource.com/8076 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Srdjan Petrovic [Tue, 17 Mar 2015 18:57:11 +0000 (11:57 -0700)]
cmd/go: add -asmflags build flag
We need this in order to pass the "-shared" flag to the assembler.
Change-Id: I9c15cfe4d32c1e5e8cae1b9b2c924cfd77923b55
Reviewed-on: https://go-review.googlesource.com/7694 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Srdjan Petrovic [Tue, 17 Mar 2015 16:47:01 +0000 (09:47 -0700)]
cmd: linker changes for shared library initialization
Suggested by iant@, this change:
- looks for a symbol _rt0_<GOARCH>_<GOOS>_lib,
- if the symbol is present, adds a new entry into the .init_array ELF
section that points to the symbol.
The end-effect is that the symbol _rt0_<GOARCH>_<GOOS>_lib will be
invoked as soon as the (ELF) shared library is loaded, which will in turn
initialize the runtime. (To be implemented.)
Change-Id: I99911a180215a6df18f8a18483d12b9b497b48f4
Reviewed-on: https://go-review.googlesource.com/7692
TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Hyang-Ah Hana Kim [Fri, 27 Mar 2015 00:02:50 +0000 (20:02 -0400)]
runtime/pprof: fix TestCPUProfileWithFork for GOOS=android.
1) Large allocation in this test caused crash. This was not
detected by builder because builder runs tests with -test.short.
2) The command "go" for forking doesn't exist in some platforms
including android. This change uses the test binary itself which
is guaranteed to exist.
This change also adds logging of the total samples collected in
TestCPUProfileMultithreaded test that is flaky in android-arm
builder.
Change-Id: I225c6b7877d811edef8b25e7eb00559450640c42
Reviewed-on: https://go-review.googlesource.com/8131 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Brad Fitzpatrick [Fri, 27 Mar 2015 09:08:19 +0000 (10:08 +0100)]
syscall: apply the errno allocation fix to other operating systems
The previously-submitted https://go-review.googlesource.com/#/c/6701
didn't include dragonfly, freebsd, nacl, netbsd, openbsd, or solaris.
(or things like darwin/arm or ppc64 or arm64)
So do them all.
Note I had to copy the function into tables_nacl.go. I found that
preferable to creating a new file just to have suitable build
tags. It's likely this function will be mirrored to plan9 and windows
later too, each of the 4 with their own policy of which error values
are common.
The corresponding x/sys CL for this CL is https://golang.org/cl/8190
but it excludes nacl (not in x/sys) and solaris (already broken).
Brad Fitzpatrick [Fri, 27 Mar 2015 09:19:17 +0000 (10:19 +0100)]
net: reenable a previously skipped test
Update #8859
Change-Id: I5b0005b308e83954a495f06d27b7d8d30e813820
Reviewed-on: https://go-review.googlesource.com/8193 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Austin Clements [Thu, 26 Mar 2015 19:50:22 +0000 (15:50 -0400)]
runtime: disallow write barriers in handoffp and callees
handoffp by definition runs without a P, so it's not allowed to have
write barriers. It doesn't have any right now, but mark it
nowritebarrier to disallow any creeping in in the future. handoffp in
turns calls startm, newm, and newosproc, all of which are "below Go"
and make sense to run without a P, so disallow write barriers in these
as well.
For most functions, we've done this because they may race with
stoptheworld() and hence must not have write barriers. For these
functions, it's a little different: the world can't stop while we're
in handoffp, so this race isn't present. But we implement this
restriction with a somewhat broader rule that you can't have a write
barrier without a P. We like this rule because it's simple and means
that our write barriers can depend on there being a P, even though
this rule is actually a little broader than necessary. Hence, even
though there's no danger of the race in these functions, we want to
adhere to the broader rule.
Change-Id: Ie22319c30eea37d703eb52f5c7ca5da872030b88
Reviewed-on: https://go-review.googlesource.com/8130
Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
Ian Lance Taylor [Thu, 26 Mar 2015 15:02:16 +0000 (08:02 -0700)]
syscall: change Dup,Dup2,Dup3 to use Syscall, not RawSyscall
This avoids hanging when a Go program uses a FUSE filesystem and the
dup system call has to close a file descriptor. When dup uses
RawSyscall then the goroutine calling dup will occupy a scheduler slot
(a p structure) during the call, and may block waiting for some other
goroutine to respond to the close call on the FUSE filesystem.
Changing to Syscall avoids the problem. This makes Dup a tiny bit
slower but is quite unlikely to make a difference for any real
programs.
Fixes #10202.
Change-Id: If6490a8f9b3c9cfed6acbfb4bfd1eaeac62ced17
Reviewed-on: https://go-review.googlesource.com/8095 Reviewed-by: Rob Pike <r@golang.org>
Austin Clements [Thu, 26 Mar 2015 16:14:26 +0000 (12:14 -0400)]
runtime: use uintXX instead of *byte for si_addr on Darwin
Currently, Darwin's siginfo type uses *byte for the si_addr
field. This results in unwanted write barriers in set_sigaddr. It's
also pointless since it never points to anything real and the get/set
methods return/take uintXX and cast it from/to the pointer.
All other arches use a uint type for this field. Change Darwin to
match. This simplifies the get/set methods and eliminates the unwanted
write barriers.
Austin Clements [Tue, 24 Mar 2015 15:51:24 +0000 (11:51 -0400)]
runtime: remove write barrier on G in sighandler
sighandler may run during a stop-the-world without a P, so it's not
allowed to have write barriers. Fix the G write to disable the write
barrier (this is safe because the G is reachable from allgs) and mark
the function nowritebarrier.
Change-Id: I907f05d3829e24eeb15fa4d020598af36710e87e
Reviewed-on: https://go-review.googlesource.com/8020 Reviewed-by: Rick Hudson <rlh@golang.org>
Ian Lance Taylor [Wed, 25 Mar 2015 00:31:31 +0000 (17:31 -0700)]
syscall: regenerate zsyscall_darwin_arm.go
This is mostly straightforward but it does introduce an odd change to
Fchflags and adds the Mlock related functions. These changes look
correct to me but I don't know why they weren't in the original file.
Change-Id: I1a01e075566d327a78b77e7354c9fb85b6ad1f22
Reviewed-on: https://go-review.googlesource.com/8062 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Rob Pike [Wed, 25 Mar 2015 20:17:54 +0000 (13:17 -0700)]
cmd/go: add $DOLLAR to the predefined variables for go generate
Without some hook like this, it's impossible to get a $ into the generate
command, which is necessary if you're trying to do some shell scripting
or regular expressions.
We could use backslash escaping but that's already tricky enough
because the strings are processed as Go strings. Using $ like this
means we need no more mechanism, just a predefined variable.
We may need to revisit this but I hope we can avoid new quoting rules.
Change-Id: Ieb478c8cc767a866765282472239ed3c1e5669a8
Reviewed-on: https://go-review.googlesource.com/8091 Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Ian Lance Taylor <iant@golang.org>
David Crawshaw [Wed, 25 Mar 2015 17:22:32 +0000 (13:22 -0400)]
misc/ios: simplify breakpoint timeout
The clever partial timer I added interacts badly with iOS app launch
timeout termination. A fixed timeout will be easier to debug.
Change-Id: I6eb4ee5f1431539f00fa707e8cde6f3cf86983fc
Reviewed-on: https://go-review.googlesource.com/8083 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
David Crawshaw [Wed, 25 Mar 2015 00:52:11 +0000 (20:52 -0400)]
misc/ios: timeout and continue waiting for getwd
Split out from cl/8024 for clarity and improved approach.
Rarely, "stop reason = breakpoint" does not appear in the lldb stop
text. However the program is ready to proceed. To be a little more
robust about those cases, we wait for two seconds, and if that text
doesn't appear but a prompt does we continue and hope for the best.
Worst case, this results in a harder to read failure message.
Change-Id: Ib20aa92564cdccefd2b7260417c647cd44122b66
Reviewed-on: https://go-review.googlesource.com/8080 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Matt Bostock [Sun, 22 Feb 2015 01:14:36 +0000 (01:14 +0000)]
crypto/tls: Correct minimum version in comment
Commit 604fa4d5 made TLS 1.0 the default minimum version. This commit
amends a comment to reflect that.
This is where the default is used in the absence of an explicit version
being set:
https://github.com/golang/go/blob/edadffa2f3464c48a234f3cf2fc092a03f91824f/src/crypto/tls/common.go#L391-L393
Change-Id: I8f1117ecdddc85bb1cc76a6834026505a380b793
Reviewed-on: https://go-review.googlesource.com/5525 Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com> Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
Shenghou Ma [Thu, 18 Dec 2014 08:26:08 +0000 (03:26 -0500)]
runtime, syscall: use the new get_random_bytes syscall for NaCl
The SecureRandom named service was removed in
https://codereview.chromium.org/550523002. And the new syscall
was introduced in https://codereview.chromium.org/537543003.
Accepting this will remove the support for older version of
sel_ldr. I've confirmed that both pepper_40 and current
pepper_canary have this syscall.
After this change, we need sel_ldr from pepper_39 or above to
work.
Hyang-Ah (Hana) Kim [Tue, 24 Mar 2015 20:42:34 +0000 (16:42 -0400)]
os/exec: post-process lsof output on Android.
lsof is used to inspect the open file desciptors in exec_test.go.
In order to limit the output of lsof to the tested process, the tests use
lsof with the -p option, but the version of lsof in android seems to ignore
it. This change adds a post-processing step to filter out irrelevant entries.
Mikio Hara [Thu, 26 Feb 2015 08:52:26 +0000 (17:52 +0900)]
net/internal/socktest: new package
Package socktest provides utilities for socket testing.
This package allows test cases in the net package to simulate
complicated network conditions such as that a destination address is
resolvable/discoverable but is not routable/reachable at network layer.
Those conditions are required for testing functionality of timeout,
multiple address families.
Change-Id: Idbe32bcc3319b41b0cecac3d058014a93e13288b
Reviewed-on: https://go-review.googlesource.com/6090 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Alexandre Cesaro [Fri, 20 Mar 2015 11:22:49 +0000 (12:22 +0100)]
mime/quotedprintable: accept badly encoded bytes
RFC 2045 says:
An "=" followed by two hexadecimal digits, one or both
of which are lowercase letters in "abcdef", is formally
illegal. A robust implementation might choose to
recognize them as the corresponding uppercase letters.
David Crawshaw [Tue, 24 Mar 2015 13:22:35 +0000 (09:22 -0400)]
runtime: initialize extra M for cgo during mstart
Previously the extra m needed for cgo callbacks was created on the
first callback. This works for cgo, however the cgocallback mechanism
is also borrowed by badsignal which can run before any cgo calls are
made.
Now we initialize the extra M at runtime startup before any signal
handlers are registered, so badsignal cannot be called until the
extra M is ready.
Updates #10207.
Change-Id: Iddda2c80db6dc52d8b60e2b269670fbaa704c7b3
Reviewed-on: https://go-review.googlesource.com/7978 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
Rick Hudson [Tue, 24 Mar 2015 15:18:46 +0000 (11:18 -0400)]
runtime: Remove write barrier on g
There are calls to stdcall when the GC thinks the world is stopped
and stdcall write a *g for the CPU profiler. This produces a write
barrier but the GC is not prepared to deal with write barriers when
it thinks the world is stopped. Since the g is on allg it does not
need a write barrier to keep it alive so eliminate the write barrier.
Shenghou Ma [Sat, 14 Mar 2015 02:12:59 +0000 (22:12 -0400)]
cmd/go: update PE header magic for files generated by GNU ld
Change-Id: I2d2ea233f976aab3f356f9b508cdd246d5013e32 Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7536 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Shenghou Ma [Sat, 14 Mar 2015 02:12:09 +0000 (22:12 -0400)]
cmd/dist: enable external linking test for windows/amd64
Fixes #4069.
Change-Id: I2d2ea233f976aab3f356f9b508cdd246d5013e31 Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7535 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Shenghou Ma [Sat, 14 Mar 2015 02:10:48 +0000 (22:10 -0400)]
cmd/internal/ld, cmd/6l: external linking for windows/amd64
Change-Id: I2d2ea233f976aab3f356f9b508cdd246d5013e30 Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7534 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Shenghou Ma [Tue, 10 Mar 2015 08:11:30 +0000 (04:11 -0400)]
cmd/dist: enable external linking test for windows/386
Signed-off-by: Shenghou Ma <minux@golang.org>
Change-Id: I2d2ea233f976aab3f356f9b508cdd246d5013e2f
Reviewed-on: https://go-review.googlesource.com/7284 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Shenghou Ma [Mon, 9 Mar 2015 07:05:40 +0000 (03:05 -0400)]
cmd/internal/ld, cmd/8l: external linking for windows/386
Update #4069: this CL fixes the issue on windows/386.
Signed-off-by: Shenghou Ma <minux@golang.org>
Change-Id: I2d2ea233f976aab3f356f9b508cdd246d5013e2e
Reviewed-on: https://go-review.googlesource.com/7283 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Shenghou Ma [Tue, 10 Mar 2015 07:26:37 +0000 (03:26 -0400)]
runtime: use _main instead of main on windows/386
windows/386 also wants underscore prefix for external names.
This CL is in preparation of external linking support.
Change-Id: I2d2ea233f976aab3f356f9b508cdd246d5013e2d Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7282 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Shenghou Ma [Mon, 9 Mar 2015 03:04:48 +0000 (23:04 -0400)]
cmd/internal/ld, runtime: record argument size for cgo_dynimport stdcall syscalls
When external linking, we must link to implib provided by mingw, so we must use
properly decorated names for stdcalls.
Because the feature is only used in the runtime, I've designed a new decoration
scheme so that we can use the same decorated name for both 386 and amd64.
A stdcall function named FooEx from bar16.dll which takes 3 parameters will be
imported like this:
//go:cgo_import_dynamic runtime._FooEx FooEx%3 "bar16.dll"
Depending on the size of uintptr, the linker will later transform it to _FooEx@12
or _FooEx@24.
This is in prepration for the next CL that adds external linking support for
windows/386.
Change-Id: I2d2ea233f976aab3f356f9b508cdd246d5013e2c Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/7163 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Matthew Dempsky [Mon, 23 Mar 2015 22:28:51 +0000 (15:28 -0700)]
debug/dwarf, encoding/asn1, go/ast: fix old comments
The debug/dwarf and encoding/asn1 examples were added in 2009, a few
months before Go added implicit semicolons, and never updated.
The go/ast node types have always been named just "Expr", "Stmt", and
"Decl", so the comments about "ExprNode", "StmtNode", and "DeclNode"
were likely just mistaken because the interface tag methods are
"exprNode", "stmtNode", and "declNode", respectively.
Matthew Dempsky [Fri, 6 Mar 2015 01:45:11 +0000 (17:45 -0800)]
cmd/internal/ld: edit into more idiomatic Go code
Instead of reimplementing chained hash tables, just use maps.
Use bool instead of uint8 for variables only set to 0 or 1.
Fix parsing of `import foo "foo" // indirect` lines. Previously, this
was treated as an import of package path `"foo" // indirect`, which
could result in the cycle-detection code failing to detect a cycle
because it would be treated as a separate package from `"foo"`.
Also, since there are theoretically multiple quoted forms for a
package path, use strconv.Unquote to normalize them. Side benefit:
Unquote will complain if any trailing comments sneak back in.
Aside: For most Go archives, Go package data is only present in the
__.PKGDEF member, but unless -u is used, ldpkg is only called on the
_go_.6 member. Consequently, importcycles is a no-op when -u isn't
used as it has no package data to inspect.
Change-Id: I7076cf91a66726a8d9c5676adfea13c5532001fa
Reviewed-on: https://go-review.googlesource.com/7002 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Rob Pike <r@golang.org>
Nigel Tao [Mon, 23 Mar 2015 00:03:02 +0000 (11:03 +1100)]
image/internal/imageutil: new package, used by image/draw and image/jpeg.
The imageutil.DrawYCbCr function lives in an internal package because it
is needed by both the image/draw and image/jpeg packages, but it doesn't
seem right for one of those two to depend on the other.
It could eventually go into the image package, but that would require
committing to an API for the rest of Go 1.x.
Sebastien Binet [Fri, 27 Feb 2015 23:41:31 +0000 (00:41 +0100)]
cmd/go: allow go get with local path
Previously, running 'go get' with a local path would correctly
download the package but fail to install it.
This is because a sticky error - resulting from discovering that the
package needed to be downloaded - was still around.
Theoretically, such sticky errors would be cleared but they weren't
because the map tracking these errors were indexed with the correct
canonical import path of the package (e.g. "ex.com/x/pkg") whereas the
clearing was done with the local path (e.g. "./pkg".)
Always use the canonical import path.
Fixes #9767
Change-Id: Ia0e8a51ac591d4c833d11285da5b767ef7ed8ad2
Reviewed-on: https://go-review.googlesource.com/6266 Reviewed-by: Rob Pike <r@golang.org>
Michael Matloob [Sun, 28 Dec 2014 08:17:01 +0000 (00:17 -0800)]
regexp: port RE2's bitstate backtracker to the regexp package
This is a port of RE2's bitstate backtracker, which triggers under
the same conditions that the RE2 backtracker triggers. However I wasn't
sure how to port over some of the optimizations in the RE2 backtracker,
and there is a ~2% penalty on benchmarks that don't trigger the backtracker.
Michael MacInnis [Wed, 18 Feb 2015 03:23:16 +0000 (22:23 -0500)]
syscall: Add Foreground and Pgid to SysProcAttr
On Unix, when placing a child in a new process group, allow that group
to become the foreground process group. Also, allow a child process to
join a specific process group.
When setting the foreground process group, Ctty is used as the file
descriptor of the controlling terminal. Ctty has been added to the BSD
and Solaris SysProcAttr structures and the handling of Setctty changed
to match Linux.
Change-Id: I18d169a6c5ab8a6a90708c4ff52eb4aded50bc8c
Reviewed-on: https://go-review.googlesource.com/5130
Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Brad Fitzpatrick [Thu, 12 Feb 2015 16:42:11 +0000 (08:42 -0800)]
net/http: ignore the Unix epoch time in ServeContent
ServeContent ignored zero time.Time{} values when generating
Last-Modified response headers and checking If-Modified-Since request
headers. Do the same for a time.Time representing the Unix epoch zero
value, as this is a common bogus value. Callers who really want to
send that value (incredibly unlikely) can add a nanosecond to it and
it will be truncated to second granularity anyway.
Fixes #9842
Change-Id: I69f697bfc4017404a92a34e3fe57e2711c1e299d
Reviewed-on: https://go-review.googlesource.com/7915 Reviewed-by: David Symonds <dsymonds@golang.org>
Robert Griesemer [Fri, 9 Jan 2015 00:01:31 +0000 (16:01 -0800)]
spec: extend type omission rules for composite literal element values
to map element keys
Composite literals containing element values that are themselves composite
literals may leave away the element's literal types if they are identical
to the enclosing composite literal's element type.
(http://golang.org/ref/spec#Composite_literals)
When we made this change, we forgot to apply the analogous rule to map
literal keys. This change generalizes that rule. Added more examples,
including one showing the recursive application of the elision rules.
This is a fully backward-compatible language change. It was discussed
some time back.
Fixes #8589.
To be submitted once all compilers accept the extension.
Robert Griesemer [Fri, 20 Mar 2015 20:02:56 +0000 (13:02 -0700)]
math/big: enable pure Go (no assembly) build with build tag
To use a pure Go implementation of the low-level arithmetic
functions (when no platform-specific assembly implementations
are available), set the build tag math_big_pure_go.
This will make it easy to vendor the math/big package where no
assembly is available (for instance for use with gc which relies
on 1.4 functionality for now).
Russ Cox [Fri, 20 Mar 2015 04:06:10 +0000 (00:06 -0400)]
cmd/internal/gc: inline x := y.(*T) and x, ok := y.(*T)
These can be implemented with just a compare and a move instruction.
Do so, avoiding the overhead of a call into the runtime.
These assertions are a significant cost in Go code that uses interface{}
as a safe alternative to C's void* (or unsafe.Pointer), such as the
current version of the Go compiler.
*T here includes pointer to T but also any Go type represented as
a single pointer (chan, func, map). It does not include [1]*T or struct{*int}.
That requires more work in other parts of the compiler; there is a TODO.
Change-Id: I7ff681c20d2c3eb6ad11dd7b3a37b1f3dda23965
Reviewed-on: https://go-review.googlesource.com/7862 Reviewed-by: Rob Pike <r@golang.org>
Russ Cox [Wed, 18 Mar 2015 21:26:36 +0000 (17:26 -0400)]
cmd/internal/gc: move cgen, regalloc, et al to portable code
This CL moves the bulk of the code that has been copy-and-pasted
since the initial 386 port back into a shared place, cutting 5 copies to 1.
The motivation here is not cleanup per se but instead to reduce the
cost of introducing changes in shared concepts like regalloc or general
expression evaluation. For example, a change after this one will
implement x.(*T) without a call into the runtime. This CL makes that
followup work 5x easier.
The single copy still has more special cases for architecture details
than I'd like, but having them called out explicitly like this at least
opens the door to generalizing the conditions and smoothing out
the distinctions in the future.
This is a LARGE CL. I started by trying to pull in one function at a time
in a sequence of CLs and it became clear that everything was so
interrelated that it had to be moved as a whole. Apologies for the size.
It is not clear how many more releases this code will matter for;
eventually it will be replaced by Keith's SSA work. But as noted above,
the deduplication was necessary to reduce the cost of working on
the current code while we have it.
Passes tests on amd64, 386, arm, and ppc64le.
Can build arm64 binaries but not tested there.
Being able to build binaries means it is probably very close.
Rob Pike [Fri, 20 Mar 2015 17:47:52 +0000 (10:47 -0700)]
html/template: fix crash when escaping incomplete template
text/template turned this into an error but html/template crashed.
Refactor text/template.Execute to export a new function,
text/template.DefinedTemplates, so html/template can get the same
helpful error message in this case, and invoke it when there is no
definition for a template being escaped.
Robert Griesemer [Wed, 18 Mar 2015 21:10:22 +0000 (14:10 -0700)]
cmd/internal/gc: use big.Int to represent Mpint bits
- renamed (existing) Mpint -> Mpfix
- defined (new) Mpint using big.Int
- modified funcs mpxxx operating on new Mpint
- renamed funcs mpxxx -> _mpxxx if still needed with Mpfix
- left old (possibly unused) code in place for comparison
Austin Clements [Thu, 19 Mar 2015 21:46:18 +0000 (17:46 -0400)]
runtime: exit getfull barrier if there are partial workbufs
Currently, we only exit the getfull barrier if there is work on the
full list, even though the exit path will take work from either the
full or partial list. Change this to exit the barrier if there is work
on either the full or partial lists.
I believe it's currently safe to check only the full list, since
during mark termination there is no reason to put a workbuf on a
partial list. However, checking both is more robust.
Change-Id: Icf095b0945c7cad326a87ff2f1dc49b7699df373
Reviewed-on: https://go-review.googlesource.com/7840 Reviewed-by: Rick Hudson <rlh@golang.org>