• Russ Cox's avatar
    gc: make static initialization more static · 335da67e
    Russ Cox authored
    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
    335da67e
sinit.go 5.09 KB