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

2662 Commits

Author SHA1 Message Date
Russ Cox
9ab8129ebe test of struct with embedded interface.
also tests method calls on ptr to interface value.

R=r
DELTA=74  (74 added, 0 deleted, 0 changed)
OCL=28419
CL=28424
2009-05-07 13:43:00 -07:00
Russ Cox
401a95aa83 if a struct s contains an anonymous interface value
with method m, s.m() is ok and m now shows up
in s's method set for interface runtime.

see http://cl/28419-p2 for new test interface10.go.

R=ken
OCL=28420
CL=28423
2009-05-07 13:42:47 -07:00
Russ Cox
0d33992866 next step for 6.out on Borg: fix and test
net code on IPv4-only machines.

R=r
DELTA=27  (25 added, 0 deleted, 2 changed)
OCL=28404
CL=28411
2009-05-07 10:31:48 -07:00
Russ Cox
88a1aa8e1a 6g: error messages
part 2; missing files

R=ken
OCL=28408
CL=28410
2009-05-07 10:30:22 -07:00
Russ Cox
b5e212ffdd 6g: error messages
replace "shape error across CALL" with more information.

x.go:7: not enough arguments to CALL
	a int, b int
	int
x.go:10: assignment count mismatch: 3 = 2
x.go:12: too many arguments to RETURN
	[no arguments expected]
	int, int, int

also leave type alone after conversion failure,
for later errors:

bug049.go:6: cannot convert nil constant to string
bug049.go:6: illegal types for operand: EQ
	string
	nil		# this used to be blank

R=ken
OCL=28405
CL=28407
2009-05-07 10:29:35 -07:00
Russ Cox
5a67ea3883 6g: simplify trampoline by postponing load.
TEXT tramp
		MOVQ 8(SP), AX
		ADDQ $40, AX
		MOVQ AX, 8(SP)
		JMP oldfunc

	is now

	TEXT tramp
		ADDQ $40, 8(SP)
		JMP oldfunc

	and if s/40/0/, then it simplifies to

	TEXT tramp
		JMP oldfunc

	(the tramp is still needed to satisfy
	symbol references from other object files)

R=ken
OCL=28377
CL=28381
2009-05-06 17:06:06 -07:00
Russ Cox
e508c55760 interface method tests
R=r
DELTA=134  (134 added, 0 deleted, 0 changed)
OCL=28373
CL=28380
2009-05-06 17:05:55 -07:00
Russ Cox
3071f8c8e5 fix a few type errors, make ErrorString a value
will submit with fixed compiler

R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=28371
CL=28379
2009-05-06 17:05:46 -07:00
Russ Cox
a6ba5ec535 6g: new interface rules (code got simpler!)
R=ken
OCL=28374
CL=28378
2009-05-06 17:05:35 -07:00
Robert Griesemer
d76f095750 semi-weekly snapshot:
- format-driven pretty printing now handles all of Go code
- better error handling

R=r
OCL=28370
CL=28372
2009-05-06 16:28:18 -07:00
Russ Cox
1d1316c885 makefile fixes
R=r
OCL=28369
CL=28369
2009-05-06 16:16:55 -07:00
Russ Cox
83cd4ee070 6g: generate string data as individual symbols,
so that 6l can discard strings used by dead code.
also, for short strings, generate DUPOK global
symbols so that references to, say, "%s: %s" in
multiple files result in only a single symbol.

R=ken
OCL=28361
CL=28361
2009-05-06 13:47:40 -07:00
Rob Pike
0c3a43e7b2 error handling had a bug in execute: the error channel was being shared.
fix that and clean up state handling a little.

R=rsc
DELTA=44  (18 added, 8 deleted, 18 changed)
OCL=28359
CL=28359
2009-05-06 13:42:59 -07:00
Ken Thompson
876c637e42 added a distinguishing string to the error prints
R=r
OCL=28321
CL=28357
2009-05-06 12:43:09 -07:00
Rob Pike
68382ec021 add missing Makefile to repair build
TBR=gri
OCL=28320
CL=28320
2009-05-05 21:31:22 -07:00
Ken Thompson
c4de24981a signs on div and mod
R=r
OCL=28319
CL=28319
2009-05-05 21:19:58 -07:00
Robert Griesemer
1d6bd79ceb new dir structure for lib/go
R=r
DELTA=9298  (4760 added, 4536 deleted, 2 changed)
OCL=28317
CL=28317
2009-05-05 18:38:45 -07:00
Russ Cox
3e9b171b79 6g bug: was dropping assignment of nil to globals
R=ken
OCL=28314
CL=28314
2009-05-05 17:33:51 -07:00
Rob Pike
86043a87c9 mv container/vector down one level for new rules.
simplify run.bash now that lib has make test that recurs.

R=rsc
DELTA=1179  (578 added, 596 deleted, 5 changed)
OCL=28313
CL=28313
2009-05-05 17:24:01 -07:00
Robert Griesemer
cc35ca529b wrong type used for dynamic type test
R=r
DELTA=40  (40 added, 0 deleted, 0 changed)
OCL=28308
CL=28311
2009-05-05 17:05:58 -07:00
Rob Pike
9b2c5da922 directory-per-package step 1: move files from lib/X.go to lib/X/X.go
no substantive changes except:
	- new Makefiles, all auto-generated
	- go/src/lib/Makefile has been extensively edited

R=rsc
OCL=28310
CL=28310
2009-05-05 17:05:39 -07:00
Russ Cox
f821e3c7c3 6g tweaks
* byteastring is no longer used
	* do not generate ODCL, OAS for globals
	  (wasn't generating any code but might
	  save one or two init functions)
	* do not call self from Init function

R=ken
OCL=28309
CL=28309
2009-05-05 16:53:46 -07:00
Russ Cox
b8dd218e2e bug117 is fixed in 6g; now an errchk
R=r
DELTA=42  (20 added, 22 deleted, 0 changed)
OCL=28295
CL=28295
2009-05-05 13:41:46 -07:00
Russ Cox
9cba9c8890 6l: eliminate dead code, not just the symbols
editing the firstp list was ineffective,
because follow rebuilds it from the textp list.

the symbols for dead code were being dropped
from the binary but the code was all still there.

text for fmt.Printf("hello, world\n") drops
from 143945 to 128650.

R=r,ken
DELTA=22  (20 added, 0 deleted, 2 changed)
OCL=28255
CL=28290
2009-05-05 12:43:00 -07:00
Robert Griesemer
eea33fc69c better io.ByteBuffer implementation:
- more light-weight
- better buffer management
- added test cases

R=r
DELTA=227  (167 added, 35 deleted, 25 changed)
OCL=28252
CL=28289
2009-05-05 12:00:52 -07:00
Russ Cox
747e26166a fmt: dead code and data
R=r
DELTA=10  (0 added, 10 deleted, 0 changed)
OCL=28258
CL=28287
2009-05-05 11:24:03 -07:00
Russ Cox
21c9f82f40 update convlit.go to current spec
R=r
DELTA=17  (2 added, 9 deleted, 6 changed)
OCL=28286
CL=28286
2009-05-05 11:23:39 -07:00
Rob Pike
2067b9fb92 string slicing is efficient so remove base and bounds arguments from RuneCountInString
R=rsc
DELTA=6  (1 added, 0 deleted, 5 changed)
OCL=28242
CL=28256
2009-05-04 22:12:13 -07:00
Ken Thompson
567a7bf664 more code optimization
1. dont clear external and heap objects
2. propagate constant assignment

R=r
OCL=28254
CL=28254
2009-05-04 21:48:46 -07:00
David Symonds
2f284948af Remake exvar package to be more Go-ish.
It now exports a Var interface (anyone can export their own custom var types now), so users need to create and manage their own vars and mark them as exportable via the Publish function. They are exposed via /debug/vars.

R=r,rsc
APPROVED=r
DELTA=605  (314 added, 186 deleted, 105 changed)
OCL=28143
CL=28239
2009-05-04 15:14:22 -07:00
Robert Griesemer
19c239c9af - remove wrong fix
(this corresponds to the currently running version of godoc)

R=r
DELTA=11  (0 added, 10 deleted, 1 changed)
OCL=28238
CL=28238
2009-05-04 15:04:32 -07:00
Ken Thompson
5963f59067 more morestack fiddling
R=r
OCL=28204
CL=28204
2009-05-03 19:09:14 -07:00
Ken Thompson
a5a878986c more code fiddling
R=r
OCL=28201
CL=28201
2009-05-03 15:17:03 -07:00
David Symonds
fc51a98ffb Fix mismatched quote in a comment.
R=gri
APPROVED=gri
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=28184
CL=28192
2009-05-02 17:59:42 -07:00
Ian Lance Taylor
be827826ef Verify that a send on a sychronous channel waits until the
value has been received.  This failed with gccgo before
today.

R=ken,r
DELTA=18  (18 added, 0 deleted, 0 changed)
OCL=28185
CL=28190
2009-05-02 12:47:33 -07:00
Robert Griesemer
0d6a5f417f weekly snapshot:
- template-driven ast printing now can successfully
  reproduce entire Go programs

next steps:
- fine-tuning of output
- print interspersed comments
- cleanup and testing against all Go programs
- replace astprinter

R=r
OCL=28181
CL=28181
2009-05-01 19:32:41 -07:00
Ken Thompson
49f7494894 code optmization
drip init function if it doesnt do anything

R=r
OCL=28180
CL=28180
2009-05-01 18:55:16 -07:00
Ken Thompson
1ed7f18165 code improvement
better calling of morestack

R=r
OCL=28179
CL=28179
2009-05-01 18:07:33 -07:00
Robert Griesemer
4f18549c02 clarifying ambiguity of evaluation order
R=r
DELTA=16  (0 added, 3 deleted, 13 changed)
OCL=28133
CL=28178
2009-05-01 17:00:16 -07:00
Kai Backman
eac5db7f4c Copied 8g/6g into 5g. Used sharp tools to coax a .5 file out
of 5g. 5l balks at the output and running 5g with -S shows
the true extent of the disaster. Still, better than
yesterday. Maybe.

Tested on the canonical:

package main
func main() {
}

R=rsc
APPROVED=rsc
DELTA=4182  (4181 added, 0 deleted, 1 changed)
OCL=27601
CL=28175
2009-05-01 13:21:53 -07:00
Robert Griesemer
68523603e1 - incorporated feedback per rsc
- fixed a bug and added corresponding test case

R=rsc
DELTA=114  (18 added, 29 deleted, 67 changed)
OCL=28114
CL=28128
2009-04-30 14:43:06 -07:00
Russ Cox
83e976d53e bug146: array/slice conversion before I left missed conversions
R=ken
OCL=28120
CL=28124
2009-04-30 13:49:58 -07:00
Russ Cox
bd8e25ca57 auto-detect whether to use IPv6 or IPv4 kernel interface
R=r
DELTA=12  (9 added, 0 deleted, 3 changed)
OCL=28096
CL=28118
2009-04-30 13:41:36 -07:00
Russ Cox
10817ab9d2 better error messages, not that anyone ever sees them
R=r
DELTA=30  (9 added, 1 deleted, 20 changed)
OCL=28104
CL=28117
2009-04-30 13:40:55 -07:00
Russ Cox
48974f553d change 6l library directory flag to -L,
to match traditional c linkers.

R=r
DELTA=42  (8 added, 12 deleted, 22 changed)
OCL=28101
CL=28115
2009-04-30 13:32:39 -07:00
Rob Pike
5dc95206f2 don't print binary data. add TODO for better errors.
TBR=rsc
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=28066
CL=28070
2009-04-29 23:33:48 -07:00
Rob Pike
93831d25db rename variables for clarity.
add test for structure alignment/offset.

R=gri
DELTA=49  (35 added, 0 deleted, 14 changed)
OCL=28068
CL=28068
2009-04-29 22:16:53 -07:00
Ian Lance Taylor
625866a977 Conversion from array to slices should work like assignment:
you should be able to convert a pointer to an array to a
slice, you should not be able to convert an array to a slice.
Currently 6g works the other way around.

R=ken,rsc
DELTA=17  (17 added, 0 deleted, 0 changed)
OCL=28033
CL=28067
2009-04-29 20:15:59 -07:00
Russ Cox
89f8238a99 don't set CLONE_PTRACE -- it confuses strace
R=r
DELTA=4  (3 added, 1 deleted, 0 changed)
OCL=28063
CL=28065
2009-04-29 18:54:44 -07:00
Russ Cox
d2e42f3e48 if the process stops with SIGTRAP (breakpoint),
don't relay the signal when restarting it.

R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=28060
CL=28064
2009-04-29 18:53:01 -07:00