X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fgenmdesc.pl;h=ae49ecba9f28685169c6ef23c42d422e5898a540;hb=f98d0799d89401853f59e4427764932d633b8935;hp=b3a4cc8b78b06658dd2f1bf7734dd35beb801c54;hpb=4f61b92ce0d12d761c0a9e811e2816e3dd4953fb;p=mono.git diff --git a/mono/mini/genmdesc.pl b/mono/mini/genmdesc.pl old mode 100644 new mode 100755 index b3a4cc8b78b..ae49ecba9f2 --- a/mono/mini/genmdesc.pl +++ b/mono/mini/genmdesc.pl @@ -20,7 +20,7 @@ sub INST_MAX () {return 6;} # this must include all the #defines used in mini-ops.h my @defines = qw (__i386__ __x86_64__ __ppc__ __powerpc__ __ppc64__ __arm__ - __sparc__ sparc __s390__ s390 __ia64__ __alpha__ __mips__ __aarch64__); + __sparc__ sparc __s390__ s390 __alpha__ __mips__ __aarch64__ __wasm__); my %table =(); my %template_table =(); my @opcodes = (); @@ -88,7 +88,9 @@ sub load_opcodes if ($arch =~ "__aarch64__") { $arch_define = "TARGET_ARM64"; } - + if ($arch =~ "__wasm__") { + $arch_define = "TARGET_WASM"; + } parse_file ($arch_define, "$srcdir/mini-ops.h"); return; $cpp .= " -D$arch_define $srcdir/mini-ops.h|"; @@ -178,6 +180,9 @@ sub build_spec { if (defined $vals [$i]) { if ($i == INST_LEN) { $n = $vals [$i]; + if ($n =~ /[^0-9]/) { + die "Invalid instruction length $n\n"; + } if ((defined $vals [INST_NACL]) and $nacl == 1){ $n = $vals [INST_NACL]; } @@ -200,11 +205,11 @@ sub build_table { my ($fname, $name) = @_; my $i; my $idx; - my $idx_array = "const guint16 ${name}_idx [] = {\n"; + my $idx_array = "const guint16 mono_${name}_idx [] = {\n"; open (OUT, ">$fname") || die "Cannot open file $fname: $!"; print OUT "/* File automatically generated by genmdesc, don't change */\n\n"; - print OUT "const char $name [] = {\n"; + print OUT "const char mono_$name [] = {\n"; print OUT "\t\"" . ("\\x0" x INST_MAX) . "\"\t/* null entry */\n"; $idx = 1;