$chk[$i] .= $_;
- } elsif ( /^(ret_|djn_)/ ) {
- $chk[++$i] .= $_;
- $chkcat[$i] = 'misc';
- $chksymb[$i] = '';
-
- } elsif ( /^vtbl_([A-Za-z0-9_]+):$/ ) {
- $chk[++$i] .= $_;
- $chkcat[$i] = 'vector';
- $chksymb[$i] = $1;
-
- $vectorchk{$1} = $i;
-
- } elsif ( /^([A-Za-z0-9_]+)DirectReturn:$/ ) {
- $chk[++$i] .= $_;
- $chkcat[$i] = 'direct';
- $chksymb[$i] = $1;
-
- $directchk{$1} = $i;
-
- } elsif ( /^[A-Za-z0-9_]+_upd:$/ ) {
- $chk[++$i] .= $_;
- $chkcat[$i] = 'misc';
- $chksymb[$i] = '';
-
} elsif ( /^\.LLC(\d+):$/ ) {
$chk[++$i] .= $_;
$chkcat[$i] = 'string';
$chkcat[$i] = 'infotbl';
$chksymb[$i] = $symb;
+ die "Info table already? $symb; $i\n" if defined($infochk{$symb});
+
$infochk{$symb} = $i;
} elsif ( /^([A-Za-z0-9_]+)_entry:$/ ) {
$chkcat[$i] = 'data';
$chksymb[$i] = '';
+ } elsif ( /^(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^vtbl_([A-Za-z0-9_]+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)DirectReturn:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^[A-Za-z0-9_]+_upd:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
} elsif ( /^[A-Za-z0-9_]/ ) {
local($thing);
chop($thing = $_);
print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
# entry code will be put here!
+ # paranoia
+ if ( $chk[$infochk{$symb}] =~ /\.word\s+([A-Za-z0-9_]+_entry)$/
+ && $1 ne "${symb}_entry" ) {
+ print STDERR "!!! entry point???\n",$chk[$infochk{$symb}];
+ }
+
$chkcat[$infochk{$symb}] = 'DONE ALREADY';
}
# teach it to drop through to the fast entry point:
$c = $chk[$slowchk{$symb}];
- $c =~ s/^\tcall _${symb}_fast\d+,.*\n\tnop\n//;
- $c =~ s/^\tcall _${symb}_fast\d+,.*\n(\t[a-z].*\n)/\1/;
+
+ if ( defined($fastchk{$symb}) ) {
+ $c =~ s/^\tcall ${symb}_fast\d+,.*\n\tnop\n//;
+ $c =~ s/^\tcall ${symb}_fast\d+,.*\n(\t[a-z].*\n)/\1/;
+ }
print STDERR "still has jump to fast entry point:\n$c"
- if $c =~ /_${symb}_fast/;
+ if $c =~ /${symb}_fast/; # NB: paranoia
print OUTASM "\.text\n\t\.align 4\n";
print OUTASM $c;