5g. fixes to 64 bit code gen. added (finally) function to do
shifts properly.
go/test: passes 83% (287/342)
R=rsc
APPROVED=rsc
DELTA=156 (50 added, 53 deleted, 53 changed)
OCL=35589
CL=35616
* in 6l, -K already meant check for stack underflow.
add -KK to mean double-check stack overflows
even in nosplit functions.
* comment out print locks; they deadlock too easily
but are still useful to put back for special occasions.
* let runcgo assembly switch to scheduler stack
without involving scheduler directly. because runcgo
gets called from matchmg, it is too hard to keep it
from being called on other stacks.
R=r
DELTA=94 (65 added, 18 deleted, 11 changed)
OCL=35591
CL=35604
better mach binaries.
cgo working on darwin+linux amd64+386.
eliminated context switches - pi is 30x faster.
add libcgo to build.
on snow leopard:
- non-cgo binaries work; all tests pass.
- cgo binaries work on amd64 but not 386.
R=r
DELTA=2031 (1316 added, 626 deleted, 89 changed)
OCL=35264
CL=35304
* change ldt0setup to set GS itself; nacl won't let us do it.
* change breakpoint to INT $3 so 8l can translate to HLT for nacl.
* panic if closure is needed on nacl.
* do not try to access symbol table on nacl.
* mmap in 64kB chunks.
nacl support:
* system calls, threading, locks.
R=r
DELTA=365 (357 added, 5 deleted, 3 changed)
OCL=34880
CL=34906
params. a number of fixes to assembly routines that assumed R0
had the first arg. one stack offset fix, arm pushes the link
register on stack top.
go/test: passes 65% (235/364) tests
R=rsc
APPROVED=rsc
DELTA=20 (11 added, 0 deleted, 9 changed)
OCL=34809
CL=34812
* use //ffi comments in package import data
to generate relocation entries and library loads.
* call initffi in rt0.s if present
R=r
DELTA=117 (91 added, 3 deleted, 23 changed)
OCL=33739
CL=33750
introduced explicit "data" symbol instead of etext
to mark beginning of data, so that using larger
alignment (i.e. 4MB like GNU loader) doesn't
confuse garbage collector.
split dodata into dodata and dobss in preparation
for putting the dynamic data + headers in the data
segment instead of stuffed at the beginning of the binary.
R=r
DELTA=52 (37 added, 3 deleted, 12 changed)
OCL=33610
CL=33618
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
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
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
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
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
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
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
* 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
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
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
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
* 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
- 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
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