[Yarv-devel] runtime block inlining
Alexander Kellett
ruby-lists at lypanov.net
Wed Oct 20 09:52:47 EDT 2004
On Wed, Oct 20, 2004 at 10:58:29PM +0900, SASADA Koichi wrote:
> *) dispatch(:mismatched_type, __CURRENT_AST_POSITION__) unless obj.is_a? Array
>
> :mismatched_type ?
one type of a code regeneration request, this simply means
that the type of obj has changed and the code should be
regenerated.
after dispatch has performed the needed code generation it
jumps back to the position in the code specified by ast_position
in this case that is the current location. dispatch is therefore
kind of like a longjmp.
> *) iterator = obj.iterator
>
> What's this?
> Java like Iterator class?
rather than typing out the entire implementation of the Array
iterator i just wrote some simple psuedo-code to show the main
flow of the program. its not meant to indicate the actual final
code generated sorry.
> *) dispatch(:return)
>
> What's this?
calling a method via dispatch :execute_function places
the __CURRENT_AST_POSITION__ on a stack. calling dispatch
:return would pop the stack therefore it would jump back
to the caller.
> *) __CURRENT_AST_POSITION__
>
> what's? it's represent block information?
an internal marker indicating the current location
in the parsed ruby code. used to provide dispatch
with the information needed to know where it needs
to jump back to. maybe more information needs to be
kept also, i'm not yet sure.
hope that covers most of it.
Alex
More information about the Yarv-devel
mailing list