[Fwd: Re: Another task for the interested - t/pmc/pmc.t]

2005-03-12 Thread Leopold Toetsch
[ shoud have gone to the list probaby ]
 Original Message 
Subject: Re: Another task for the interested - t/pmc/pmc.t
Date: Sat, 12 Mar 2005 07:50:04 +0100 (CET)
From: Steven Schubiger [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
On  9 Mar, Leopold Toetsch wrote:
The test file t/pmc/pmc.t is full of Perl* tests. These should be 
factored out into t/pmc/perl*.t.

The file itself should contain just common PMC functionality tests, like 
the range or type checks.

Thanks,
leo
I'll have a try at this one (for the moment),
if no one else bothers.


RE: A task for the interested

2001-09-18 Thread Brent Dax

Dan Sugalski:
# One of the things that the configure script needs to do is
# generate the
# opcode dispatch macro to either be a giant switch statement (with a
# fallthrough default to handle cases we don't know about) or
# the function
# table dispatch we have now.

If somebody codes up the alternate dispatch, I can easily modify
Configure.pl, config_h.in and the hints files to handle it.  Something
like this, perhaps:

#define USE_${dispatch}_DISPATCH

#ifdef USE_switch_DISPATCH
#define DISPATCHER
switch-based dispatcher code here
#else
#define DISPATCHER
function table-based dispatcher code here
#endif

--Brent Dax
[EMAIL PROTECTED]

They *will* pay for what they've done.




Re: A task for the interested

2001-09-18 Thread Simon Cozens

On Tue, Sep 18, 2001 at 02:32:32PM -0700, Brent Dax wrote:
 If somebody codes up the alternate dispatch, I can easily modify
 Configure.pl, config_h.in and the hints files to handle it.  Something
 like this, perhaps:

Something like that, but the Right Way would be to rewrite DO_OP in
interp_guts.h

Simon

-- 
} /* the next line is indented funny to preserve old indentation */
- plan9 has a bad day



Re: A task for the interested

2001-09-18 Thread Damien Neil

On Tue, Sep 18, 2001 at 03:55:23PM -0400, Dan Sugalski wrote:
 Anyone care to take a shot at it? Having an extra overridable column in 
 the opcode_table file (so we know which opcodes are overridable, and thus 
 can't be in the switch) would be a good thing while you were at it...

I will do this tonight, if nobody else gets to it first.

 - Damien



RE: A task for the interested

2001-09-18 Thread Brent Dax

Simon Cozens:
# On Tue, Sep 18, 2001 at 02:32:32PM -0700, Brent Dax wrote:
#  If somebody codes up the alternate dispatch, I can easily modify
#  Configure.pl, config_h.in and the hints files to handle it.
#  Something
#  like this, perhaps:
#
# Something like that, but the Right Way would be to rewrite DO_OP in
# interp_guts.h

So, something more like this?

~~

--- ..\..\parrot-cvs\parrot\config_h.in Fri Sep 14 09:40:36 2001
+++ config_h.in Tue Sep 18 14:44:48 2001
@@ -24,7 +24,14 @@

 #define MASK_CHUNK_LOW_BITS 0xf000

+#define USE_DISPATCH_${dispatch}

+#ifdef USE_DISPATCH_SWITCH
+#  undef DO_OP
+#  define DO_OP code here
+#endif
+
+
 ${headers}
--- ..\..\parrot-cvs\parrot\build_interp_starter.pl Tue Sep 18
10:54:52 2001
+++ build_interp_starter.pl Tue Sep 18 14:48:26 2001
@@ -59,12 +59,13 @@
 #

 print INTERP EOI;
-
-#define DO_OP(w,x,y,z) do { \\
-x = (void *)z-opcode_funcs; \\
-(void *)y = x[*w]; \\
-w = (y)(w,z); \\
- } while (0);
+#ifndef DO_OP
+#  define DO_OP(w,x,y,z) do { \\
+   x = (void *)z-opcode_funcs; \\
+   (void *)y = x[*w]; \\
+   w = (y)(w,z); \\
+} while (0);
+#endif
 EOI

 # Spit out the OPCODE_FINGERPRINT macro

~~~

(With, of course, the correct code put in config_h.in, and various
changes and additions to the hints/ folder to automagically suggest the
right dispatch to use.)

--Brent Dax
[EMAIL PROTECTED]

They *will* pay for what they've done.




RE: A task for the interested

2001-09-18 Thread Brent Dax

Simon Cozens:
# On Tue, Sep 18, 2001 at 02:51:35PM -0700, Brent Dax wrote:
#  So, something more like this?
#
# Urh, how can I put this? No.
#
# I *really* want to avoid macro hackery - undef'ing this and
# then testing if it's defined and then redefining it, and
# urgh, urgh, urgh. No.
#
# I was thinking more like:
#
#  +++ build_interp_starter.pl Tue Sep 18 14:48:26 2001
#  @@ -59,12 +59,13 @@
#   #
# 
# if ($Config{dispatch} eq fpointer) {
#   print INTERP EOI;
#  -#define DO_OP(w,x,y,z) do { \\
#  -x = (void *)z-opcode_funcs; \\
#  -(void *)y = x[*w]; \\
#  -w = (y)(w,z); \\
#  - } while (0);
#   EOI
# } elsif ($config{dispatch} eq switch) {
#print INTERP EOI;
# #define DO_OP(w,x,y,z) do { \\
# switch(*w) {...\\
# ...
# EOF
# } elsif ( ...

Okay, that's actually not too hard--just add a 'use Parrot::Config;' to
the top and check something in %PConfig.  Alright.

--Brent Dax
[EMAIL PROTECTED]

They *will* pay for what they've done.




Re: A task for the interested

2001-09-18 Thread Bryan C . Warnock

On Tuesday 18 September 2001 03:55 pm, Dan Sugalski wrote:
 One of the things that the configure script needs to do is generate the
 opcode dispatch macro to either be a giant switch statement (with a
 fallthrough default to handle cases we don't know about) or the function
 table dispatch we have now.

FWIW, having the function dispatch table as the default case in a switch 
wasn't a big win in my initial testing.  The savings came from an initial 
test to decide to switch or lookup, but that requires the non-overrideable 
to be blocked so that they're easily tested (ie, opcodes 0-n).  Parrot's 
performance does seem to differ from my initial testing, though, so you may 
want to benchmark it every which way.

-- 
Bryan C. Warnock
[EMAIL PROTECTED]