diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-02 14:53:52 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-07-02 14:53:52 +0200 |
commit | ef5463cf16f88c0992b2073a30ab6081c86fdf23 (patch) | |
tree | def2ea3c1470aa0126db226e7e7d5098c31e8dcd | |
parent | 966cafcc77d8cda5d1a95bc73080e9a9b9010a45 (diff) | |
download | busybox-w32-ef5463cf16f88c0992b2073a30ab6081c86fdf23.tar.gz busybox-w32-ef5463cf16f88c0992b2073a30ab6081c86fdf23.tar.bz2 busybox-w32-ef5463cf16f88c0992b2073a30ab6081c86fdf23.zip |
awk: shuffle globals for smaller offsets
function old new delta
awk_main 832 829 -3
evaluate 3229 3223 -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-9) Total: -9 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/awk.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/editors/awk.c b/editors/awk.c index 9f5a94037..068ed687b 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -536,6 +536,11 @@ struct globals { | |||
536 | smallint nextfile; | 536 | smallint nextfile; |
537 | smallint is_f0_split; | 537 | smallint is_f0_split; |
538 | smallint t_rollback; | 538 | smallint t_rollback; |
539 | |||
540 | /* former statics from various functions */ | ||
541 | smallint next_token__concat_inserted; | ||
542 | uint32_t next_token__save_tclass; | ||
543 | uint32_t next_token__save_info; | ||
539 | }; | 544 | }; |
540 | struct globals2 { | 545 | struct globals2 { |
541 | uint32_t t_info; /* often used */ | 546 | uint32_t t_info; /* often used */ |
@@ -548,15 +553,11 @@ struct globals2 { | |||
548 | /* former statics from various functions */ | 553 | /* former statics from various functions */ |
549 | char *split_f0__fstrings; | 554 | char *split_f0__fstrings; |
550 | 555 | ||
551 | uint32_t next_token__save_tclass; | ||
552 | uint32_t next_token__save_info; | ||
553 | smallint next_token__concat_inserted; | ||
554 | |||
555 | smallint next_input_file__files_happen; | ||
556 | rstream next_input_file__rsm; | 556 | rstream next_input_file__rsm; |
557 | smallint next_input_file__files_happen; | ||
557 | 558 | ||
558 | var *evaluate__fnargs; | ||
559 | unsigned evaluate__seed; | 559 | unsigned evaluate__seed; |
560 | var *evaluate__fnargs; | ||
560 | regex_t evaluate__sreg; | 561 | regex_t evaluate__sreg; |
561 | 562 | ||
562 | var ptest__tmpvar; | 563 | var ptest__tmpvar; |
@@ -575,10 +576,10 @@ struct globals2 { | |||
575 | #define G1 (ptr_to_globals[-1]) | 576 | #define G1 (ptr_to_globals[-1]) |
576 | #define G (*(struct globals2 *)ptr_to_globals) | 577 | #define G (*(struct globals2 *)ptr_to_globals) |
577 | /* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */ | 578 | /* For debug. nm --size-sort awk.o | grep -vi ' [tr] ' */ |
578 | /*char G1size[sizeof(G1)]; - 0x74 */ | 579 | //char G1size[sizeof(G1)]; // 0x70 |
579 | /*char Gsize[sizeof(G)]; - 0x1c4 */ | 580 | //char Gsize[sizeof(G)]; // 0x2f8 |
580 | /* Trying to keep most of members accessible with short offsets: */ | 581 | /* Trying to keep most of members accessible with short offsets: */ |
581 | /*char Gofs_seed[offsetof(struct globals2, evaluate__seed)]; - 0x90 */ | 582 | //char Gofs_seed[offsetof(struct globals2, evaluate__seed)]; // 0x7c |
582 | #define t_double (G1.t_double ) | 583 | #define t_double (G1.t_double ) |
583 | #define beginseq (G1.beginseq ) | 584 | #define beginseq (G1.beginseq ) |
584 | #define mainseq (G1.mainseq ) | 585 | #define mainseq (G1.mainseq ) |
@@ -1056,9 +1057,9 @@ static int istrue(var *v) | |||
1056 | */ | 1057 | */ |
1057 | static uint32_t next_token(uint32_t expected) | 1058 | static uint32_t next_token(uint32_t expected) |
1058 | { | 1059 | { |
1059 | #define concat_inserted (G.next_token__concat_inserted) | 1060 | #define concat_inserted (G1.next_token__concat_inserted) |
1060 | #define save_tclass (G.next_token__save_tclass) | 1061 | #define save_tclass (G1.next_token__save_tclass) |
1061 | #define save_info (G.next_token__save_info) | 1062 | #define save_info (G1.next_token__save_info) |
1062 | 1063 | ||
1063 | char *p; | 1064 | char *p; |
1064 | const char *tl; | 1065 | const char *tl; |