1
0
mirror of https://github.com/golang/go synced 2024-10-03 04:11:21 -06:00
Commit Graph

139 Commits

Author SHA1 Message Date
Russ Cox
33649bd278 runtime: introduce unsafe.New and unsafe.NewArray
to provide functionality previously hacked in to
    reflect and gob.

R=r
https://golang.org/cl/165076
2009-12-07 15:51:58 -08:00
Rob Pike
20c1ec263a pick off special one-byte case in copy. worth 2x in benchmarks (38ns->16ns).
the one-item case could be generalized easily with no cost. worth considering.

R=rsc
CC=golang-dev, cw
https://golang.org/cl/167044
2009-12-07 11:28:02 -08:00
Russ Cox
ed6fd1bcbe runtime: disable pointer scan optimization
* broken by reflect, gob

TBR=r
https://golang.org/cl/166077
2009-12-06 08:18:58 -08:00
Russ Cox
864c757a1c gc/runtime: pass type structure to makeslice.
* 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
2009-12-04 21:44:05 -08:00
Adam Langley
e79bcf8bfd runtime: shift the index for the sort by one.
Makes the code look cleaner, even if it's a little harder to figure
out from the sort invariants.

R=rsc
CC=golang-dev
https://golang.org/cl/165061
2009-12-04 13:31:18 -08:00
Adam Langley
d1740bb3a6 Remove global chanlock.
On a microbenchmark that ping-pongs on lots of channels, this makes
the multithreaded case about 20% faster and the uniprocessor case
about 1% slower. (Due to cache effects, I expect.)

R=rsc, agl
CC=golang-dev
https://golang.org/cl/166043
2009-12-04 10:57:01 -08:00
Russ Cox
cf37254b1c runtime: fix Caller crash on 386.
Fixes #176.

R=r
https://golang.org/cl/166044
2009-12-03 17:24:14 -08:00
Russ Cox
7e5055ceea runtime: malloc fixes
* throw away dead code
  * add mlookup counter
  * add malloc counter
  * set up for blocks with no pointers

Fixes #367.

R=r
https://golang.org/cl/165050
2009-12-03 17:22:23 -08:00
Sergio Luis O. B. Correia
6fc820729e go: makes it build for the case $GOROOT has whitespaces
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.

this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.

Fixes #115.

R=rsc, dsymonds1
https://golang.org/cl/157067
2009-11-23 17:32:51 -08:00
William Josephson
1444f1bb1d Missed a reference to sc instead of mc in 157065.
R=rsc, dho
https://golang.org/cl/157116
2009-11-20 13:46:47 -08:00
Devon H. O'Dell
7ada6018a7 FreeBSD's mcontext isn't exactly the same as sigcontext, so
we can't use them interchangably.

R=rsc, wjosephson
CC=golang-dev
https://golang.org/cl/156113
2009-11-20 13:08:16 -08:00
Russ Cox
aa4c638b7b x[y:] for strings
R=ken2
https://golang.org/cl/157114
2009-11-20 11:42:28 -08:00
Russ Cox
652f55672d x[lo:] - gc and runtime.
* 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
2009-11-20 09:11:46 -08:00
Russ Cox
6e0767bb04 reflect fixes
R=r
https://golang.org/cl/156104
2009-11-19 22:06:32 -08:00
Russ Cox
4aaf948f90 runtime: mask signals during signal handler on OS X
Fixes #265.

R=r
CC=golang-dev
https://golang.org/cl/157084
2009-11-19 11:01:16 -08:00
Russ Cox
e1c5c3df77 runtime: fix bug on darwin/amd64 - bad g in bsdthread_start
R=r
https://golang.org/cl/157077
2009-11-18 18:17:11 -08:00
Devon H. O'Dell
60b1a17b9e More FreeBSD-touchups. Thundercats are GOOOOO!
R=rsc
CC=golang-dev
https://golang.org/cl/157074
2009-11-18 16:51:59 -08:00
Rob Pike
093493c6a5 bugs in memmove:
- has arguments (no stack split)
	- MOVL does not set condition

R=ken2, rsc
https://golang.org/cl/156086
2009-11-18 15:00:02 -08:00
William Josephson
4c0f262a2d Remove unnecessary execute bits.
R=rsc
https://golang.org/cl/156077
2009-11-18 09:19:29 -08:00
Devon H. O'Dell
659780b643 Add an intptr type to runtime; needed in FreeBSD
In thread.c, we need to cast to whatever the native
size of intptr is on the system, but we only have
uintptr available. They're the same size, but can't
do signed casts without this one :).

R=rsc
CC=golang-dev
https://golang.org/cl/156073
2009-11-18 09:11:39 -08:00
Devon H. O'Dell
b3f538a4fd FreeBSD/i386 work
This patchset gets Go to pretty much the same state that
FreeBSD/amd64 is in.

R=rsc
https://golang.org/cl/157055
2009-11-17 23:58:51 -08:00
Russ Cox
744d5ae48a runtime: add ARM memmove
R=ken2
https://golang.org/cl/156063
2009-11-17 22:54:20 -08:00
Russ Cox
ed0beea27b copy tweaks
* move memmove to arch-specific subdirectories
  * add memmove for arm
  * add copyright notices marking them as copied from Inferno

R=ken2
https://golang.org/cl/156061
2009-11-17 22:16:55 -08:00
Russ Cox
41554e2528 runtime: two trivial but important bug fixes
R=r
https://golang.org/cl/156059
2009-11-17 22:00:30 -08:00
Ken Thompson
948f3e77e1 bug in copy
R=rsc
https://golang.org/cl/156056
2009-11-17 20:44:35 -08:00
Ken Thompson
c4606d05da install copy predefined
did not test 386, but should work
shouldnt matter if copy is not used

R=rsc
https://golang.org/cl/156055
2009-11-17 20:41:44 -08:00
Russ Cox
4dfd7fdde5 runtime: do not create new threads during malloc.
the signal handling stack is a different size than
	the normal stack, so it cannot be allocated using
	the backup stack allocator.

Fixes #250.

R=agl1
CC=golang-dev
https://golang.org/cl/157044
2009-11-17 14:42:08 -08:00
Rob Pike
6240b0110a improve documentation of runtime. there was no mention of types.
R=rsc
CC=golang-dev
https://golang.org/cl/157042
2009-11-17 11:44:15 -08:00
Russ Cox
a65bf95dd8 syscall: use correct pointer in recvfrom/sendto.
linux/386 stack trace: use 32-bit hex.

Fixes #159.

R=r
https://golang.org/cl/154178
2009-11-17 08:39:04 -08:00
Devon H. O'Dell
0489a260da FreeBSD-specific porting work.
cgo/libmach remain unimplemented. However, compilers, runtime,
and packages are 100%. I still need to go through and implement
missing syscalls (at least make sure they're all listed), but
for all shipped functionality, this is done. Ship! ;)

R=rsc, VenkateshSrinivas
https://golang.org/cl/152142
2009-11-17 08:20:58 -08:00
Russ Cox
597b2a91a6 runtime: make signal handler work on 386
R=r
https://golang.org/cl/154171
2009-11-16 17:51:47 -08:00
Russ Cox
091191336a runtime: avoid crash in Caller
Fixes #176.

R=r
https://golang.org/cl/154146
2009-11-15 12:57:15 -08:00
Adam Langley
3f7a32405d runtime: warn about SELinux based mmap failures on Linux.
SELinux will cause mmap to fail when we request w+x memory unless the
user has configured their policies. We have a warning in make.bash,
but it's quite likely that the policy will be reset at some point and
then all their binaries start failing.

This patch prints a warning on Linux when mmap fails with EACCES.

R=rsc
CC=golang-dev
https://golang.org/cl/152086
2009-11-13 10:08:51 -08:00
Kai Backman
a23746ea65 fix style nit ignored in previous cl
R=rsc
https://golang.org/cl/152110
2009-11-12 16:12:28 -08:00
Kai Backman
6a48aab747 add support for pre arm v6 cas. set GOARM=5 to enable.
R=rsc
https://golang.org/cl/154101
2009-11-12 15:23:23 -08:00
Kai Backman
6dbd142951 add cache flushing call after generating closure.
go/test: passes 88% (306/347)

R=rsc
https://golang.org/cl/152089
2009-11-11 23:23:11 -08:00
Russ Cox
fe1e49241c update old comment: things are much better now
R=r
https://golang.org/cl/152057
2009-11-10 19:59:22 -08:00
Robert Griesemer
3bb0032cd6 - replaced gofmt expression formatting algorithm with
rsc's algorithm
- applied gofmt -w misc src
- partial CL (last chunk)

R=rsc, r
http://go/go-review/1024041
2009-11-09 21:23:52 -08:00
Kai Backman
52c549fc9b make 5g executables run on android/arm hardware. change OABI
usage to EABI.

        go/test: passes 85% (296/347) on random android phone.

R=rsc
http://go/go-review/1024003
2009-11-05 22:53:08 -08:00
Robert Griesemer
d3d3accdb7 gofmt-ify io, json, runtime, encoding
R=rsc
http://go/go-review/1017056
2009-11-05 15:37:55 -08:00
Kai Backman
770b872752 clone and futex
go/test: passes 99% (343/347)

R=rsc
http://go/go-review/1016004
2009-10-29 21:21:14 -07:00
Adam Langley
b89d630977 Fix bug when sending via select.
selfree maintains a cache of Select structures for several sizes. In
newselect, we'll use an entry from the cache if one is found. However,
the Scase structures corresponding to a send may have been allocated
for the wrong size. In this case we'll write off the end of the Scase
into random memory and, generally, read some amount of junk in the
receive.

This patch fixes the issue by removing the cache, on the advice of
rsc.

R=rsc
CC=go-dev
http://go/go-review/1016002
2009-10-28 18:23:53 -07:00
Russ Cox
32e979c0de mysterious bug: runtime.acid wasn't getting rebuilt
when switching architectures.

fix bug twice: make sure clean removes the file,
and generate into architecture-specific file names.

R=r
http://go/go-review/1013018
2009-10-28 14:03:16 -07:00
Ian Lance Taylor
f529224039 Get the right sigaction struct for the 386 rt_sigaction system
call.  This uses the header files from a 32-bit Ubuntu Hardy
system.

The use of _LOOSE_KERNEL_NAMES seems right.  The
-D__ARCH_SI_UID_T works around a bug which appears to be fixed
in later Linux versions.

R=rsc
http://go/go-review/1013015
2009-10-26 22:49:08 -07:00
Kai Backman
6f91ba1b0f proper syscall convention for arm
R=rsc
http://go/go-review/1015009
2009-10-25 11:51:16 -07:00
Kai Backman
0af8e1045c fix off by 4 bug in morestack (lr again). remove storing of r0
now that all arguments are passed on the stack.

go/test: passes 89% (310/345)

R=rsc
APPROVED=rsc
DELTA=33  (13 added, 14 deleted, 6 changed)
OCL=36009
CL=36022
2009-10-23 10:59:31 -07:00
Kai Backman
03bbfe6724 fix off by 4 in newproc arg copying.
R=rsc
APPROVED=rsc
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=36001
CL=36004
2009-10-22 13:31:52 -07:00
Ian Lance Taylor
fd5fa4b301 Fix the sigaction declaration to match the system for Linux.
I don't know whether Darwin needs a change here.

R=rsc
http://go/go-review/1013010
2009-10-22 23:51:54 -07:00
Ian Lance Taylor
057f7d5b07 s/pc/PC/ in traceback output to match amd64.
test/run expects to see "PC".

R=rsc
http://go/go-review/1015002
2009-10-22 23:38:34 -07:00
Rob Pike
8a20cfc009 fix build: no acid
R=rsc
http://go/go-review/1014005
2009-10-22 11:52:35 -07:00