2 # Transform assembly in order to clean each stack frame for X86_64.
5 $SIG{__WARN__} = sub { die @_ };
8 # Whether we are still scanning the content of a function:
11 # Save lines of the function:
14 # Size of the stack for this function:
18 # Counter for assigning unique ids to labels:
22 my $qsize = $size / 8;
23 my $offset = - $size - 8;
26 print("\tmovabsq \$$qsize, %r11\n");
27 print(".Lstack_cleaner_loop$id:\n");
28 print("\tmovq \$0, $offset(%rsp,%r11,8)\n");
29 print("\tsubq \$1, %r11\n");
30 print("\tjne .Lstack_cleaner_loop$id\n");
44 if (m/^[ \t]*.cfi_endproc$/) {
46 } elsif (m/^[ \t]*pushq/) {
48 } elsif (m/^[ \t]*subq[\t *]\$([0-9]*),[ \t]*%rsp$/) {
50 $val = oct($val) if $val =~ /^0/;
54 } elsif (m/^[ \t]*.cfi_startproc$/) {