Mercurial > hg > Members > anatofuz > MoarVM
changeset 33:a5f4b3f1c5d1
fix right curly brackets indents and use i for GET_REG
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Nov 2018 17:44:43 +0900 |
parents | 1bec35c665bd |
children | 0853778b49ee |
files | cbctools/change_OP_to_cbc.pl |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/cbctools/change_OP_to_cbc.pl Sun Nov 04 21:09:28 2018 +0900 +++ b/cbctools/change_OP_to_cbc.pl Tue Nov 13 17:44:43 2018 +0900 @@ -16,6 +16,15 @@ my @upside = (); for (;$i < scalar(@cbc_lines); $i++){ + + $cbc_lines[$i] = change_i($cbc_lines[$i]); + + #$cbc_lines[$i] =~ s/reg_base/i->reg_base/g; + #$cbc_lines[$i] =~ s/tc/i->tc/g; + #$cbc_lines[$i] =~ s/tc/i->tc/g; + + $cbc_lines[$i] =~ s/GET_(REG|LEX)\((.*?)\)/GET_$1($2,i)/g; + push @upside,$cbc_lines[$i]; if ($cbc_lines[$i+1] =~ /\/\* This is the interpreter run loop. We have one of these per thread. \*\//){ last; @@ -76,6 +85,11 @@ } # 普通の行は変換してinsertする + if ($cbc_lines[$i] =~ /}/){ + if ($cbc_lines[$i+1] =~ /OP/){ + $cbc_lines[$i] = "}\n"; + } + } push @rewritec,change_i($cbc_lines[$i]); @@ -93,6 +107,7 @@ sub change_i { my $str = shift; + $str =~ s/^op/i->op/g; $str =~ s/cur_op/i->cur_op/g; $str =~ s/tc/i->tc/g; $str =~ s/cur_callsite/i->cur_callsite/g;