]> Cypherpunks repositories - gostls13.git/commit
gc: make static initialization more static
authorRuss Cox <rsc@golang.org>
Wed, 31 Aug 2011 11:37:14 +0000 (07:37 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 31 Aug 2011 11:37:14 +0000 (07:37 -0400)
commit335da67e00baecf05035f97ef578abf3f35ba82a
tree0bed2e6664a4fcaea2a30ca35c7e41cdaac8189b
parent5f40c5b3846074c1aba903440c785ec499c392d1
gc: make static initialization more static

Does as much as possible in data layout instead
of during the init function.

Handles var x = y; var y = z as a special case too,
because it is so prevalent in package unicode
(var Greek = _Greek; var _Greek = []...).

Introduces InitPlan description of initialized data
so that it can be traversed multiple times (for example,
in the copy handler).

Cuts package unicode's init function size by 8x.
All that remains there is map initialization, which
is on the chopping block too.

Fixes sinit.go test case.

Aggregate DATA instructions at end of object file.

Checkpoint.  More to come.

R=ken2
CC=golang-dev
https://golang.org/cl/4969051
15 files changed:
src/cmd/5g/gobj.c
src/cmd/5g/gsubr.c
src/cmd/6g/gobj.c
src/cmd/6g/gsubr.c
src/cmd/8g/gg.h
src/cmd/8g/gobj.c
src/cmd/8g/gsubr.c
src/cmd/gc/const.c
src/cmd/gc/go.h
src/cmd/gc/obj.c
src/cmd/gc/reflect.c
src/cmd/gc/sinit.c
src/cmd/gc/typecheck.c
test/golden.out
test/sinit.go