summaryrefslogtreecommitdiff
path: root/yjit/bindgen/src
diff options
context:
space:
mode:
authorRandy Stauner <[email protected]>2024-07-20 10:03:02 -0700
committerAlan Wu <[email protected]>2024-07-29 16:26:58 -0400
commitacbb8d4fb56ac3b5894991760a075dbef78d10e3 (patch)
treec09e88424f1a72646cfec44f5d1a8279340b7171 /yjit/bindgen/src
parent86a762ce56cd44db69ccff2e02587ed748a3ad04 (diff)
Expand opt_newarray_send to support Array#pack with buffer keyword arg
Use an enum for the method arg instead of needing to add an id that doesn't map to an actual method name. $ ruby --dump=insns -e 'b = "x"; [v].pack("E*", buffer: b)' before: ``` == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,34)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] b@0 0000 putchilledstring "x" ( 1)[Li] 0002 setlocal_WC_0 b@0 0004 putself 0005 opt_send_without_block <calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0007 newarray 1 0009 putchilledstring "E*" 0011 getlocal_WC_0 b@0 0013 opt_send_without_block <calldata!mid:pack, argc:2, kw:[#<Symbol:0x000000000023110c>], KWARG> 0015 leave ``` after: ``` == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,34)> local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 1] b@0 0000 putchilledstring "x" ( 1)[Li] 0002 setlocal_WC_0 b@0 0004 putself 0005 opt_send_without_block <calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE> 0007 putchilledstring "E*" 0009 getlocal b@0, 0 0012 opt_newarray_send 3, 5 0015 leave ```
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11249
Diffstat (limited to 'yjit/bindgen/src')
-rw-r--r--yjit/bindgen/src/main.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/yjit/bindgen/src/main.rs b/yjit/bindgen/src/main.rs
index 62c7ff2c79..f00ac3ac6c 100644
--- a/yjit/bindgen/src/main.rs
+++ b/yjit/bindgen/src/main.rs
@@ -300,6 +300,7 @@ fn main() {
.allowlist_type("ruby_tag_type")
.allowlist_type("ruby_vm_throw_flags")
.allowlist_type("vm_check_match_type")
+ .allowlist_type("vm_opt_newarray_send_type")
.allowlist_type("rb_iseq_type")
// From yjit.c