Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Another simple perl task

7 views
Skip to first unread message

Dan Sugalski

unread,
Apr 7, 2004, 3:36:18 PM4/7/04
to perl6-i...@perl.org
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

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Stefan Lidman

unread,
Apr 8, 2004, 8:54:11 AM4/8/04
to perl6-i...@perl.org
>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;

Dan Sugalski

unread,
Apr 13, 2004, 9:50:20 AM4/13/04
to Stefan Lidman, perl6-i...@perl.org
At 2:54 PM +0200 4/8/04, Stefan Lidman wrote:
> >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?

This looks quite nice and works as a standalone utility, so I'll put
it in the repository as build_tools/list_unjitted.pl.

Leopold Toetsch

unread,
Apr 13, 2004, 10:26:25 AM4/13/04
to Dan Sugalski, perl6-i...@perl.org
Dan Sugalski <d...@sidhe.org> wrote:

> This looks quite nice and works as a standalone utility, so I'll put
> it in the repository as build_tools/list_unjitted.pl.

or tools/dev as it isn't quite required for building parrot?

leo

Dan Sugalski

unread,
Apr 13, 2004, 11:28:00 AM4/13/04
to l...@toetsch.at, perl6-i...@perl.org

That works too--I don't really care as long as it's in. :) If you
want to move it go ahead, that's fine. (I think I may take a shot at
some of the missing i386 ops, just for fun)

Dan Sugalski

unread,
Apr 13, 2004, 12:16:57 PM4/13/04
to l...@toetsch.at, perl6-i...@perl.org
At 5:52 PM +0200 4/13/04, Leopold Toetsch wrote:
>Dan Sugalski <d...@sidhe.org> wrote:
>> At 4:26 PM +0200 4/13/04, Leopold Toetsch wrote:
>>>
>>>or tools/dev as it isn't quite required for building parrot?
>
>> That works too--I don't really care as long as it's in. :) If you
>> want to move it go ahead, that's fine. (I think I may take a shot at
>> some of the missing i386 ops, just for fun)
>
>If you wonna have fun please look at t/pmc/object-meths_17 labeled:
>"constructor - diamond parents" :)

Heh. I ought to do that in the next day or so.

Leopold Toetsch

unread,
Apr 13, 2004, 11:52:21 AM4/13/04
to Dan Sugalski, perl6-i...@perl.org
Dan Sugalski <d...@sidhe.org> wrote:
> At 4:26 PM +0200 4/13/04, Leopold Toetsch wrote:
>>
>>or tools/dev as it isn't quite required for building parrot?

> That works too--I don't really care as long as it's in. :) If you
> want to move it go ahead, that's fine. (I think I may take a shot at
> some of the missing i386 ops, just for fun)

If you wonna have fun please look at t/pmc/object-meths_17 labeled:


"constructor - diamond parents" :)

leo

0 new messages