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

330 Commits

Author SHA1 Message Date
Russ Cox
c026c91b5c arm: fix typo in softfloat
R=kaib
CC=golang-dev
https://golang.org/cl/2608041
2010-10-20 15:35:37 -04:00
Russ Cox
c2b91d4889 6l: correct logic for morestack choice
The frame that gets allocated is for both
the args and the autos.  If together they
exceed the default frame size, we need to
tell morestack about both so that it allocates
a large enough frame.

Sanity check stack pointer in morestack
to catch similar bugs.

R=ken2
CC=golang-dev
https://golang.org/cl/2609041
2010-10-20 12:16:39 -07:00
Russ Cox
19fd5c787f 5l, 6l, 8l: link pclntab and symtab as ordinary rodata symbols
That is, move the pc/ln table and the symbol table
into the read-only data segment.  This eliminates
the need for a special load command to map the
symbol table into memory, which makes the
information available on systems that couldn't handle
the magic load to 0x99000000, like NaCl and ARM QEMU
and Linux without config_highmem=y.  It also
eliminates an #ifdef and some clumsy code to
find the symbol table on Windows.

The bad news is that the binary appears to be bigger
than it used to be.  This is not actually the case, though:
the same amount of data is being mapped into memory
as before, and the tables are still read-only, so they're
still shared across multiple instances of the binary as
they were before.  The difference is just that the tables
aren't squirreled away in some section that "size" doesn't
know to look at.

This is a checkpoint.
It probably breaks Windows and breaks NaCl more
than it used to be broken, but those will be fixed.
The logic involving -s needs to be revisited too.

Fixes #871.

R=ken2
CC=golang-dev
https://golang.org/cl/2587041
2010-10-19 18:07:19 -04:00
Russ Cox
2012604002 runtime: fix arm softfloat again for R12
Missed a case, so now generalized.

R=ken2
CC=golang-dev
https://golang.org/cl/2540042
2010-10-18 13:24:19 -04:00
Russ Cox
9cc8e9ef48 runtime: fix amd64 build (broke by 386 support for Plan 9)
TBR=r
CC=golang-dev
https://golang.org/cl/2556041
2010-10-18 13:01:10 -04:00
Yuval Pavel Zholkover
99a10eff16 8l, runtime: initial support for Plan 9
No multiple processes/locks, managed to compile
and run a hello.go (with print not fmt).  Also test/sieve.go
seems to run until 439 and stops with a
'throw: all goroutines are asleep - deadlock!'
- just like runtime/tiny.

based on Russ's suggestions at:
http://groups.google.com/group/comp.os.plan9/browse_thread/thread/cfda8b82535d2d68/243777a597ec1612

Build instructions:
cd src/pkg/runtime
make clean && GOOS=plan9 make install
this will build and install the runtime.

When linking with 8l, you should pass -s to suppress symbol
generation in the a.out, otherwise the generated executable will not run.

This is runtime only, the porting of the toolchain has already
been done: http://code.google.com/p/go-plan9/source/browse
in the plan9-quanstro branch.

R=rsc
CC=golang-dev
https://golang.org/cl/2273041
2010-10-18 12:32:55 -04:00
Russ Cox
6ac08ba638 runtime: update arm softfloat - no more R12
R=ken2
CC=golang-dev
https://golang.org/cl/2555041
2010-10-18 12:24:59 -04:00
Russ Cox
8052786e51 5l: stop using R12 as SB
Because the SB is only good for 8k and Go programs
tend to have much more data than that, SB doesn't
save very much.  A fmt.Printf-based hello world program
has  360 kB text segment.  Removing SB makes the text
500 bytes (0.14%) longer.

R=ken2, r2, ken3
CC=golang-dev
https://golang.org/cl/2487042
2010-10-17 11:41:23 -04:00
Russ Cox
9b15ad8c22 arm: adjust recover for new reflect.call
R=ken2
CC=golang-dev
https://golang.org/cl/2471043
2010-10-14 10:45:32 -04:00
Ken Thompson
b33f5d537f fix arm bug in reflect.call
R=rsc
CC=golang-dev
https://golang.org/cl/2475042
2010-10-13 13:24:14 -07:00
Andrew Gerrand
78d19b9b73 runtime: remove done TODO from SetFinalizer
R=rsc
CC=golang-dev
https://golang.org/cl/2472041
2010-10-13 14:40:02 +11:00
Russ Cox
ded12ee4b5 arm: fix build
Effectively reverts https://code.google.com/p/go/source/detail?r=8c52477401ad
Should make ARM build pass again, but untested.
Probably still bugs involving reflect.call somewhere.

R=ken2
CC=golang-dev
https://golang.org/cl/2416042
2010-10-11 23:58:51 -04:00
Ken Thompson
ed575dc2b9 bug in stack size in arm.
stack is off by one if calling
through reflect.Call

R=rsc
CC=golang-dev
https://golang.org/cl/2400041
2010-10-08 16:46:05 -07:00
Russ Cox
1b6282a799 runtime: fix tiny build
Reported by Jeff Allen.

R=r, r2
CC=golang-dev
https://golang.org/cl/2385042
2010-10-07 06:46:01 -04:00
Russ Cox
7eb13b95a3 runtime: fix argument dump in traceback
Was printing words at SP instead of at FP
after shuffle due to nascent flag.

R=r, r2
CC=golang-dev
https://golang.org/cl/2316044
2010-10-07 06:45:40 -04:00
Graham Miller
62355959c6 runtime: faster strequal, memequal
Fixes #1161.

R=rsc, cwvh
CC=golang-dev
https://golang.org/cl/2317044
2010-10-07 03:13:24 -04:00
Russ Cox
8599a83727 runtime: correct iteration of large map values
The hash_next_and_deref was a dreg from a
previous large value scheme.

Fixes #1163.

R=r, r2
CC=golang-dev
https://golang.org/cl/2369043
2010-10-06 11:54:41 -04:00
Russ Cox
7389ab8d21 runtime: serialize mcache allocation
Fixes racy regex-dna-parallel crashes.

R=r, r2
CC=golang-dev
https://golang.org/cl/2308042
2010-09-30 14:09:19 -04:00
Russ Cox
5b7e50a0aa runtime: fix freebsd build
TBR=r
CC=golang-dev
https://golang.org/cl/2296041
2010-09-28 21:37:12 -04:00
Russ Cox
81041369b2 runtime: fix build
On systems where the mmap succeeds
(e.g., sysctl -w vm.mmap_min_addr=0)
it changes the signal code delivered for a
nil fault from ``page not mapped'' to
``invalid permissions for page.''

TBR=r
CC=golang-dev
https://golang.org/cl/2294041
2010-09-28 20:50:00 -04:00
Russ Cox
649aab835f runtime: add mmap of null page just in case
R=r, iant, robert.swiecki, rsc1
CC=golang-dev
https://golang.org/cl/1904044
2010-09-28 20:30:01 -04:00
Russ Cox
929fdd860b runtime: correct stats in SysFree
R=r
CC=golang-dev
https://golang.org/cl/2254047
2010-09-27 12:50:01 -04:00
Russ Cox
34d413f562 runtime: fix unwindstack crash
Bug and fix identified by Alexey Gokhberg.
Fixes #1135.

R=r, brainman
CC=golang-dev
https://golang.org/cl/2198046
2010-09-23 23:04:32 -04:00
Russ Cox
a2450c1456 cgo: bug fixes
* Add documentation about array arguments.  Fixes issue 1125.
* Do not interpret x, y := z, w as special errno form.  Fixes issue 952.
* Fix nested Go calls (brainman).  Fixes issue 907.

R=r
CC=golang-dev
https://golang.org/cl/2214044
2010-09-21 22:41:19 -04:00
Russ Cox
d4baf3ccb7 runtime: better panic for send to nil channel
*Much* better on NaCl, where memory faults are deadly.

R=r
CC=golang-dev
https://golang.org/cl/2249041
2010-09-19 23:28:12 -04:00
Russ Cox
af12feb8d5 6l, 8l: clean up ELF code, fix NaCl
R=r
CC=golang-dev
https://golang.org/cl/2221042
2010-09-19 22:10:34 -04:00
Russ Cox
f47d403cb4 gc: make string x + y + z + ... + w efficient
1 malloc per concatenation.

R=ken2
CC=golang-dev
https://golang.org/cl/2124045
2010-09-12 00:53:04 -04:00
Alex Brainman
f95a2f2b97 runtime(windows): make sure scheduler runs on os stack and new stdcall implementation
R=rsc
CC=golang-dev
https://golang.org/cl/2009045
2010-09-12 11:45:16 +10:00
Russ Cox
befecf6b59 runtime: fix crash trace on amd64
g is not in r15 anymore.
now it's in a per-thread memory segment,
which is valid even inside a signal handler,
so we can just refer to g directly.

Fixes #1082.

R=r
CC=golang-dev
https://golang.org/cl/2149045
2010-09-11 00:26:56 -04:00
Rob Pike
66f676b8ef arm: fix a couple of build bugs.
tests have not been run yet

R=stephenm
CC=golang-dev
https://golang.org/cl/2165046
2010-09-09 23:31:33 -07:00
Rob Pike
ba5175401e runtime: fix bug in tracebacks
Need to correct for deferproc's extra 2 words of stack or in some
cases (such as memory profiling) traceback can cause a crash.
Also bulletproof the closure test.

R=rsc
CC=golang-dev
https://golang.org/cl/2138047
2010-09-09 14:28:56 +10:00
Alex Brainman
89e9231865 runtime: fix windows build
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2135045
2010-09-09 12:09:10 +10:00
Russ Cox
636342292c runtime: fix linux/amd64 build: wrong name for munmap
TBR=r
CC=golang-dev
https://golang.org/cl/2140043
2010-09-07 13:17:10 -04:00
Russ Cox
d4cc557b0d runtime: use manual stack for garbage collection
Old code was using recursion to traverse object graph.
New code uses an explicit stack, cutting the per-pointer
footprint to two words during the recursion and avoiding
the standard allocator and stack splitting code.

in test/garbage:

Reduces parser runtime by 2-3%
Reduces Peano runtime by 40%
Increases tree runtime by 4-5%

R=r
CC=golang-dev
https://golang.org/cl/2150042
2010-09-07 09:57:22 -04:00
Russ Cox
4e64555894 runtime: add GOOS, GOARCH; fix FuncLine
Changes to FuncLine sync it with symtab.c's funcline.

R=r
CC=girard.m1, golang-dev
https://golang.org/cl/2083041
2010-09-02 14:19:12 -04:00
Christian Himpel
5c603dbb75 build: remove unnecessary references to GOBIN and GOROOT
All scripts and makefiles assume that GOBIN is correctly set
in PATH.

R=rsc
CC=golang-dev
https://golang.org/cl/2043041
2010-08-30 15:40:56 -04:00
Kyle Consalus
4d903504b3 runtime: special case copy, equal for one-word interface values
Based on the observation that a great number of the types that
are copied or compared in interfaces, maps, and channels are
word-sized, this uses specialized copy and equality functions
for them that use a word instead of 4 or 8 bytes. Seems to yield
0-6% improvements in performance in the benchmarks I've run.
For example, with the regexp benchmarks:

Before:
regexp.BenchmarkLiteral   500000       3.26 µs/op
regexp.BenchmarkNotLiteral    100000      13.67 µs/op
regexp.BenchmarkMatchClass    100000      18.72 µs/op
regexp.BenchmarkMatchClass_InRange    100000      20.04 µs/op
regexp.BenchmarkReplaceAll    100000      27.85 µs/op

After:
regexp.BenchmarkLiteral   500000       3.11 µs/op
regexp.BenchmarkNotLiteral    200000      13.29 µs/op
regexp.BenchmarkMatchClass    100000      17.65 µs/op
regexp.BenchmarkMatchClass_InRange    100000      18.49 µs/op
regexp.BenchmarkReplaceAll    100000      26.34 µs/op

R=rsc
CC=golang-dev
https://golang.org/cl/1967047
2010-08-26 13:32:40 -04:00
Ian Lance Taylor
bbaef5f4dc runtime: Correct commonType.kind values to match compiler.
The copy of these values in the reflect package is already
correct.

R=rsc
CC=golang-dev
https://golang.org/cl/2009044
2010-08-26 08:08:57 -07:00
Russ Cox
e1e829b786 runtime: fix freebsd/386 mmap
The runtime only passes 32 bits of file offset,
but the kernel wants 64 bits, so have to add
zeros explicitly in a copy of the arguments.

R=adg, Martin Neubauer
CC=golang-dev
https://golang.org/cl/1933044
2010-08-24 13:04:02 -04:00
Eric Clark
95fa16a892 cgo: add C.GoStringN
Function to create a GoString with a known length so it can contain NUL
bytes anywhere in the string. Some C libraries have strings like this.

R=rsc
CC=golang-dev
https://golang.org/cl/2007042
2010-08-18 22:29:05 -04:00
Russ Cox
da392d9136 build: no required environment variables
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Luuk van Dijk
340f28deab runtime: correct line numbers for .goc files.
Linenumbers start at 1.
Also call goc2c with an absolute pathi to preserve debug info.

R=rsc, r, ken2
CC=golang-dev
https://golang.org/cl/1954049
2010-08-18 00:16:05 +02:00
Russ Cox
e2bde5cf9b runtime: fix another stack split bug
Makes godoc --http=:1234 not crash on linux/amd64.

R=r
CC=golang-dev
https://golang.org/cl/1975044
2010-08-12 23:26:54 -07:00
Alex Brainman
bc4a9caa41 runtime: free memory returned by windows GetEnvironmentStrings
R=golang-dev
CC=golang-dev
https://golang.org/cl/1917048
2010-08-09 11:30:33 +10:00
Kai Backman
df88fc6109 arm: bugfixes and syscall
- integer divide by zero raises panic
- float comparisons involving NaNs work
- syscall interface actually handles return
  values and errno correctly.

R=rsc, bradfitzpatrick
CC=golang-dev
https://golang.org/cl/1847047
2010-08-06 16:57:49 -07:00
Russ Cox
e473f42b2d amd64: use segment memory for thread-local storage
Returns R14 and R15 to the available register pool.
Plays more nicely with ELF ABI C code.
In particular, our signal handlers will no longer crash
when a signal arrives during execution of a cgo C call.

Fixes #720.

R=ken2, r
CC=golang-dev
https://golang.org/cl/1847051
2010-08-04 17:50:22 -07:00
Russ Cox
3f19d8ae8d gc: empty select
R=ken2
CC=golang-dev
https://golang.org/cl/1871057
2010-08-03 01:07:57 -07:00
Russ Cox
9bac9d23d3 gc: index bounds tests and fixes
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
2010-08-03 00:26:02 -07:00
Russ Cox
68b0a87966 runtime: do not fall through in SIGBUS/SIGSEGV
Faults beyond the first page are not expected
and should fail loudly.  They are not subject to recover.

R=r
CC=golang-dev
https://golang.org/cl/1915042
2010-07-30 11:32:55 -07:00
Alex Brainman
45e12c7cd3 runtime: fix bug introduced in revision 4a01b8d28570
R=rsc
CC=golang-dev
https://golang.org/cl/1874046
2010-07-29 16:54:01 +10:00