diff options
author | Randy Stauner <[email protected]> | 2024-07-20 10:03:02 -0700 |
---|---|---|
committer | Alan Wu <[email protected]> | 2024-07-29 16:26:58 -0400 |
commit | acbb8d4fb56ac3b5894991760a075dbef78d10e3 () | |
tree | c09e88424f1a72646cfec44f5d1a8279340b7171 /yjit/src/cruby.rs | |
parent | 86a762ce56cd44db69ccff2e02587ed748a3ad04 (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: Merged: https://.com/ruby/ruby/pull/11249
-rw-r--r-- | yjit/src/cruby.rs | 4 |
1 files changed, 0 insertions, 4 deletions
@@ -799,10 +799,6 @@ pub(crate) mod ids { def_ids! { name: NULL content: b"" - 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"==" |