From 49fcd33e136ee2fe8720183b63a41bb6ef8d615c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 23 May 2024 11:23:26 -0700 Subject: Introduce a specialize instruction for Array#pack Instructions for this code: ```ruby # frozen_string_literal: true [a].pack("C") ``` Before this commit: ``` == disasm: #@test.rb:1 (1,0)-(3,13)> 0000 putself ( 3)[Li] 0001 opt_send_without_block 0003 newarray 1 0005 putobject "C" 0007 opt_send_without_block 0009 leave ``` After this commit: ``` == disasm: #@test.rb:1 (1,0)-(3,13)> 0000 putself ( 3)[Li] 0001 opt_send_without_block 0003 putobject "C" 0005 opt_newarray_send 2, :pack 0008 leave ``` Co-authored-by: Maxime Chevalier-Boisvert Co-authored-by: Aaron Patterson --- tool/rjit/bindgen.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'tool') diff --git a/tool/rjit/bindgen.rb b/tool/rjit/bindgen.rb index fb6653ed9c..2fc4576216 100755 --- a/tool/rjit/bindgen.rb +++ b/tool/rjit/bindgen.rb @@ -540,6 +540,7 @@ generator = BindingGenerator.new( rb_vm_opt_newarray_min rb_vm_opt_newarray_max rb_vm_opt_newarray_hash + rb_vm_opt_newarray_pack rb_vm_setinstancevariable rb_vm_splat_array rjit_full_cfunc_return -- cgit v1.2.3