* conversions all in one place.
* no separate load, store phases;
direct memory addressing when possible
(this is the x86 after all!).
avoids extra registers, extra MOVQs.
* fixes int32 -> uint64 bug
(was zero-extending)
R=ken
OCL=29482
CL=29484
* string format changed
* files got renamed
* new files that i forgot to check in last time
updates are all copy and paste from 6g
R=ken
OCL=29385
CL=29400
structtype{a:1, a:2}
maptypetype{"xx":1, "xx":2}
arraytypetype{5:1, 5:2}
2. bug in registerization concerning
alias of a struct and one of its elements
3. code optimization of struct.field
(which exposed bug in 2)
R=r
OCL=29315
CL=29315
*** Reason for rollback ***
too many files included
*** Original change description ***
simplifying grammar: delete LBASETYPE and LACONST
R=ken
OCL=29303
CL=29303
when assigning a multifield object
(structs or arrays of structs) they
must not contain any fields that could
not be assigned individually.
R=ken
OCL=29192
CL=29194
this is not a user-visible change.
before, all interface values were
struct Itype {
Sigt *type;
Sigi *inter;
void *method[n];
}
struct Iface {
void *addr;
Itype *itype;
}
the itype is basically a vtable, but it's unnecessary
if the static type is interface{ }.
for interface values with static type empty, the
new representation is
struct Eface {
void *addr;
Sigt *type;
}
this complicates the code somewhat, but
it reduces the number of Itypes that
have to be computed and cached,
it opens up opportunities to avoid function
calls in a few common cases,
and it will make it possible to lay out
interface{} values at compile time,
which i think i'll need for the new reflection.
R=ken
OCL=28701
CL=29121
do not update lineno from ONAME nodes,
because they have declaration lineno not use.
show actual name in top-level statement error.
before
runtime.a:7: x.go:5: walkstate: NAME not a top level statement
after
x.go:14: walkstate: runtime.Goexit not a top level statement
R=ken
OCL=29113
CL=29116
if both types are named, they must be
the same type (arising from the same
declaration).
R=r,gri
DELTA=44 (21 added, 4 deleted, 19 changed)
OCL=28436
CL=28577
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
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
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
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
* 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
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
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
exact spec:
a) must be a multi-assignment w :=
b) a proper subset of the lhs
can be declared in same block
with the same type with no
"redeclaration" error
R=r
OCL=27610
CL=27610
this allows gotest to find the locally built package when doing
make
gotest
without this option, one would have to say
make install
gotest
which kinda defeats the purpose
based on discussions with rsc.
R=ken,rsc
DELTA=12 (10 added, 1 deleted, 1 changed)
OCL=27606
CL=27606
for example, if building in src/lib/container,
objects go in obj/container/, so that 6g -Iobj
will find "container/vector".
install packages in hierarchy in $GOROOT.
this change only updates gobuild.
another change will have to update all
the sources to refer to "container/vector" etc
and regenerate all the Makefiles.
there are some pretty lame functions here
(e.g., Mkdir, Remove, the Getenv("PWD"))
but i will implement better ones in another CL.
R=r
DELTA=117 (99 added, 2 deleted, 16 changed)
OCL=27550
CL=27574
store only the original import path string (+ .a)
if 6g resolves it to an archive file.
let 6l re-resolve the .a at link time.
this lets libraries build against an archive
in the current directory but get used
against an installed archive.
R=r
OCL=27244
CL=27244
* make([100]int) was being compiled to
make([]int), kind of.
* []this = [100]that was working for any this, that.
turned up a typo in pipe_test.go
R=ken
OCL=27081
CL=27081
was copying a bit too much about t into n,
like whether the signature was queued to be printed.
(bug reported by anton)
was also editing t, meaning you could do
type T int;
func (p int) Meth() { }
both fixed.
R=ken
OCL=27052
CL=27052
this avoids problems people have run into with
multiple closures in the same package.
when preparing filename, only cut off .go, not .anything.
this fixes a bug tgs ran into with foo.pb.go and foo.go
in the same package.
also turn bad identifier chars from filename into
underscores: a-b.pb.go => a_b_pb
R=ken
OCL=27050
CL=27050
160 - 75 was just barely not enough for deferproc + morestack.
added enum names and bumped to 256 - 128.
added explanation.
changed a few mal() (garbage-collected) to
malloc()/free() (manually collected).
R=ken
OCL=26981
CL=26981
into gc directory, where it gets included as ../gc/ldbody
this is similar to the assemblers including ../cc/lexbody
and ../cc/macbody.
* hook go-specific loader code into 8l.
* make current 8.out.h and 6.out.h backward compatible
with plan 9's versions. i had added some constants in
the middle of enums and have now moved them to the end.
this keeps us from invalidating old .8 and .6 files.
not sure how much it really matters, but easy to do.
R=r
DELTA=1314 (667 added, 623 deleted, 24 changed)
OCL=26938
CL=26941
uses gcc to determine system header layouts and
emits simple C or Go. see comment in main.c.
R=r
DELTA=1069 (1067 added, 0 deleted, 2 changed)
OCL=26682
CL=26880
and expected review latency I needed to combine the CLs.
1. Made the 5* toolpath build using the go build
system. Hooked the subdirectories to clean.bash but added a
separate make5.bash for now. Minor massage to make the code
more similar to the current structure of 6c/6a/6l.
2. Change all references from long to int32 in line with
similar change for the other toolchains.
The end result is that 5c, 5a and 5l can now be compiled and
the executables start up properly. Haven't thrown any input at
them yet.
R=rsc
APPROVED=rsc
DELTA=1052 (392 added, 328 deleted, 332 changed)
OCL=26757
CL=26761
move darwin-amd64 specific code into runtime/darwin/amd64/
repeat for linux.
move rt0 into runtime.a instead of keeping a separate .6 file.
6l seems to have no problem with that.
TBR=r
OCL=26680
CL=26680
add "extern register" support to 8c.
extern register means allocate in the FS-relative segment.
make 8l generate segmented stack checks.
R=ken
OCL=26600
CL=26606
if T has pointer methods. this is just a heuristic
but it catches the problem robert ran into and
lets me put the larger interface issues aside for
now. found one bug in pretty.
R=ken
OCL=26141
CL=26141