At 8:53 PM +0100 8/6/03, Nicholas Clark wrote:
On Tue, May 20, 2003 at 04:33:31PM +0200, Leopold Toetsch wrote:
 In perl.perl6.internals, I wrote:
 > When looking at classes/*.c struct _vtable temp_base_vtable {} by far
 > the most vtable methods are unused or uncovered by opcodes:

 Some more details (vtbc.pl is below):
 $ ./vtbc.pl |grep same | wc -l
      20
 $ ./vtbc.pl |grep bignum | wc -l
      25
 $ ./vtbc.pl |grep keyed | wc -l
     123

 $ ./vtbc.pl |grep -v keyed | grep -v same | grep -v bignum
  vtable coverage
  vtable.tbl has 265 entries
  core_ops.c has 94 entries + 5 internally used
 set_number
 substr
 cmp_num
 bitwise_shl_int
 bitwise_shr_int
 set_integer
 set_string
 concatenate_native
 cmp_string
 invoke_pmc
 modulus_float
 substr_str
 repeat_int
 subtype
 get_pmc
  166 unused

 - _same are intended as short cuts, when all data types are known. But
   IMHO to know what data types are involved, you have to test the PMC
   types - this is what the normal methods do anyway, so these methods
   are probably superfluous.
 - _keyed - by far the most group and IMHO will never be implemented due
   to the huge opcode count necessary to implement them.
 - _bignum will be needed
 - from above list: set_integer, set_number, set_string always use their
   _native variants so they are probably unneeded.
   Others might be missing or unneeded - who knows.

Comments still welome

No-one commented, did they? Did anything come of this?

Got Warnocked, I think. I'm partway through partitioning the vtable up to make overriding vtables on a per-PMC basis less expensive. I'm pretty sure that most of the keyed variants will end up being used, but we may end up pruning a bunch of these out.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to