Fix unused variable warnings
builtin seems to be not handling this correctly.
This commit is contained in:
parent
3e4d1a1dd1
commit
bbed2269bc
20
mjit_c.rb
20
mjit_c.rb
@ -10,20 +10,20 @@ module RubyVM::MJIT
|
|||||||
end
|
end
|
||||||
|
|
||||||
def builtin_compiler(buf, bf_ptr, index, stack_size, builtin_inline_p)
|
def builtin_compiler(buf, bf_ptr, index, stack_size, builtin_inline_p)
|
||||||
bf_addr = bf_ptr.to_i
|
_bf_addr = bf_ptr.to_i
|
||||||
# Call "mjit_compile_invokebuiltin_for_#{func}" in mk_builtin_loader.rb
|
# Call "mjit_compile_invokebuiltin_for_#{func}" in mk_builtin_loader.rb
|
||||||
Primitive.cstmt! %{
|
Primitive.cstmt! %{
|
||||||
RB_BUILTIN bf = (RB_BUILTIN)NUM2PTR(bf_addr);
|
RB_BUILTIN bf = (RB_BUILTIN)NUM2PTR(_bf_addr);
|
||||||
bf->compiler(buf, NIL_P(index) ? -1 : NUM2LONG(index), NUM2UINT(stack_size), RTEST(builtin_inline_p));
|
bf->compiler(buf, NIL_P(index) ? -1 : NUM2LONG(index), NUM2UINT(stack_size), RTEST(builtin_inline_p));
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_cache_for_send(cc_ptr, insn)
|
def has_cache_for_send(cc_ptr, insn)
|
||||||
cc_addr = cc_ptr.to_i
|
_cc_addr = cc_ptr.to_i
|
||||||
Primitive.cstmt! %{
|
Primitive.cstmt! %{
|
||||||
extern bool rb_vm_opt_cfunc_p(CALL_CACHE cc, int insn);
|
extern bool rb_vm_opt_cfunc_p(CALL_CACHE cc, int insn);
|
||||||
CALL_CACHE cc = (CALL_CACHE)NUM2PTR(cc_addr);
|
CALL_CACHE cc = (CALL_CACHE)NUM2PTR(_cc_addr);
|
||||||
bool has_cache = vm_cc_cme(cc) != NULL &&
|
bool has_cache = vm_cc_cme(cc) != NULL &&
|
||||||
!(vm_cc_cme(cc)->def->type == VM_METHOD_TYPE_CFUNC && rb_vm_opt_cfunc_p(cc, NUM2INT(insn)));
|
!(vm_cc_cme(cc)->def->type == VM_METHOD_TYPE_CFUNC && rb_vm_opt_cfunc_p(cc, NUM2INT(insn)));
|
||||||
return RBOOL(has_cache);
|
return RBOOL(has_cache);
|
||||||
@ -73,14 +73,14 @@ module RubyVM::MJIT
|
|||||||
# Returns true if iseq can use fastpath for setup, otherwise NULL. This becomes true in the same condition
|
# Returns true if iseq can use fastpath for setup, otherwise NULL. This becomes true in the same condition
|
||||||
# as CC_SET_FASTPATH (in vm_callee_setup_arg) is called from vm_call_iseq_setup.
|
# as CC_SET_FASTPATH (in vm_callee_setup_arg) is called from vm_call_iseq_setup.
|
||||||
def fastpath_applied_iseq_p(ci_ptr, cc_ptr, iseq_ptr)
|
def fastpath_applied_iseq_p(ci_ptr, cc_ptr, iseq_ptr)
|
||||||
ci_addr = ci_ptr.to_i
|
_ci_addr = ci_ptr.to_i
|
||||||
cc_addr = cc_ptr.to_i
|
_cc_addr = cc_ptr.to_i
|
||||||
iseq_addr = iseq_ptr.to_i
|
_iseq_addr = iseq_ptr.to_i
|
||||||
Primitive.cstmt! %q{
|
Primitive.cstmt! %q{
|
||||||
extern bool rb_simple_iseq_p(const rb_iseq_t *iseq);
|
extern bool rb_simple_iseq_p(const rb_iseq_t *iseq);
|
||||||
CALL_INFO ci = (CALL_INFO)NUM2PTR(ci_addr);
|
CALL_INFO ci = (CALL_INFO)NUM2PTR(_ci_addr);
|
||||||
CALL_CACHE cc = (CALL_CACHE)NUM2PTR(cc_addr);
|
CALL_CACHE cc = (CALL_CACHE)NUM2PTR(_cc_addr);
|
||||||
const rb_iseq_t *iseq = (rb_iseq_t *)NUM2PTR(iseq_addr);
|
const rb_iseq_t *iseq = (rb_iseq_t *)NUM2PTR(_iseq_addr);
|
||||||
|
|
||||||
bool result = iseq != NULL
|
bool result = iseq != NULL
|
||||||
&& !(vm_ci_flag(ci) & VM_CALL_KW_SPLAT) && rb_simple_iseq_p(iseq) // Top of vm_callee_setup_arg. In this case, opt_pc is 0.
|
&& !(vm_ci_flag(ci) & VM_CALL_KW_SPLAT) && rb_simple_iseq_p(iseq) // Top of vm_callee_setup_arg. In this case, opt_pc is 0.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user