[前][次][番号順一覧][スレッド一覧][生データ]

yarv-dev-en:233

From: SASADA Koichi <ko1 atdot.net>
Date: Sat, 04 Nov 2006 12:51:18 +0900
Subject: [yarv-dev-en:233] Re: yield bytecode?

Hi,

Charles Oliver Nutter wrote:
> I notice in the compiled/disassembled output there's "yield" handling
> returns. Is there a yield bytecode? Is the list of bytecodes out of
> date? What is the best place to look for an up-to-date list of bytecodes?

> # ----------------------------------------------------------------------
> # target program:
> # ----------------------------------------------------------------------
> def m
>   yield
> end
> 
> # ----------------------------------------------------------------------
> # disasm result:
> # ----------------------------------------------------------------------
> == disasm: <ISeq:<main>@../trunk/test.rb>===============================
> local scope table (size: 1, argc: 0)
> 
> 0000 putnil                                                           (   1)
> 0001 definemethod     :m, m, 0
> 0005 putnil
> 0006 leave
> == disasm: <ISeq:m@../trunk/test.rb>====================================
> local scope table (size: 1, argc: 0)
> 
> 0000 invokeblock      0, 0                                            (   2)
> 0003 leave
> # ----------------------------------------------------------------------

invokeblock is bytecode for "yield".


The newest bytecode reference is insns.def.
And you can make instruction table from insns.def with "make docs"
command.  Documents are generated in yarvsrc/doc/ directory.

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



--
ML: yarv-dev-en quickml.atdot.net
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧][生データ]

       231 2006-10-31 07:24 [charles.nutter sun.c] yield bytecode?                         
       232 2006-11-01 08:58 ┣[sswerling yahoo.com ]                                       
       234 2006-11-04 12:57 ┃┗[ko1 atdot.net       ]                                     
       236 2006-11-05 05:37 ┃ ┗[sswerling yahoo.com ]                                   
       238 2006-11-05 09:00 ┃  ┗[znmeb cesmail.net   ]                                 
->     233 2006-11-04 12:51 ┗[ko1 atdot.net       ]