Skip to content

Commit

Permalink
runtime: remove holes in FUNCDATA tables
Browse files Browse the repository at this point in the history
Shrinks the text segment size by about 1.5% for the "go", "gofmt",
and "camlistored" commands on linux/amd64.

Before:
$ size go gofmt camlistored
   text	   data	    bss	    dec	    hex	filename
6506842	 136996	 105784	6749622	 66fdb6	go
2376046	  85232	  90984	2552262	 26f1c6	gofmt
17051050	 190256	 130320	17371626	10911ea	camlistored

After:
$ size go gofmt camlistored
   text	   data	    bss	    dec	    hex	filename
6403034	 136996	 105784	6645814	 656836	go
2331118	  85232	  90984	2507334	 264246	gofmt
16842586	 190256	 130320	17163162	105e39a	camlistored

Fixes golang#8604.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/137790043
  • Loading branch information
mdempsky authored and ianlancetaylor committed Aug 29, 2014
1 parent b3de7f2 commit 3d128db
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pkg/runtime/funcdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#define PCDATA_ArgSize 0 /* argument size at CALL instruction */
#define PCDATA_StackMapIndex 1

#define FUNCDATA_ArgsPointerMaps 2 /* garbage collector blocks */
#define FUNCDATA_LocalsPointerMaps 3
#define FUNCDATA_DeadValueMaps 4
#define FUNCDATA_ArgsPointerMaps 0 /* garbage collector blocks */
#define FUNCDATA_LocalsPointerMaps 1
#define FUNCDATA_DeadValueMaps 2

// To be used in assembly.
#define ARGSIZE(n) PCDATA $PCDATA_ArgSize, $n
Expand All @@ -27,9 +27,9 @@
enum {
PCDATA_ArgSize = 0,
PCDATA_StackMapIndex = 1,
FUNCDATA_ArgsPointerMaps = 2,
FUNCDATA_LocalsPointerMaps = 3,
FUNCDATA_DeadValueMaps = 4,
FUNCDATA_ArgsPointerMaps = 0,
FUNCDATA_LocalsPointerMaps = 1,
FUNCDATA_DeadValueMaps = 2,
ArgsSizeUnknown = 0x80000000,
};
*/

0 comments on commit 3d128db

Please sign in to comment.