[ruby-cvs:72313] k0kubun:r65213 (trunk): vm_insnhelper.c: never cache getinstancevariable twice

k0kubun at ruby-lang.org k0kubun at ruby-lang.org
Sat Oct 20 16:43:50 JST 2018


k0kubun	2018-10-20 16:43:50 +0900 (Sat, 20 Oct 2018)

  New Revision: 65213

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

  Log:
    vm_insnhelper.c: never cache getinstancevariable twice
    
    We have several options to ensure there's no race condition between main
    thread and MJIT thead about IC reference:
    
    1) Give up caching ivar for multiple classes (or multiple versions of the
       same class) in the same getinstancevariable (This commit's approach)
    2) Allocate new inline cache every time
    
    Other ideas we could think of couldn't eliminate possibilities of race
    condition.
    In 2, it's memory allocation would be slow and it may trigger JIT
    cancellation frequently. So 1 would be fast for both VM and JIT
    situations.

  Modified files:
    trunk/tool/ruby_vm/views/_mjit_compile_ivar.erb
    trunk/vm.c
    trunk/vm_core.h
    trunk/vm_insnhelper.c


More information about the ruby-cvs mailing list