- 25 Feb, 2013 5 commits
-
-
Russ Cox authored
The type information is (and for years has been) included as an extra field in the address chunk of an instruction. Unfortunately, suppose there is a string at a+24(FP) and we have an instruction reading its length. It will say: MOVQ x+32(FP), AX and the type of *that* argument is int (not slice), because it is the length being read. This confuses the picture seen by debuggers and now, worse, by the garbage collector. Instead of attaching the type information to all uses, emit an explicit list of TYPE instructions with the information. The TYPE instructions are no-ops whose only role is to provide an address to attach type information to. For example, this function: func f(x, y, z int) (a, b string) { return } now compiles into: --- prog list "f" --- 0000 (/Users/rsc/x.go:3) TEXT f+0(SB),$0-56 0001 (/Users/rsc/x.go:3) LOCALS , 0002 (/Users/rsc/x.go:3) TYPE x+0(FP){int},$8 0003 (/Users/rsc/x.go:3) TYPE y+8(FP){int},$8 0004 (/Users/rsc/x.go:3) TYPE z+16(FP){int},$8 0005 (/Users/rsc/x.go:3) TYPE a+24(FP){string},$16 0006 (/Users/rsc/x.go:3) TYPE b+40(FP){string},$16 0007 (/Users/rsc/x.go:3) MOVQ $0,b+40(FP) 0008 (/Users/rsc/x.go:3) MOVQ $0,b+48(FP) 0009 (/Users/rsc/x.go:3) MOVQ $0,a+24(FP) 0010 (/Users/rsc/x.go:3) MOVQ $0,a+32(FP) 0011 (/Users/rsc/x.go:4) RET , The { } show the formerly hidden type information. The { } syntax is used when printing from within the gc compiler. It is not accepted by the assemblers. The same type information is now included on global variables: 0055 (/Users/rsc/x.go:15) GLOBL slice+0(SB){[]string},$24(AL*0) This more accurate type information fixes a bug in the garbage collector's precise heap collection. The linker only cares about globals right now, but having the local information should make things a little nicer for Carl in the future. Fixes #4907. R=ken2 CC=golang-dev https://golang.org/cl/7395056
-
Robert Griesemer authored
See also CL 7383051 for details. R=adonovan, bradfitz CC=golang-dev https://golang.org/cl/7378063
-
Roger Peppe authored
It's accessed without mutex protection in a different goroutine from the one that sets it. Also make sure that Client.Call after Client.Close will reliably return ErrShutdown, and that clients see ErrShutdown rather than io.EOF when appropriate. Suggestions welcome for a way to reliably test the mutex issue. R=r, iant CC=golang-dev https://golang.org/cl/7338045
-
Mikio Hara authored
This CL addresses the comments on CL 7368046 that I've overlooked. Update #4866. R=golang-dev, dave CC=golang-dev https://golang.org/cl/7369052
-
Rémy Oudompheng authored
Fixes #4888. R=golang-dev, gri CC=golang-dev https://golang.org/cl/7383051
-
- 24 Feb, 2013 10 commits
-
-
Volker Dobler authored
Added the command line flag -ex to godoc to print examples in text output. Samples from the generated output: $ godoc -ex strings Index ... func Index(s, sep string) int Index returns the index of the first instance of sep in s, or -1 if sep is not present in s. Example: fmt.Println(strings.Index("chicken", "ken")) fmt.Println(strings.Index("chicken", "dmr")) // Output: // 4 // -1 ... $ godoc -ex container/heap ... package heap import "container/heap" Package heap provides heap operations for any type that implements heap.Interface. A heap is a tree with the property that each node is the minimum-valued node in its subtree. Example: // This example demonstrates an integer heap built using the heap interface. package heap_test import ( "container/heap" "fmt" ... Example: // This example demonstrates a priority queue built using the heap interface. package heap_test import ( "container/heap" "fmt" ) ... Fixes #3587. R=golang-dev, minux.ma, adg, rsc, gri CC=golang-dev https://golang.org/cl/7356043
-
Rob Pike authored
R=golang-dev, kamil.kisiel, bradfitz CC=golang-dev https://golang.org/cl/7369049
-
Rob Pike authored
Made possible by go/types, as long as the package type-checks OK. Fixes #4684. R=golang-dev CC=golang-dev https://golang.org/cl/7407045
-
Rémy Oudompheng authored
The heuristics for BitLen of a product of randomly generated primes are wrong, and the generated candidates never match the required size for nprimes > 10. This corner case is not expected to be used in practice. R=agl CC=golang-dev https://golang.org/cl/7397052
-
Shenghou Ma authored
Executable heap is gone on Unix! R=golang-dev, dave, bradfitz CC=golang-dev https://golang.org/cl/7405045
-
Shenghou Ma authored
Or gcc (-fPIC) will complain: cmd/dist/unix.c: In function ‘cansse2’ cmd/dist/unix.c:774: error: can't find a register in class ‘BREG’ while reloading ‘asm’ cmd/dist/unix.c:774: error: ‘asm’ operand has impossible constraints This affects bootstrapping on native Darwin/386 where all code is compiled with -fPIC. R=golang-dev, iant CC=golang-dev https://golang.org/cl/7394047
-
Mikio Hara authored
This CL allows to receive network interface arrival and depature notifications through routing sockets on BSD variants. So far Darwin doesn't support this feature. Also does small simplification. Update #4866. R=golang-dev, lucio.dere, dave CC=golang-dev https://golang.org/cl/7365055
-
Mikio Hara authored
Update #4866. R=golang-dev CC=golang-dev https://golang.org/cl/7382053
-
Mikio Hara authored
Update #4866. R=golang-dev, bradfitz, dave CC=golang-dev https://golang.org/cl/7382052
-
Mikio Hara authored
Update #4866. R=golang-dev, dave CC=golang-dev https://golang.org/cl/7398047
-
- 23 Feb, 2013 8 commits
-
-
Rob Pike authored
Fixes #4404. R=gri, rsc CC=golang-dev https://golang.org/cl/7378061
-
Robin Eklind authored
Replace setsid with c_ISGID since the constant is already defined. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7403048
-
Shenghou Ma authored
1. Workaround the smart clang diagnostics with -Qunused-arguments: clang: error: argument unused during compilation: '-XXX' 2. if "clang -print-libgcc-file-name" returns non-absolute path, don't provide that on linker command line. 3. Fix dwarf.PtrType.Size() in cmd/cgo as clang doesn't generate DW_AT_byte_size for pointer types. 4. Workaround warnings for -Wno-unneeded-internal-declaration with -Wno-unknown-warning-option. 5. Add -Wno-unused-function. 6. enable race detector test on darwin with clang (at least Apple clang version 1.7 (tags/Apple/clang-77) works). Requires CL 7354043. Update #4829 This should fix most parts of the problem, but one glitch still remains. DWARF generated by newer clang doesn't differentiate these two function types: void *malloc(size_t); void *malloc(unsigned long int); so you might need to do this to make make.bash pass: sed -i -e 's/C.malloc(C.size_t/C.malloc(C.ulong/' pkg/os/user/lookup_unix.go R=golang-dev, dave, iant, rsc CC=golang-dev https://golang.org/cl/7351044
-
Dmitriy Vyukov authored
R=golang-dev, alex.brainman CC=golang-dev https://golang.org/cl/7407044
-
Dmitriy Vyukov authored
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7402047
-
Dmitriy Vyukov authored
to minimize diffs of new scheduler R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7381048
-
Rob Pike authored
We need go/types to discriminate the Error method from the error interface and the Error method of the testing package. Fixes #4753. R=golang-dev, bradfitz, gri CC=golang-dev https://golang.org/cl/7396054
-
Dave Cheney authored
Move Skip and friends into *common so benchmarks can also be skipped. R=golang-dev, gustav.paul, rsc CC=golang-dev https://golang.org/cl/7379046
-
- 22 Feb, 2013 17 commits
-
-
Mikio Hara authored
R=golang-dev, r CC=golang-dev https://golang.org/cl/7403049
-
Carl Shapiro authored
Fixes #4875. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7376049
-
Akshat Kumar authored
At least one test (in package runtime) depends on `go' being in $path. We simply bind GOROOT/bin before /bin to make sure the latest copy of the binary is accessible there. R=rsc, rminnich, ality CC=golang-dev https://golang.org/cl/7391047
-
Akshat Kumar authored
Plan 9 I/O preserves message boundaries, while Go library code is written for UNIX-like operating systems which do not. Avoid doing zero-length writes in package os. R=rsc, rminnich, ality, rminnich, r CC=golang-dev https://golang.org/cl/7406046
-
Russ Cox authored
R=ken2 CC=golang-dev https://golang.org/cl/7399050
-
Rob Pike authored
This is a simple refactoring of main.go that will enable the type checker to be used during vetting. The change has an unimportant effect on the arguments: it now assumes that all files named explicitly on the command line belong to the same package. When run by the go command, this was true already. Also restore a missing parenthesis from an error message. R=golang-dev, gri, bradfitz CC=golang-dev https://golang.org/cl/7393052
-
Russ Cox authored
For now, all the callbacks from C use top-level Go functions, so they use the equivalent C function pointer, and will continue to do so. But perhaps some day this will be useful for calling a Go func value (at least if the type is already known). More importantly, the Windows callback code needs to be able to use cgocallback_gofunc to call a Go func value. Should fix the Windows build. R=ken2 CC=golang-dev https://golang.org/cl/7388049
-
Rob Pike authored
R=adonovan CC=golang-dev https://golang.org/cl/7386052
-
Russ Cox authored
Step 4 of http://golang.org/s/go11func. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7393049
-
Russ Cox authored
Step 3 of http://golang.org/s/go11func. Fixes #3736. Fixes #3738. Fixes #4081. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/7393050
-
Alan Donovan authored
We wrap the final '...' argument's type in types.Slice. Added tests. Also: - Function.writeSignature: suppress slice '[]' when printing variadic arg '...'. - Eliminate Package.ImportPath field; redundant w.r.t. Package.Types.Path. - Use "TODO: (opt|fix)" notation more widely. - Eliminate many redundant/stale TODOs. R=gri CC=golang-dev https://golang.org/cl/7378057
-
Russ Cox authored
Change ARM context register to R7, to get out of the way of the register allocator during the compilation of the prologue statements (it wants to use R0 as a temporary). Step 2 of http://golang.org/s/go11func. R=ken2 CC=golang-dev https://golang.org/cl/7369048
-
Russ Cox authored
The new src argument is ignored during linking (that is, CALL r1, r2 is identical to CALL r2 for linking), but it serves as a hint to the 5g/6g/8g optimizer that the src register is live on entry to the called function and must be preserved. It is possible to avoid exposing this fact to the rest of the toolchain, keeping it entirely within 5g/6g/8g, but I think it will help to be able to look in object files and assembly listings and linker -a / -W output to see CALL instructions are "Go func value" calls and which are "C function pointer" calls. R=ken2 CC=golang-dev https://golang.org/cl/7364045
-
Brad Fitzpatrick authored
This makes Go's quoted-printable decoder more like other popular ones, allowing through a bare \r or \n, and also passes through \r\n which looked like a real bug before. Fixes #4771 R=minux.ma CC=golang-dev https://golang.org/cl/7300092
-
Russ Cox authored
R=golang-dev, dvyukov CC=golang-dev https://golang.org/cl/7382049
-
Alan Donovan authored
By appending to the wrong (always empty) list, only the last anonymous field was being considered for promotion. Also: - eliminated "function-local NamedTypes" TODO; nothing to do. - fixed Function.DumpTo: printing of anon receivers was "( T)", now "(T)"; extracted writeSignature into own function. - eliminated blockNames function; thanks to BasicBlock.String, "%s" of []*BasicBlock is fine. - extracted buildReferrers into own function. exp/ssa can now build its own transitive closure. R=gri CC=golang-dev https://golang.org/cl/7384054
-
Russ Cox authored
R=golang-dev, dvyukov CC=golang-dev https://golang.org/cl/7395051
-