[ruby-cvs:68840] ko1:r61659 (trunk): Speedup `block.call` [Feature #14330]

ko1 at ruby-lang.org ko1 at ruby-lang.org
Mon Jan 8 04:18:49 JST 2018


ko1	2018-01-08 04:18:49 +0900 (Mon, 08 Jan 2018)

  New Revision: 61659

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61659

  Log:
    Speedup `block.call` [Feature #14330]
    
    * insns.def (getblockparamproxy): introduce new instruction to return
      the `rb_block_param_proxy` object if possible. This object responds
      to `call` method and invoke given block (completely similar to `yield`).
    
    * method.h (OPTIMIZED_METHOD_TYPE_BLOCK_CALL): add new optimized call type
      which is for `rb_block_param_proxy.cal`.
    
    * vm_insnhelper.c (vm_call_method_each_type): ditto.
    
    * vm_insnhelper.c (vm_call_opt_block_call): ditto.
    
    * vm_core.h (BOP_CALL, PROC_REDEFINED_OP_FLAG): add check for `Proc#call`
      redefinition.
    
    * compile.c (iseq_compile_each0): compile to use new insn
      `getblockparamproxy` for method call.

  Modified files:
    trunk/compile.c
    trunk/insns.def
    trunk/method.h
    trunk/proc.c
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_insnhelper.c


More information about the ruby-cvs mailing list