In Files

  • mjit_compiler.rb

Files

Class/Module Index [+]

Quicksearch

RubyVM::MJIT::C

Public Class Methods

ROBJECT_EMBED_LEN_MAX() click to toggle source
 
               # File mjit_compiler.rb, line 18
def ROBJECT_EMBED_LEN_MAX
  Primitive.cexpr! 'INT2NUM(RBIMPL_EMBED_LEN_MAX_OF(VALUE))'
end
            
builtin_compiler(f, bf, index, stack_size, builtin_inline_p) click to toggle source
 
               # File mjit_compiler.rb, line 26
def builtin_compiler(f, bf, index, stack_size, builtin_inline_p)
  Primitive.builtin_compile(f, bf.to_i, index, stack_size, builtin_inline_p)
end
            
cdhash_to_hash(cdhash_addr) click to toggle source
 
               # File mjit_compiler.rb, line 22
def cdhash_to_hash(cdhash_addr)
  Primitive.cdhash_to_hash(cdhash_addr)
end
            
fastpath_applied_iseq_p(ci, cc, iseq) click to toggle source
 
               # File mjit_compiler.rb, line 60
def fastpath_applied_iseq_p(ci, cc, iseq)
  _ci_addr = ci.to_i
  _cc_addr = cc.to_i
  _iseq_addr = iseq.to_i
  Primitive.cexpr! 'RBOOL(fastpath_applied_iseq_p((CALL_INFO)NUM2PTR(_ci_addr), (CALL_CACHE)NUM2PTR(_cc_addr), (rb_iseq_t *)NUM2PTR(_iseq_addr)))'
end
            
fprintf(f, str) click to toggle source

TODO: remove this after migration

 
               # File mjit_compiler.rb, line 120
def fprintf(f, str)
  Primitive.cstmt! %{
    fprintf((FILE *)NUM2PTR(f), "%s", RSTRING_PTR(str));
    return Qnil;
  }
end
            
has_cache_for_send(cc, insn) click to toggle source
 
               # File mjit_compiler.rb, line 30
def has_cache_for_send(cc, insn)
  Primitive.has_cache_for_send(cc.to_i, insn)
end
            
insn_may_depend_on_sp_or_pc(insn, opes) click to toggle source
 
               # File mjit_compiler.rb, line 103
def insn_may_depend_on_sp_or_pc(insn, opes)
  _opes_addr = opes.to_i
  Primitive.cexpr! 'RBOOL(insn_may_depend_on_sp_or_pc(NUM2INT(insn), (VALUE *)NUM2PTR(_opes_addr)))'
end
            
mjit_call_attribute_sp_inc(insn, operands) click to toggle source
 
               # File mjit_compiler.rb, line 72
def mjit_call_attribute_sp_inc(insn, operands)
  _operands_addr = operands.to_i
  Primitive.cexpr! 'LONG2NUM(mjit_call_attribute_sp_inc(NUM2INT(insn), (VALUE *)NUM2PTR(_operands_addr)))'
end
            
mjit_capture_cc_entries(compiled_body, captured_body) click to toggle source
 
               # File mjit_compiler.rb, line 77
def mjit_capture_cc_entries(compiled_body, captured_body)
  _compiled_body_addr = compiled_body.to_i
  _captured_body_addr = captured_body.to_i
  Primitive.cexpr! 'INT2NUM(mjit_capture_cc_entries((struct rb_iseq_constant_body *)NUM2PTR(_compiled_body_addr), (struct rb_iseq_constant_body *)NUM2PTR(_captured_body_addr)))'
end
            
mjit_capture_is_entries(body, is_entries) click to toggle source

const struct rb_iseq_constant_body *body, union iseq_inline_storage_entry *is_entries

 
               # File mjit_compiler.rb, line 84
def mjit_capture_is_entries(body, is_entries)
  _body_addr = body.to_i
  _is_entries_addr = is_entries.to_i
  Primitive.cstmt! %{
    mjit_capture_is_entries((struct rb_iseq_constant_body *)NUM2PTR(_body_addr), (union iseq_inline_storage_entry *)NUM2PTR(_is_entries_addr));
    return Qnil;
  }
end
            
mjit_opts() click to toggle source
 
               # File mjit_compiler.rb, line 67
def mjit_opts
  addr = Primitive.cexpr! 'PTR2NUM((VALUE)&mjit_opts)'
  mjit_options.new(addr)
end
            
rb_cFalseClass() click to toggle source
 
               # File mjit_compiler.rb, line 127
def rb_cFalseClass; Primitive.cexpr! 'PTR2NUM(rb_cFalseClass)' end
            
rb_cFloat() click to toggle source
 
               # File mjit_compiler.rb, line 132
def rb_cFloat;      Primitive.cexpr! 'PTR2NUM(rb_cFloat)'      end
            
rb_cInteger() click to toggle source
 
               # File mjit_compiler.rb, line 130
def rb_cInteger;    Primitive.cexpr! 'PTR2NUM(rb_cInteger)'    end
            
rb_cNilClass() click to toggle source
 
               # File mjit_compiler.rb, line 128
def rb_cNilClass;   Primitive.cexpr! 'PTR2NUM(rb_cNilClass)'   end
            
rb_cSymbol() click to toggle source
 
               # File mjit_compiler.rb, line 131
def rb_cSymbol;     Primitive.cexpr! 'PTR2NUM(rb_cSymbol)'     end
            
rb_cTrueClass() click to toggle source
 
               # File mjit_compiler.rb, line 129
def rb_cTrueClass;  Primitive.cexpr! 'PTR2NUM(rb_cTrueClass)'  end
            
rb_iseq_check(iseq) click to toggle source
 
               # File mjit_compiler.rb, line 34
def rb_iseq_check(iseq)
  _iseq_addr = iseq.to_i
  iseq_addr = Primitive.cexpr! 'PTR2NUM((VALUE)rb_iseq_check((rb_iseq_t *)NUM2PTR(_iseq_addr)))'
  rb_iseq_t.new(iseq_addr)
end
            
rb_iseq_path(iseq) click to toggle source
 
               # File mjit_compiler.rb, line 40
def rb_iseq_path(iseq)
  _iseq_addr = iseq.to_i
  Primitive.cexpr! 'rb_iseq_path((rb_iseq_t *)NUM2PTR(_iseq_addr))'
end
            
rb_iseqw_to_iseq(iseqw) click to toggle source

Convert RubyVM::InstructionSequence to C.rb_iseq_t. Not used by the compiler, but useful for debugging.

 
               # File mjit_compiler.rb, line 114
def rb_iseqw_to_iseq(iseqw)
  iseq_addr = Primitive.cexpr! 'PTR2NUM((VALUE)rb_iseqw_to_iseq(iseqw))'
  rb_iseq_t.new(iseq_addr)
end
            
rb_splat_or_kwargs_p(ci) click to toggle source
 
               # File mjit_compiler.rb, line 55
def rb_splat_or_kwargs_p(ci)
  _ci_addr = ci.to_i
  Primitive.cexpr! 'RBOOL(rb_splat_or_kwargs_p((CALL_INFO)NUM2PTR(_ci_addr)))'
end
            
rb_vm_insn_decode(encoded) click to toggle source

Convert encoded VM pointers to insn BINs.

 
               # File mjit_compiler.rb, line 94
def rb_vm_insn_decode(encoded)
  Primitive.cexpr! 'INT2NUM(rb_vm_insn_decode(NUM2PTR(encoded)))'
end
            
rb_vm_insn_encode(bin) click to toggle source

Convert insn BINs to encoded VM pointers. This one is not used by the compiler, but useful for debugging.

 
               # File mjit_compiler.rb, line 99
def rb_vm_insn_encode(bin)
  Primitive.cexpr! 'PTR2NUM((VALUE)rb_vm_get_insns_address_table()[NUM2INT(bin)])'
end
            
to_ruby(value) click to toggle source

Convert Integer VALUE to an actual Ruby object

 
               # File mjit_compiler.rb, line 109
def to_ruby(value)
  Primitive.cexpr! '(VALUE)NUM2PTR(value)'
end
            
vm_ci_argc(ci) click to toggle source
 
               # File mjit_compiler.rb, line 45
def vm_ci_argc(ci)
  _ci_addr = ci.to_i
  Primitive.cexpr! 'UINT2NUM(vm_ci_argc((CALL_INFO)NUM2PTR(_ci_addr)))'
end
            
vm_ci_flag(ci) click to toggle source
 
               # File mjit_compiler.rb, line 50
def vm_ci_flag(ci)
  _ci_addr = ci.to_i
  Primitive.cexpr! 'UINT2NUM(vm_ci_flag((CALL_INFO)NUM2PTR(_ci_addr)))'
end