summaryrefslogtreecommitdiff
path: root/yjit/src/cruby.rs
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-05-23 11:23:26 -0700
committerAaron Patterson <[email protected]>2024-05-23 12:11:50 -0700
commit49fcd33e136ee2fe8720183b63a41bb6ef8d615c (patch)
treee089550455a8116beb379eb1e8b6f4e87652879b /yjit/src/cruby.rs
parente5e079e70f8b07697f7cc3f64736f993755500cb (diff)
Introduce a specialize instruction for Array#pack
Instructions for this code: ```ruby # frozen_string_literal: true [a].pack("C") ``` Before this commit: ``` == disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)> 0000 putself ( 3)[Li] 0001 opt_send_without_block <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 newarray 1 0005 putobject "C" 0007 opt_send_without_block <calldata!mid:pack, argc:1, ARGS_SIMPLE> 0009 leave ``` After this commit: ``` == disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)> 0000 putself ( 3)[Li] 0001 opt_send_without_block <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0003 putobject "C" 0005 opt_newarray_send 2, :pack 0008 leave ``` Co-authored-by: Maxime Chevalier-Boisvert <[email protected]> Co-authored-by: Aaron Patterson <[email protected]>
Diffstat (limited to 'yjit/src/cruby.rs')
-rw-r--r--yjit/src/cruby.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/yjit/src/cruby.rs b/yjit/src/cruby.rs
index 68c0304b06..53586cb4f4 100644
--- a/yjit/src/cruby.rs
+++ b/yjit/src/cruby.rs
@@ -802,6 +802,7 @@ pub(crate) mod ids {
name: min content: b"min"
name: max content: b"max"
name: hash content: b"hash"
+ name: pack content: b"pack"
name: respond_to_missing content: b"respond_to_missing?"
name: to_ary content: b"to_ary"
name: eq content: b"=="