Feature #18875 https://bugs.ruby-lang.org/issues/18875 で、Ruby になにやら大きな変更が入ったようです。 チケットを読んでもどういうものなのかまだあまりわからず、気になったので調べつつメモします。
もっとも特徴的なのはこの部分です。
@@ -456,9 +460,12 @@ struct rb_iseq_constant_body {
} variable;
unsigned int local_table_size;| program : top_compstmt | |
| ; | |
| top_compstmt : top_stmts opt_terms | |
| ; | |
| top_stmts : none | |
| | top_stmt | |
| | top_stmts terms top_stmt | |
| ; |
Feature #18875 https://bugs.ruby-lang.org/issues/18875 で、Ruby になにやら大きな変更が入ったようです。 チケットを読んでもどういうものなのかまだあまりわからず、気になったので調べつつメモします。
もっとも特徴的なのはこの部分です。
@@ -456,9 +460,12 @@ struct rb_iseq_constant_body {
} variable;
unsigned int local_table_size;yjit についてメモ書き
めちゃ速い
$ for opt in '' '--jit' '--yjit'; do echo "opt": $opt; time ./miniruby $opt -e 'def fib(n); return n if n < 2; fib(n - 1) + fib(n-2); end; fib(35)'; done
opt:
| diff --git a/compile.c b/compile.c | |
| index 1cabb8cccd..9e3a1111dc 100644 | |
| --- a/compile.c | |
| +++ b/compile.c | |
| @@ -6562,7 +6562,7 @@ iseq_compile_array_deconstruct(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NO | |
| ADD_INSNL(ret, line, branchunless, match_failed); | |
| - ADD_SEND(ret, line, rb_intern("deconstruct"), INT2FIX(0)); | |
| + ADD_INSN(ret, line, deconstruct); |
| --------------------- | |
| [compile step 4.1 (iseq_set_sequence)] | |
| -- raw disasm-------- | |
| trace: 8 | |
| trace: 1 | |
| 0000 putobject false ( 1) | |
| 0002 setlocal_WC_0 4 ( 1) | |
| 0004 getlocal_WC_0 4 ( 1) | |
| 0006 branchunless <L002> ( 1) | |
| 0008 putnil ( 1) |
| diff --git a/parse.y b/parse.y | |
| index a6a9a4160b..4470f226a8 100644 | |
| --- a/parse.y | |
| +++ b/parse.y | |
| @@ -1004,7 +1004,7 @@ static void token_info_warn(struct parser_params *p, const char *token, token_in | |
| %type <node> words symbols symbol_list qwords qsymbols word_list qword_list qsym_list word | |
| %type <node> literal numeric simple_numeric ssym dsym symbol cpath | |
| %type <node> top_compstmt top_stmts top_stmt begin_block | |
| -%type <node> bodystmt compstmt stmts stmt_or_begin stmt expr arg primary command command_call method_call | |
| +%type <node> bodystmt compstmt stmts stmt_or_begin stmt expr arg primary1 primary2 primary command command_call method_call |
| $ cat bug13930.rb | |
| 1.times do | |
| begin | |
| next | |
| rescue | |
| p :unexpected_raise | |
| exit! | |
| ensure | |
| p :ensure | |
| raise |