1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Add opt_regexpmatch2

This commit is contained in:
John Hawthorn 2021-06-18 17:32:13 -07:00 committed by Alan Wu
parent 595fdf8d66
commit 3edf29668e
2 changed files with 17 additions and 0 deletions

View file

@ -110,6 +110,16 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
def test_opt_regexpmatch2
assert_compiles(<<~RUBY, insns: %i[opt_regexpmatch2], result: 0)
def foo(str)
str =~ /foo/
end
foo("foobar")
RUBY
end
def test_compile_opt_getinlinecache
assert_compiles(<<~RUBY, insns: %i[opt_getinlinecache], result: 123, min_calls: 2)
def get_foo

View file

@ -2240,6 +2240,12 @@ gen_opt_length(jitstate_t *jit, ctx_t *ctx)
return gen_opt_send_without_block(jit, ctx);
}
static codegen_status_t
gen_opt_regexpmatch2(jitstate_t *jit, ctx_t *ctx)
{
return gen_opt_send_without_block(jit, ctx);
}
void
gen_branchif_branch(codeblock_t* cb, uint8_t* target0, uint8_t* target1, uint8_t shape)
{
@ -3718,6 +3724,7 @@ yjit_init_codegen(void)
yjit_reg_op(BIN(opt_not), gen_opt_not);
yjit_reg_op(BIN(opt_size), gen_opt_size);
yjit_reg_op(BIN(opt_length), gen_opt_length);
yjit_reg_op(BIN(opt_regexpmatch2), gen_opt_regexpmatch2);
yjit_reg_op(BIN(opt_getinlinecache), gen_opt_getinlinecache);
yjit_reg_op(BIN(opt_invokebuiltin_delegate), gen_opt_invokebuiltin_delegate);
yjit_reg_op(BIN(opt_invokebuiltin_delegate_leave), gen_opt_invokebuiltin_delegate);