diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-18 22:13:40 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-03-18 22:32:27 -0700 |
commit | cc9330f8c0fac9952572a590cb70eb8e63921056 (patch) | |
tree | c3592f90b5979a3007cb9058b7815713382ed358 /rjit_c.rb | |
parent | d07d1c71622ad8fca1d8f88c865efcdd93c4e894 (diff) | |
download | ruby-cc9330f8c0fac9952572a590cb70eb8e63921056.tar.gz |
RJIT: Reorder opt_case_dispatch branches
Diffstat (limited to 'rjit_c.rb')
-rw-r--r-- | rjit_c.rb | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -2,6 +2,9 @@ # Part of this file is generated by tool/rjit/bindgen.rb. # Run `make rjit-bindgen` to update code between "RJIT bindgen begin" and "RJIT bindgen end". module RubyVM::RJIT # :nodoc: all + # + # Main: Used by RJIT + # # This `class << C` section is for calling C functions with Primitive. # For importing variables or macros, use tool/rjit/bindgen.rb instead. class << C = Module.new @@ -292,10 +295,23 @@ module RubyVM::RJIT # :nodoc: all C.VALUE.new(lep_addr) end - # - # Utilities: Not used by RJIT, but useful for debugging - # + def rb_hash_keys(hash) + Primitive.cexpr! 'rb_hash_keys(hash)' + end + + def rb_hash_stlike_lookup(hash, key) + Primitive.cstmt! %{ + VALUE result = Qnil; + rb_hash_stlike_lookup(hash, key, &result); + return result; + } + end + end + # + # Utilities: Not used by RJIT, but useful for debugging + # + class << C # Convert insn BINs to encoded VM pointers. def rb_vm_insn_encode(bin) Primitive.cexpr! 'SIZET2NUM((VALUE)rb_vm_get_insns_address_table()[NUM2INT(bin)])' @@ -316,6 +332,7 @@ module RubyVM::RJIT # :nodoc: all C::BOP_AND = Primitive.cexpr! %q{ SIZET2NUM(BOP_AND) } C::BOP_AREF = Primitive.cexpr! %q{ SIZET2NUM(BOP_AREF) } C::BOP_EQ = Primitive.cexpr! %q{ SIZET2NUM(BOP_EQ) } + C::BOP_EQQ = Primitive.cexpr! %q{ SIZET2NUM(BOP_EQQ) } C::BOP_FREEZE = Primitive.cexpr! %q{ SIZET2NUM(BOP_FREEZE) } C::BOP_GE = Primitive.cexpr! %q{ SIZET2NUM(BOP_GE) } C::BOP_GT = Primitive.cexpr! %q{ SIZET2NUM(BOP_GT) } |