| Age | Commit message (Collapse) | Author |
|
Fixes #8297
LGTM=bradfitz
R=golang-codereviews, bradfitz, khr, dave, dvyukov
CC=golang-codereviews
https://golang.org/cl/119240043
|
|
LGTM=bradfitz, dvyukov
R=golang-codereviews, bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/120190044
|
|
Package runtime's C functions written to be called from Go
started out written in C using carefully constructed argument
lists and the FLUSH macro to write a result back to memory.
For some functions, the appropriate parameter list ended up
being architecture-dependent due to differences in alignment,
so we added 'goc2c', which takes a .goc file containing Go func
declarations but C bodies, rewrites the Go func declaration to
equivalent C declarations for the target architecture, adds the
needed FLUSH statements, and writes out an equivalent C file.
That C file is compiled as part of package runtime.
Native Client's x86-64 support introduces the most complex
alignment rules yet, breaking many functions that could until
now be portably written in C. Using goc2c for those avoids the
breakage.
Separately, Keith's work on emitting stack information from
the C compiler would require the hand-written functions
to add #pragmas specifying how many arguments are result
parameters. Using goc2c for those avoids maintaining #pragmas.
For both reasons, use goc2c for as many Go-called C functions
as possible.
This CL is a replay of the bulk of CL 15400047 and CL 15790043,
both of which were reviewed as part of the NaCl port and are
checked in to the NaCl branch. This CL is part of bringing the
NaCl code into the main tree.
No new code here, just reformatting and occasional movement
into .h files.
LGTM=r
R=dave, alex.brainman, r
CC=golang-codereviews
https://golang.org/cl/65220044
|
|
When growing slice take into account size of the allocated memory block.
Also apply the same optimization to string->[]byte conversion.
Fixes #6307.
benchmark old ns/op new ns/op delta
BenchmarkAppendGrowByte 4541036 4434108 -2.35%
BenchmarkAppendGrowString 59885673 44813604 -25.17%
LGTM=khr
R=khr
CC=golang-codereviews, iant, rsc
https://golang.org/cl/53340044
|
|
A new transformation during walk turns append calls
into a combination of growslice and memmove.
benchmark old ns/op new ns/op delta
BenchmarkAppend 141 141 +0.00%
BenchmarkAppend1Byte 18 11 -39.56%
BenchmarkAppend4Bytes 19 10 -42.63%
BenchmarkAppend7Bytes 18 10 -42.16%
BenchmarkAppend8Bytes 18 10 -40.44%
BenchmarkAppend15Bytes 19 11 -41.67%
BenchmarkAppend16Bytes 19 11 -41.97%
BenchmarkAppend32Bytes 23 14 -38.82%
BenchmarkAppendStr1Byte 14 10 -23.78%
BenchmarkAppendStr4Bytes 14 11 -21.13%
BenchmarkAppendStr8Bytes 14 10 -25.17%
BenchmarkAppendStr16Bytes 19 11 -41.45%
BenchmarkAppendStr32Bytes 18 14 -19.44%
BenchmarkAppendSpecialCase 62 63 +1.77%
R=golang-dev, khr, cshapiro, rsc, dave
CC=golang-dev
https://golang.org/cl/12815046
|
|
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12798043
|
|
Fixes #4963.
Sets the append crossover to 0 on intel platforms.
Results for linux/amd64 Core i5 SNB
benchmark old ns/op new ns/op delta
BenchmarkAppend 102 104 +1.96%
BenchmarkAppend1Byte 10 11 +0.92%
BenchmarkAppend4Bytes 15 11 -28.10%
BenchmarkAppend7Bytes 17 12 -32.58%
BenchmarkAppend8Bytes 18 12 -36.17%
BenchmarkAppend15Bytes 24 11 -55.02%
BenchmarkAppend16Bytes 25 11 -56.03%
BenchmarkAppend32Bytes 11 12 +4.31%
BenchmarkAppendStr1Byte 8 9 +13.99%
BenchmarkAppendStr4Bytes 11 9 -17.52%
BenchmarkAppendStr8Bytes 14 9 -35.70%
BenchmarkAppendStr16Bytes 21 9 -55.19%
BenchmarkAppendStr32Bytes 10 10 -5.66%
BenchmarkAppendSpecialCase 49 52 +7.96%
Results for linux/386 Atom(TM) CPU 330 @ 1.60GHz
benchmark old ns/op new ns/op delta
BenchmarkAppend 219 218 -0.46%
BenchmarkAppend1Byte 75 72 -3.44%
BenchmarkAppend4Bytes 92 73 -19.87%
BenchmarkAppend7Bytes 108 74 -31.20%
BenchmarkAppend8Bytes 116 74 -35.95%
BenchmarkAppend15Bytes 162 77 -52.22%
BenchmarkAppend16Bytes 169 77 -54.20%
BenchmarkAppend32Bytes 88 86 -2.38%
BenchmarkAppendStr1Byte 57 59 +3.32%
BenchmarkAppendStr4Bytes 72 59 -17.40%
BenchmarkAppendStr8Bytes 92 60 -34.70%
BenchmarkAppendStr16Bytes 141 63 -54.89%
BenchmarkAppendStr32Bytes 75 73 -2.64%
BenchmarkAppendSpecialCase 270 270 +0.00%
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12440044
|
|
R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/10259043
|
|
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/9648044
|
|
Compiler can detect and delete dead code with enums,
but can not with static vars.
R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/9377043
|
|
Also make the crossover point an architecture-dependent constant,
although it's the same everywhere for now.
BenchmarkAppendStr1Byte 416 145 -65.14%
BenchmarkAppendStr4Bytes 743 217 -70.79%
BenchmarkAppendStr8Bytes 421 270 -35.87%
BenchmarkAppendStr16Bytes 415 403 -2.89%
BenchmarkAppendStr32Bytes 415 391 -5.78%
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7459044
|
|
Update #3679.
BenchmarkAppend1Byte 484 199 -58.88%
BenchmarkAppend4Bytes 829 286 -65.50%
BenchmarkAppend8Bytes 484 365 -24.59%
BenchmarkAppend16Bytes 484 498 +2.89%
BenchmarkAppend32Bytes 486 484 -0.41%
R=iant, dave, rsc
CC=golang-dev
https://golang.org/cl/7443047
|
|
Fixes #4085.
R=ken2
CC=golang-dev
https://golang.org/cl/7277047
|
|
Range access functions are already available in TSan library
but were not yet used.
Time for go test -race -short:
Before:
compress/flate 24.244s
exp/norm >200s
go/printer 78.268s
After:
compress/flate 17.760s
exp/norm 5.537s
go/printer 5.738s
Fixes #4250.
R=dvyukov, golang-dev, fullung
CC=golang-dev
https://golang.org/cl/7229044
|
|
When a race happens inside of runtime (chan, slice, etc),
currently reports contain only user file:line.
If the line contains a complex expression,
it's difficult to figure out where the race exactly.
This change adds one more top frame with exact
runtime function (e.g. runtime.chansend, runtime.mapaccess).
R=golang-dev
CC=golang-dev
https://golang.org/cl/6851125
|
|
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6819107
|
|
R=rsc
CC=golang-dev
https://golang.org/cl/6569057
|
|
This is a part of a bigger change that adds data race detection feature:
https://golang.org/cl/6456044
R=rsc
CC=gobot, golang-dev
https://golang.org/cl/6535050
|
|
Fixes #4197.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6611056
|
|
This CL makes the runtime understand that the type of
the len or cap of a map, slice, or string is 'int', not 'int32',
and it is also careful to distinguish between function arguments
and results of type 'int' vs type 'int32'.
In the runtime, the new typedefs 'intgo' and 'uintgo' refer
to Go int and uint. The C types int and uint continue to be
unavailable (cause intentional compile errors).
This CL does not change the meaning of int, but it should make
the eventual change of the meaning of int on amd64 a bit
smoother.
Update #2188.
R=iant, r, dave, remyoudompheng
CC=golang-dev
https://golang.org/cl/6551067
|
|
R=rsc
CC=golang-dev
https://golang.org/cl/6285047
|
|
R=rsc, ality, rogpeppe, minux.ma, dave
CC=golang-dev
https://golang.org/cl/5966075
|
|
Collapse the arch,os-specific directories into the main directory
by renaming xxx/foo.c to foo_xxx.c, and so on.
There are no substantial edits here, except to the Makefile.
The assumption is that the Go tool will #define GOOS_darwin
and GOARCH_amd64 and will make any file named something
like signals_darwin.h available as signals_GOOS.h during the
build. This replaces what used to be done with -I$(GOOS).
There is still work to be done to make runtime build with
standard tools, but this is a big step. After this we will have
to write a script to generate all the generated files so they
can be checked in (instead of generated during the build).
R=r, iant, r, lucio.dere
CC=golang-dev
https://golang.org/cl/5490053
|
|
Equality on structs will require arbitrary code for type equality,
so change algorithm in type data from uint8 to table pointer.
In the process, trim top-level map structure from
104/80 bytes (64-bit/32-bit) to 24/12.
Equality on structs will require being able to call code generated
by the Go compiler, and C code has no way to access Go return
values, so change the hash and equal algorithm functions to take
a pointer to a result instead of returning the result.
R=ken
CC=golang-dev
https://golang.org/cl/5453043
|
|
R=gri, iant, iant
CC=golang-dev
https://golang.org/cl/5375093
|
|
Fixes #2274
R=rsc, gri, dsymonds, bradfitz, lvd
CC=golang-dev
https://golang.org/cl/5149045
|
|
Linux/amd64, 2 x Intel Xeon E5620, 8 HT cores, 2.40GHz
benchmark old ns/op new ns/op delta
BenchmarkFinalizer 420.00 261.00 -37.86%
BenchmarkFinalizer-2 985.00 201.00 -79.59%
BenchmarkFinalizer-4 1077.00 244.00 -77.34%
BenchmarkFinalizer-8 1155.00 180.00 -84.42%
BenchmarkFinalizer-16 1182.00 184.00 -84.43%
BenchmarkFinalizerRun 2128.00 1378.00 -35.24%
BenchmarkFinalizerRun-2 1655.00 1418.00 -14.32%
BenchmarkFinalizerRun-4 1634.00 1522.00 -6.85%
BenchmarkFinalizerRun-8 2213.00 1581.00 -28.56%
BenchmarkFinalizerRun-16 2424.00 1599.00 -34.03%
Darwin/amd64, Intel L9600, 2 cores, 2.13GHz
benchmark old ns/op new ns/op delta
BenchmarkChanCreation 1451.00 926.00 -36.18%
BenchmarkChanCreation-2 3124.00 1412.00 -54.80%
BenchmarkChanCreation-4 6121.00 2628.00 -57.07%
BenchmarkFinalizer 684.00 420.00 -38.60%
BenchmarkFinalizer-2 11195.00 398.00 -96.44%
BenchmarkFinalizer-4 15862.00 654.00 -95.88%
BenchmarkFinalizerRun 2025.00 1397.00 -31.01%
BenchmarkFinalizerRun-2 3920.00 1447.00 -63.09%
BenchmarkFinalizerRun-4 9471.00 1545.00 -83.69%
R=golang-dev, cw, rsc
CC=golang-dev
https://golang.org/cl/4963057
|
|
Fixes #1774.
Fixes #2095.
Fixes #2097.
R=ken2
CC=golang-dev
https://golang.org/cl/4826046
|
|
arguments.
R=rsc
CC=golang-dev
https://golang.org/cl/4517057
|
|
issue 1604
R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4313062
|
|
GC is still single-threaded.
Multiple threads will happen in another CL.
Garbage collection pauses are typically
about half as long as they were before this CL.
R=brainman, iant, r
CC=golang-dev
https://golang.org/cl/3975046
|
|
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries. The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.
The symbols left alone are:
** known to cgo **
_cgo_free
_cgo_malloc
libcgo_thread_start
initcgo
ncgocall
** known to linker **
_rt0_$GOARCH
_rt0_$GOARCH_$GOOS
text
etext
data
end
pclntab
epclntab
symtab
esymtab
** known to C compiler **
_divv
_modv
_div64by32
etc (arch specific)
Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.
Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.
R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
|
|
R=ken2
CC=golang-dev
https://golang.org/cl/2757042
|
|
R=ken2
CC=golang-dev
https://golang.org/cl/2741041
|
|
move constant index checking to front end
x[2:1] is a compile-time error now too
R=ken2
CC=golang-dev
https://golang.org/cl/1848056
|
|
R=r
CC=golang-dev
https://golang.org/cl/1081042
|
|
Fixes #589.
R=ken2
CC=golang-dev
https://golang.org/cl/1032044
|
|
remove internal functions from traces in gopprof instead.
R=r
CC=golang-dev
https://golang.org/cl/855046
|
|
R=ken2, r
CC=golang-dev
https://golang.org/cl/871042
|
|
no way to get the data out yet.
add prototype for runtime.Callers,
missing from last CL.
R=r
CC=golang-dev
https://golang.org/cl/713041
|
|
* add bit tracking finalizer status, avoiding getfinalizer lookup
* add ability to allocate uncleared memory
R=iant
CC=golang-dev
https://golang.org/cl/207044
|
|
(eliminate assumption of package global name space,
make code easier to move between packages).
R=r
CC=golang-dev
https://golang.org/cl/194072
|
|
to provide functionality previously hacked in to
reflect and gob.
R=r
https://golang.org/cl/165076
|
|
the one-item case could be generalized easily with no cost. worth considering.
R=rsc
CC=golang-dev, cw
https://golang.org/cl/167044
|
|
* broken by reflect, gob
TBR=r
https://golang.org/cl/166077
|
|
* inform garbage collector about memory with no pointers in it
1.9s gcc reverse-complement.c
reverse-complement.go
4.5s / 3.5s original, with/without bounds checks
3.5s / 3.3s bounds check reduction
3.3s / 2.8s smarter garbage collector
2.6s / 2.3s assembler bytes.IndexByte
2.5s / 2.1s even smarter garbage collector (this CL)
R=r
https://golang.org/cl/165064
|
|
* add runtime sliceslice1 for x[lo:]
* remove runtime arraytoslice, rewriting &arr into arr[0:len(arr)].
* port cgen_inline into 8g, 5g.
* use native memmove in maps
R=ken2
https://golang.org/cl/157106
|
|
R=rsc
https://golang.org/cl/156056
|
|
did not test 386, but should work
shouldnt matter if copy is not used
R=rsc
https://golang.org/cl/156055
|
|
R=ken
OCL=35919
CL=35919
|