[Yarv-devel] runtime block inlining

SASADA Koichi ko1 at atdot.net
Wed Oct 20 06:05:37 EDT 2004


  Alexander Kellett <ruby-lists at lypanov.net> wrote :
    [ Re: [Yarv-devel] runtime block inlining ]
    at Wed, 20 Oct 2004 11:24:13 +0200

> i'd mean, you have two pieces of code:
>    Array#each
> and
>    array.each { |e| ... }
> 
> you could inline the generated code for the block
> into the the generated code for Array#each (assuming 
> thats its only a small amount of code of course)

How to know reciever object is "Array" instance?
IMO, this is only and most difficult (impossible?) problem.


> what sort of progress have you made with the jit
> backend? any nice ideas for this?, i guess that this
> is required to do really fast inlines in any case...

I will simple replace Insns sequence to native codes sequence.
It's poor but easy. (some problems are there: relocations, ...)


>> It's seems good for some popular iterator (in popular container class).
> 
> would this be dynamic enough for redefinition of the
> iterators at runtime to not cause problems?

see my example :)

> 	switch(CLASS_OF(recv)){
> 	  RUBY_ARRAY:
>             if( Array#each is not redefined ){
>               ... (inlined code);
>             }
>             else{
>               goto default;
>             }
> 	    break;


Regards,
-- 
// SASADA Koichi at atdot dot net
//


More information about the Yarv-devel mailing list