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

2106 Commits

Author SHA1 Message Date
Luuk van Dijk
4228e62259 6l/8l: global and local variables and type info.
R=rsc
CC=golang-dev
https://golang.org/cl/2201044
2010-10-24 23:07:52 +02:00
Rob Pike
c28fa513f5 gob: error cleanup 2
Simplify error handling during the compilation phase.

R=rsc
CC=golang-dev
https://golang.org/cl/2652042
2010-10-22 16:07:26 -07:00
Rob Pike
f593b37f23 gobs: error cleanup part 1.
Remove err from the encoderState and decoderState types, so we're
not always copying to and from various copies of the error, and then
use panic/recover to eliminate lots of error checking.

another pass might take a crack at the same thing for the compilation phase.

R=rsc
CC=golang-dev
https://golang.org/cl/2660042
2010-10-22 15:16:34 -07:00
Russ Cox
1dd0319be3 runtime: print unknown types in panic
R=r
CC=golang-dev
https://golang.org/cl/2683041
2010-10-22 17:04:32 -04:00
Rob Pike
5d9064697b gob: allow exchange of interface values
The implemetation describes each value as a string identifying the
concrete type of the value, followed by the usual encoding of that
value.  All types to be exchanged as contents of interface values
must be registered ahead of time with the new Register function.
Although this would not seem strictly necessary, the linker garbage
collects unused types so without some mechanism to guarantee
the type exists in the binary, there could be unpleasant surprises.
Moreover, the receiver needs a reflect.Type of the value to be
written in order to be able to save the data. A Register function
seems necessary.

The implementation may require defining types in the middle of
of sending a value.  The old code never did this. Therefore there
has been some refactoring to make the encoder and decoder
work recursively.

This change changes the internal type IDs. Existing gob archives
will break with this change.  Apologies for that. If this is a deal
breaker it should be possible to create a conversion tool.

Error handling is too complicated in this code. A subsequent
change should clean it up.

R=rsc
CC=golang-dev
https://golang.org/cl/2618042
2010-10-22 11:17:40 -07:00
Robert Griesemer
3478891d12 gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Robert Griesemer
f613015e0e go ast/parser/printer: permit elision of composite literal types for composite literal elements
gofmt: added -s flag to simplify composite literal expressions through type elision where possible

R=rsc
CC=golang-dev
https://golang.org/cl/2319041
2010-10-22 10:03:14 -07:00
Russ Cox
1c8f185611 arm: 3 more tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2666041
2010-10-22 05:53:03 +02:00
Russ Cox
4fd12c04c5 fix windows build
R=ken2
CC=golang-dev
https://golang.org/cl/2650041
2010-10-21 13:06:17 -04:00
Russ Cox
d10963b6d7 fix arm build
R=ken2
CC=golang-dev
https://golang.org/cl/2649041
2010-10-21 13:03:59 -04:00
Russ Cox
833c06581a fix build
R=ken2
CC=golang-dev
https://golang.org/cl/2621042
2010-10-21 12:50:23 -04:00
Robert Griesemer
b57b10f992 go/parser: consume auto-inserted semi when calling ParseExpr()
Fixes #1170.

R=rsc
CC=golang-dev
https://golang.org/cl/2622041
2010-10-21 08:40:33 -07:00
Russ Cox
1451695f86 encoding/binary: give LittleEndian, BigEndian specific types
Giving them specific types has the benefit that
binary.BigEndian.Uint32(b) is now a direct call, not an
indirect via a mutable interface value, so it can potentially
be inlined.

Recent changes to the spec relaxed the rules for comparison,
so this code is still valid:

	func isLittle(o binary.ByteOrder) { return o == binary.LittleEndian }

The change does break this potential idiom:

	o := binary.BigEndian
	if foo {
		o = binary.LittleEndian
	}

That must rewrite to give o an explicit binary.ByteOrder type.
On balance I think the benefit from the direct call and inlining
outweigh the cost of breaking that idiom.

R=r, r2
CC=golang-dev
https://golang.org/cl/2427042
2010-10-21 11:25:14 -04:00
David Symonds
4f6fb1b775 net: fix comment on Dial to mention unix/unixgram.
R=rsc
CC=golang-dev
https://golang.org/cl/2639041
2010-10-21 08:17:24 -04:00
Russ Cox
69188ad9bb arm: prop up software floating point
Just enough to make mov instructions work,
which in turn is enough to make strconv work
when it avoids any floating point calculations.
That makes a bunch of other packages pass
their tests.

Should suffice until hardware floating point
is available.

Enable package tests that now pass
(some due to earlier fixes).

Looks like there is a new integer math bug
exposed in the fmt and json tests.

R=ken2
CC=golang-dev
https://golang.org/cl/2638041
2010-10-21 06:56:20 +02:00
Fumitoshi Ukai
64cc5be4ad web socket: fix short Read
Fixes #1145.

R=rsc
CC=golang-dev
https://golang.org/cl/2302042
2010-10-20 22:36:06 -04:00
Yasuhiro Matsumoto
1c9dfb7647 os: correct Stat S_ISDIR on Windows
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2598041
2010-10-21 10:29:45 +11:00
Russ Cox
10b53867e8 encoding/hex: fix typo
Thanks to avadh4all for spotting it.

Fixes #1214.

R=r, r2
CC=golang-dev
https://golang.org/cl/2616041
2010-10-20 16:38:57 -04:00
Russ Cox
6a3b29895f runtime: don't let select split stack
Fixes #1209.

R=ken2
CC=golang-dev
https://golang.org/cl/2612041
2010-10-20 15:54:17 -04:00
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
4ae9311174 arm: more tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2606041
2010-10-20 11:43:27 -04:00
Russ Cox
1142b60dad syscall/arm: correct 64-bit system call arguments
Thanks to kaib for the tip.

R=ken2
CC=golang-dev
https://golang.org/cl/2596043
2010-10-20 10:39:46 -04:00
Rob Pike
97f3a80d93 reflect: add InterfaceValue.Get to enable setting of an interface
value (through unsafe means) without having a reflect.Type
of type *interface{} (pointer to interface).  This is needed to make
gob able to handle interface values by a method analogous to
the way it handles maps.

R=rsc
CC=golang-dev
https://golang.org/cl/2597041
2010-10-19 21:25:28 -07:00
Rob Pike
321f0c7fe2 gob: break documentation into a separate doc.go file
R=adg, r2
CC=golang-dev
https://golang.org/cl/2596041
2010-10-19 20:39:29 -07:00
Russ Cox
17c32ad712 http: do not close connection after sending HTTP/1.0 request
Fixes #671.

R=adg, cw
CC=golang-dev
https://golang.org/cl/2431042
2010-10-19 23:29:25 -04:00
Yasuhiro Matsumoto
a9725396c0 os: change TestForkExec so it can run on windows
R=brainman, vcc, Joe Poirier, rsc
CC=golang-dev
https://golang.org/cl/2530041
2010-10-20 09:46:24 +11:00
Nigel Tao
a3bcf4b664 nntp: remove nntp package from the standard library.
R=adg
CC=golang-dev
https://golang.org/cl/2470045
2010-10-20 09:43:27 +11: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
Rob Pike
1ffb1f2b66 netchan: add new method Hangup to terminate transmission on a channel
Fixes #1151.

R=rsc
CC=golang-dev
https://golang.org/cl/2469043
2010-10-18 15:09:43 -07:00
Florian Uekermann
e9c35ac55d big: add random number generation
Adds func (z *Int) RandIntn(src rand.Source,n *Int) *Int

R=rsc
CC=golang-dev, gri
https://golang.org/cl/2315045
2010-10-18 14:09:20 -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
Rob Pike
8abb8e1d20 log: update the documentation to clarify the behavior
R=rsc, PeterGo
CC=golang-dev
https://golang.org/cl/2519043
2010-10-17 09:20:23 -07: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
Rob Pike
e39bd1dd56 log: roll back the rollback of the deprecation of the old interface.
R=adg
CC=golang-dev
https://golang.org/cl/2521042
2010-10-15 13:14:29 -07:00
Rob Pike
84834feffd log: roll back deprecation of old API to apply fix to log.Output in public release.
R=adg
CC=golang-dev
https://golang.org/cl/2525042
2010-10-14 18:02:08 -07:00
Andrew Gerrand
568eccd12d log: fix custom output bug
R=r
CC=golang-dev
https://golang.org/cl/2525041
2010-10-15 11:55:51 +11:00
Russ Cox
0b2af925db arm: enable 6 more tests after net fix
R=ken2
CC=golang-dev
https://golang.org/cl/2520042
2010-10-14 17:15:45 -04:00
Russ Cox
14d2242fb9 syscall: fix arm networking
Suggested by fango (fan.howard@gmail.com)

R=r, r2
CC=golang-dev
https://golang.org/cl/2514041
2010-10-14 16:13:44 -04:00
Rob Pike
b6cd8f869d log: delete deprecated functionality
Fixes #1195.

R=rsc
CC=golang-dev
https://golang.org/cl/2504043
2010-10-14 12:50:36 -07: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
Evan Shaw
df74d8df09 smtp: new package
R=rsc, iant, agl
CC=golang-dev
https://golang.org/cl/2052042
2010-10-13 22:07:28 -04:00
Rob Pike
52e3c99cfb bufio: bulletproof UnreadRune
After a fill(), there is nothing to back up.  Make sure UnreadRune
recognizes the situation.

Fixes #1137.
(Stops the crash, but doesn't make UnreadRune usable after a Peek()).

R=rsc
CC=golang-dev
https://golang.org/cl/2498041
2010-10-13 17:12:43 -07:00
Russ Cox
d6df301774 arm: enable 8 more packages
The remaining failures include:

* something about bit operations?
	crypto/block
	encoding/binary

* something about file I/O?
	archive/tar
	archive/zip
	debug/dwarf
	debug/elf
	debug/macho
	image/png

* floating point
	cmath
	expvar
	flag
	fmt
	gob
	json
	math
	strconv
	template
	xml

* network (maybe fixed by a pending CL)
	http
	netchan
	rpc
	rpc/jsonrpc
	syslog
	websocket

* line numbers
	log

* haven't bothered / not sure
	exp/datafmt
	exp/eval
	go/printer
	os
	os/signal
	testing/quick

R=ken2
CC=golang-dev
https://golang.org/cl/2496041
2010-10-13 18:16:44 -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
Russ Cox
085be1740a 5l, 6l, 8l: first pass cleanup
* Maintain Sym* list for text with individual
  prog lists instead of using one huge list and
  overloading p->pcond.
* Comment what each file is for.
* Move some output code from span.c to asm.c.
* Move profiling into prof.c, symbol table into symtab.c.
* Move mkfwd to ld/lib.c.
* Throw away dhog dynamic loading code.
* Throw away Alef become.
* Fix printing of WORD instructions in 5l -a.

Goal here is to be able to handle each piece of text or data
as a separate piece, both to make it easier to load the
occasional .o file and also to make it possible to split the
work across multiple threads.

R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/2335043
2010-10-13 15:51:21 -04:00
Rob Pike
dd8afb800b log: fix out-of-date package comment
R=rsc
CC=golang-dev
https://golang.org/cl/2485041
2010-10-13 11:05:45 -07:00