>Here's something for someone who wants to dig in a bit and needs a 
>place to start.
>
>Many, but by no means all, of the ops are JITted right now. There's 
>code to mess about with the JITting in jit2h.pl. What would be nice 
>is if there was a way to get a list of the ops that are *not* JITted, 
>so it'd be easy to poke around and add new ops as we go. (It'd also 
>be nice to verify an MD5, or other checksum, of the actual op source 
>with a data file in the distribution so we can see when an op changes 
>and invalidates the JITted version)
>-- 
>                                         Dan

Hi

I am not sure I have done the right thing here but I think the
following program does what you want. It must be run in the
parrot root dir. Shold it be added to an existing file? Which?
Or have I done a completely wrong thing?

/Stefan


#!/usr/bin/perl -wl

use strict;

unless (1 == scalar @ARGV){
    print "Must give a directory as an argument.\nPossible options are:";
    opendir DIR, 'jit' or die $!;
    while (my $dir = readdir DIR){
        next if $dir =~ /^\./ or $dir eq 'CVS';
        print $dir;
    }
    exit 1;
}

my @ops;
my @jitted;

open OPS, '<', 'ops/ops.num' or die "Damn can not open 'ops/ops.num': $!";

while(<OPS>){
    next if /^\s*#/ or /^\s*$/;
    if (my ($op) = /(\S+)\s+\d+/){
        push @ops, $op;
    }
    else { die "Misformated line: $.";}
}

close OPS or die "Noo.. $!";

open JIT, '<', "jit/$ARGV[0]/core.jit" or die "Could not open jit/$ARGV[0]/core.jit: 
$!";

while (<JIT>){
    if (my ($jit) = /^Parrot_(\S+)\s*\{\s*$/){
        push @jitted, $jit;
    }
}
close JIT or die "Noo.. $!";

my @not_jitted;

OP : foreach my $op ( @ops){
    foreach my $jit (@jitted){
        next OP if $jit eq $op;
    }
    push @not_jitted, $op;
}

print foreach @not_jitted;

print 'Not jitted: ', scalar @not_jitted;
print 'Jitted: ', scalar @jitted;
print 'Total ops: ', scalar @ops;

Reply via email to