• Russ Cox's avatar
    cmd/internal/gc: replace hash tables with Go maps · d0b59deb
    Russ Cox authored
    The C version of the compiler had just one hash table,
    indexed by a (name string, pkg *Pkg) pair.
    Because we always know the pkg during a lookup,
    replace the one table with a per-Pkg map[string]*Sym.
    This also lets us do non-allocating []byte key lookups.
    
    This CL *does* change the generated object files.
    In the old code, export data and init calls were emitted
    in "hash table order". Now they are emitted in the order
    in which they were added to the table.
    
    Change-Id: I5a48d5c9add996dc43ad04a905641d901522de0b
    Reviewed-on: https://go-review.googlesource.com/6600Reviewed-by: 's avatarRob Pike <r@golang.org>
    d0b59deb
export.go 12.4 KB