зеркало из https://github.com/github/ruby.git
acbb8d4fb5
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 ``` |
||
---|---|---|
.. | ||
pending.rb | ||
runner.rb | ||
test_attr.rb | ||
test_autoload.rb | ||
test_block.rb | ||
test_class.rb | ||
test_constant_cache.rb | ||
test_env.rb | ||
test_eval.rb | ||
test_exception.rb | ||
test_fiber.rb | ||
test_finalizer.rb | ||
test_flip.rb | ||
test_flow.rb | ||
test_fork.rb | ||
test_gc.rb | ||
test_insns.rb | ||
test_io.rb | ||
test_jump.rb | ||
test_literal.rb | ||
test_literal_suffix.rb | ||
test_load.rb | ||
test_marshal.rb | ||
test_massign.rb | ||
test_method.rb | ||
test_objectspace.rb | ||
test_proc.rb | ||
test_ractor.rb | ||
test_rjit.rb | ||
test_string.rb | ||
test_struct.rb | ||
test_syntax.rb | ||
test_thread.rb | ||
test_yjit.rb | ||
test_yjit_30k_ifelse.rb | ||
test_yjit_30k_methods.rb | ||
test_yjit_rust_port.rb |