From cc9330f8c0fac9952572a590cb70eb8e63921056 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 18 Mar 2023 22:13:40 -0700 Subject: RJIT: Reorder opt_case_dispatch branches --- rjit_c.rb | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'rjit_c.rb') diff --git a/rjit_c.rb b/rjit_c.rb index 17aa6754f0..a9b99d71e0 100644 --- a/rjit_c.rb +++ b/rjit_c.rb @@ -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) } -- cgit v1.2.1