Skip to content
Commits on Nov 30, 2010
  1. @emk @dbussink

    Inliner::inline_ffi: Add missing break statements to switch

    emk committed with dbussink
    When passing doubles to FFI functions, the VM was generating spurious
    calls to rbx_ffi_to_int64 follwing the expected calls to
    rbx_ffi_to_double.  These calls to rbx_ffi_to_int64 failed, triggering
    calls to rbx_continue_uncommon and thus eventual deoptimization.
    
    To reproduce the original problem, run:
    
      bin/rbx -Xjit.uncommon.print -Xjit.dump_code=7 \
        benchmark/yarv/bm_app_mandelbrot.rb
    
    You will see many blocks of the form:
    
      [[[ Deoptimizing uncommon method ]]]
      0xbfb9c87c: Math.hypot in kernel/common/math.rb:155 (+21 inline)
      0xbfb9c8d4: Complex#abs in lib/complex.rb:282 (+0 inline)
      0xbfb9c9b8: Object#mandelbrot? in /home/emk/local/rubinius/benchmark/yarv/bm_app_mandelbrot.rb:4 (+0 jit)
    
    Once this patch is applied, no deoptimizations should occur.
    
    Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Something went wrong with that request. Please try again.