Drop an unused method for debugging

and add another useful one instead.
This commit is contained in:
Takashi Kokubun 2022-09-07 05:54:37 +09:00
parent a9c85c0c45
commit 87ef90909b
No known key found for this signature in database
GPG Key ID: 6FFC433B12EE23DD

View File

@ -104,13 +104,10 @@ if RubyVM::MJIT.enabled?
Primitive.cexpr! '(VALUE)NUM2PTR(value)' Primitive.cexpr! '(VALUE)NUM2PTR(value)'
end end
def debug(status) # Convert RubyVM::InstructionSequence to C.rb_iseq_t. Not used by the compiler, but useful for debugging.
_cc_entries_addr = status.compiled_iseq.jit_unit.cc_entries.instance_variable_get(:@addr) def rb_iseqw_to_iseq(iseqw)
Primitive.cstmt! %{ iseq_addr = Primitive.cexpr! 'PTR2NUM((VALUE)rb_iseqw_to_iseq(iseqw))'
const struct rb_callcache **cc_entries = (const struct rb_callcache **)NUM2PTR(_cc_entries_addr); rb_iseq_t.new(iseq_addr)
fprintf(stderr, "debug: %p\n", cc_entries[0]);
return Qnil;
}
end end
# TODO: remove this after migration # TODO: remove this after migration