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

147 Commits

Author SHA1 Message Date
Bill Neubauer
7f09b0177f Removing dead tests from chan.c
Since pres != nil was already checked and the routine sets *pres to false
and returns, the subsequent tests are unneeded.

R=rsc
APPROVED=rsc
DELTA=4  (0 added, 4 deleted, 0 changed)
OCL=33439
CL=33441
2009-08-17 22:21:48 -07:00
Russ Cox
b21425ddee runtime gc bug.
semacquire might move to another m.

R=r
DELTA=5  (2 added, 2 deleted, 1 changed)
OCL=33317
CL=33326
2009-08-14 20:33:20 -07:00
Austin Clements
92e8b121a0 Fix build
R=rsc
APPROVED=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=33294
CL=33294
2009-08-14 14:41:50 -07:00
Austin Clements
84852fe220 Make the runtime correctly decode the symbol table history
stacks produced by whole-package compilation.

Fix some off-by-ones in PC/line table parsing.  Hopefully.

R=rsc
APPROVED=rsc
DELTA=42  (24 added, 6 deleted, 12 changed)
OCL=33250
CL=33293
2009-08-14 14:36:49 -07:00
Austin Clements
63810f840f Account for CALL instructions before looking up the function
at PC, to deal with functions that end with a CALL
instruction.  Special case known call-by-return functions.

R=rsc
APPROVED=rsc
DELTA=12  (6 added, 6 deleted, 0 changed)
OCL=33255
CL=33279
2009-08-14 11:09:53 -07:00
Austin Clements
dbecfbf86d Don't try to account for CALL instruction in 0th frame.
R=rsc
APPROVED=rsc
DELTA=9  (4 added, 3 deleted, 2 changed)
OCL=33238
CL=33251
2009-08-13 18:10:38 -07:00
Russ Cox
45ce825544 debugging symbols for 8g.
backtraces don't work,
but they didn't work when i started either.

R=ken
OCL=33230
CL=33230
2009-08-13 15:45:58 -07:00
Russ Cox
090efde407 makefile fixes; convert runtime to use new makefiles
R=r
DELTA=67  (17 added, 29 deleted, 21 changed)
OCL=33215
CL=33219
2009-08-13 14:41:10 -07:00
Rob Pike
f8295fcd0d rename mkasmh to mkasmh.sh
R=rsc
DELTA=204  (153 added, 49 deleted, 2 changed)
OCL=33213
CL=33213
2009-08-13 14:23:35 -07:00
Russ Cox
57a9bd0ee3 change gotype in symbol table from
character string to machine address.
not filled in, just carved out.

R=austin
DELTA=77  (11 added, 34 deleted, 32 changed)
OCL=33122
CL=33124
2009-08-12 16:14:53 -07:00
Russ Cox
b5c57fea96 delete forward type declarations
R=r
DELTA=163  (1 added, 149 deleted, 13 changed)
OCL=33106
CL=33111
2009-08-12 14:40:47 -07:00
Rob Pike
d08f0067b5 commentary about extern register
R=rsc
DELTA=16  (12 added, 0 deleted, 4 changed)
OCL=33030
CL=33035
2009-08-11 13:30:35 -07:00
Rob Pike
7955490de2 add runtime.GOMAXPROCS, allowing a program to, in effect, set $GOMAXPROCS
R=rsc
DELTA=29  (28 added, 1 deleted, 0 changed)
OCL=32829
CL=32837
2009-08-06 13:07:05 -07:00
Russ Cox
9346c6d901 make every func literal expression allocate,
so that == on func means that the
functions originated in the same
execution of a func literal or definition.

before, there was an inconsistency:

	func() {x++} != func() {x++}

but

	func() {} == func() {}

this CL makes the second case != too,
just like

	make(map[int]int) != make(map[int]int)

R=r
DELTA=202  (71 added, 62 deleted, 69 changed)
OCL=32393
CL=32398
2009-07-28 20:01:00 -07:00
Russ Cox
7729c3f955 fix gc bug causing make smoketest to die in cmd/gofmt.
saving of sp was too far away from use in scanstack;
the stack had changed since the sp was saved.

R=r
DELTA=9  (4 added, 2 deleted, 3 changed)
OCL=32232
CL=32237
2009-07-27 14:16:28 -07:00
Russ Cox
3ff5e727e2 fix bug in CL 30057: missed if+continue in one place.
R=gri
DELTA=2  (2 added, 0 deleted, 0 changed)
OCL=32214
CL=32223
2009-07-27 10:59:59 -07:00
Russ Cox
052a66babd runtime: fix init scheduling bug.
if there is a goroutine waiting to run
and the init goroutine enters a system call,
entersyscall was trying to kick off a new
scheduler for the other goroutine, causing
a panic (new goroutines can't run until main.main).

R=r
DELTA=32  (32 added, 0 deleted, 0 changed)
OCL=31982
CL=31982
2009-07-21 19:43:27 -07:00
Russ Cox
e52e9ca82e another step toward eliminating forward declarations.
introduce NodeList* type in compiler to replace OLIST.
this clarifies where lists can and cannot occur.
list append and concatenation are now cheap.
the _r rules are gone from yacc.
rev and unrev are gone.
no more lists of lists.

the representation of assignments is a bit clunkier.
split into OAS (1=1) and OAS2 (2 or more on one side).

delete dead chanrecv3 code.

delay construction of func types.

R=ken
OCL=31745
CL=31762
2009-07-17 01:00:44 -07:00
Russ Cox
218c393029 add LockOSThread and UnlockOSThread to
runtime package for use by debugger,
which needs to make sure that all ptrace calls
about a given pid come from the same thread.

R=r
DELTA=175  (90 added, 63 deleted, 22 changed)
OCL=31546
CL=31558
2009-07-13 17:28:39 -07:00
Kai Backman
7842b03f70 Fixed minor typo in asm file.
R=rsc
APPROVED=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=31487
CL=31500
2009-07-12 22:12:19 -07:00
Russ Cox
92e925778e reflection for interface set
rename map access methods to Elem, SetElem.

R=r
DELTA=95  (66 added, 7 deleted, 22 changed)
OCL=31456
CL=31469
2009-07-10 16:32:26 -07:00
Russ Cox
12ebbe7463 reflection for methods
R=r
DELTA=156  (135 added, 8 deleted, 13 changed)
OCL=31407
CL=31428
2009-07-09 17:27:49 -07:00
Russ Cox
bba278a43b reflection for functions
add channel send type check (thanks austin).
fix type mismatch message.

R=r
DELTA=241  (225 added, 5 deleted, 11 changed)
OCL=31370
CL=31375
2009-07-08 18:16:09 -07:00
Russ Cox
5ddaf9a098 reflection for channels
R=r
DELTA=188  (171 added, 6 deleted, 11 changed)
OCL=31352
CL=31361
2009-07-08 15:00:54 -07:00
Russ Cox
764b6ec1aa reflection for maps
R=r
DELTA=304  (248 added, 34 deleted, 22 changed)
OCL=31345
CL=31347
2009-07-08 13:55:57 -07:00
Russ Cox
c7513eac88 runtime: use new reflect data structures (CL 31107)
in place of sigi, sigt.

R=ken
OCL=31118
CL=31277
2009-07-07 11:02:54 -07:00
Russ Cox
4793400bd1 new reflect library data structures and code declarations
* use structs instead of interfaces
  * compiler lays out data structures ahead of time,
    so no more parsing of strings.
  * unified reflect data structures with interface
    runtime data structures.
  * richer data structures should enable reflection
    on chans and maps, but not implemented here.

R=r,iant
DELTA=1179  (1179 added, 0 deleted, 0 changed)
OCL=31107
CL=31213
2009-07-06 15:34:04 -07:00
Russ Cox
29aa3ffbf6 move Structrnd to runtime.h
R=ken
OCL=31125
CL=31125
2009-07-02 21:25:46 -07:00
Russ Cox
20cfa4a568 change alignment rules: roll receiver into
input parameters, move output parameters
into their own struct.

R=ken
OCL=30954
CL=30966
2009-06-30 20:02:07 -07:00
Russ Cox
150a64572b remove declarations for functions that cannot be called from c
(because they return values in the input parameters).

R=iant
DELTA=12  (0 added, 11 deleted, 1 changed)
OCL=30952
CL=30965
2009-06-30 20:01:59 -07:00
Russ Cox
fa40c856ac convert string runtime to use cgo.
now that cgo2c can handle it,
merge x.c and x_go.cgo into
a single x.cgo, for x=float,malloc,sema.

R=r
DELTA=1950  (954 added, 996 deleted, 0 changed)
OCL=30951
CL=30964
2009-06-30 20:01:50 -07:00
Russ Cox
88e7fd5410 in preparation for changing 6g's behavior to
align the output args separately from the input args,
change cgo2c to insert the necessary padding
when the two arg lists are concatenated in the c
translation.

for example, there is a runtime

	func indexstring(s string, i int32) (b byte)

right now in 6g those arguments are aligned in one
struct with s at offset 0, i at 16, and b at 20.
soon the b byte will be in its own struct and structs
are 8 aligned, so it will be b at 24.

right now cgo2c generates:

	void indexstring(string s, int32 i, byte b)

this CL makes it generate, in --6g mode:

	void indexstring(string s, int32 i, uint32, byte b)

this is valid 6c input, although not valid gcc input.
(the code is being generated for 6c only anyway.)

also, allow C code to be mixed in among the Go funcs.
every instance of the token `func' is expected to start
a new go func.

R=iant
DELTA=145  (118 added, 0 deleted, 27 changed)
OCL=30949
CL=30963
2009-06-30 20:01:41 -07:00
Russ Cox
d3a412a5ab io.StringBytes -> strings.Bytes
io.ByteBuffer -> bytes.Buffer

left io.ByteBuffer stub around for now,
for protocol compiler.

R=r
OCL=30861
CL=30872
2009-06-29 15:24:23 -07:00
Russ Cox
a0bcaf4c00 Change os.Error convention:
echo back context of call in error if likely to be useful.

For example, if os.Open("/etc/passwd", os.O_RDONLY)
fails with syscall.EPERM, it returns as the os.Error

	&PathError{
		Op: "open",
		Path: "/etc/passwd"
		Error: os.EPERM
	}

which formats as

	open /etc/passwd: permission denied

Not converted:

	datafmt
	go/...
	google/...
	regexp
	tabwriter
	template

R=r
DELTA=1153  (561 added, 156 deleted, 436 changed)
OCL=30738
CL=30781
2009-06-25 20:24:55 -07:00
Kai Backman
111005d32b Add Gobuf.r0 that stores arg0 or return value of
goroutine. arm only.

R=rsc
APPROVED=rsc
DELTA=5  (3 added, 2 deleted, 0 changed)
OCL=30644
CL=30746
2009-06-25 11:26:10 -07:00
Kai Backman
be639b9a51 Runtime is now starting up with a dummy c program as target:
- morestack and gosave/gogo/gocall support
- memclr and memset from inferno
- bugfixes in _rt0_arm

R=rsc
APPROVED=rsc
DELTA=304  (174 added, 36 deleted, 94 changed)
OCL=30636
CL=30642
2009-06-23 11:54:23 -07:00
Kai Backman
d281748a6d add arm support to mkasmh
R=rsc
APPROVED=rsc
DELTA=5  (5 added, 0 deleted, 0 changed)
OCL=30587
CL=30595
2009-06-22 14:08:00 -07:00
Russ Cox
ab7a8d43a4 make pkg/runtime/Makefile behave like the others:
make builds; make install installs.

R=r
DELTA=2  (2 added, 0 deleted, 0 changed)
OCL=30489
CL=30491
2009-06-18 13:33:28 -07:00
Russ Cox
f39fcd7e42 fix 386 build.
some day...

TBR=r
OCL=30453
CL=30453
2009-06-17 16:34:13 -07:00
Russ Cox
380200953a Forgot to check in 386/asm.h.
Rather than do that, fix build by
generating asm.h automatically.

R=r
DELTA=97  (48 added, 36 deleted, 13 changed)
OCL=30449
CL=30452
2009-06-17 16:31:02 -07:00
Russ Cox
8522a478bb update 386 to new runtime (CL 30381)
R=r
DELTA=298  (119 added, 81 deleted, 98 changed)
OCL=30427
CL=30443
2009-06-17 15:15:55 -07:00
Russ Cox
7343e03c43 runtime: stack growth adjustments, cleanup
* keep coherent SP/PC in gobuf
	  (i.e., SP that would be in use at that PC)
	* gogocall replaces setspgoto,
	  should work better in presence of link registers
	* delete unused system calls

only amd64; 386 is now broken

R=r
DELTA=548  (183 added, 183 deleted, 182 changed)
OCL=30381
CL=30442
2009-06-17 15:12:16 -07:00
Kai Backman
1ac2cfc720 grab bag of changes aimed at getting stack splitting to work:
- morestack support for 5l and arm runtime
- argsize support in 5c, 5l, ar and nm. assembly code from 5a
  will break in interesting ways unless NOSPLIT is specified
- explicit cond execution constants
- fix 5l output to use %d instead of %ld so that negative
  values show.
- added a lot of code to arm/asm.s. runtime entry code almost
  working currently aborts at gogo not implemented

R=rsc
APPROVED=rsc
DELTA=305  (125 added, 29 deleted, 151 changed)
OCL=30246
CL=30347
2009-06-16 11:25:58 -07:00
Russ Cox
8c357ce269 fix another gc bug, one that i have only imagined,
not observed: do not use malloc to allocate stacks
during garbage collection, because it would make the
malloc data structures change underfoot.

R=r
DELTA=6  (3 added, 0 deleted, 3 changed)
OCL=30323
CL=30326
2009-06-15 21:31:56 -07:00
Russ Cox
36835c7a47 fix garbage collection race: save stack trace
when changing process state to Gsyscall, not after.

R=r
DELTA=8  (4 added, 3 deleted, 1 changed)
OCL=30320
CL=30325
2009-06-15 21:30:53 -07:00
Kai Backman
528919520d Adding a batch of missing system calls.
R=rsc
APPROVED=rsc
DELTA=1329  (1264 added, 1 deleted, 64 changed)
OCL=30040
CL=30158
2009-06-10 11:53:07 -07:00
Rob Pike
d90e7cbac6 mv src/lib to src/pkg
tests: all.bash passes, gobuild still works, godoc still works.

R=rsc
OCL=30096
CL=30102
2009-06-09 09:53:44 -07:00