ruby-changes:53384
From: mame <ko1@a...>
Date: Wed, 7 Nov 2018 17:13:26 +0900 (JST)
Subject: [ruby-changes:53384] mame:r65600 (trunk): Rename get/setinlinecache to opt_get/opt_setinlinecache
mame 2018-11-07 17:13:20 +0900 (Wed, 07 Nov 2018) New Revision: 65600 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65600 Log: Rename get/setinlinecache to opt_get/opt_setinlinecache The instructions are just for optimization. To clarity the intention, this change adds the prefix "opt_", like "opt_case_dispatch". Modified files: trunk/compile.c trunk/insns.def trunk/test/ruby/test_jit.rb Index: test/ruby/test_jit.rb =================================================================== --- test/ruby/test_jit.rb (revision 65599) +++ test/ruby/test_jit.rb (revision 65600) @@ -444,7 +444,7 @@ class TestJIT < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_jit.rb#L444 end def test_compile_insn_inlinecache - assert_compile_once('Struct', result_inspect: 'Struct', insns: %i[getinlinecache setinlinecache]) + assert_compile_once('Struct', result_inspect: 'Struct', insns: %i[opt_getinlinecache opt_setinlinecache]) end def test_compile_insn_once Index: insns.def =================================================================== --- insns.def (revision 65599) +++ insns.def (revision 65600) @@ -985,7 +985,7 @@ branchnil https://github.com/ruby/ruby/blob/trunk/insns.def#L985 /* push inline-cached value and go to dst if it is valid */ DEFINE_INSN -getinlinecache +opt_getinlinecache (OFFSET dst, IC ic) () (VALUE val) @@ -1001,7 +1001,7 @@ getinlinecache https://github.com/ruby/ruby/blob/trunk/insns.def#L1001 /* set inline cache */ DEFINE_INSN -setinlinecache +opt_setinlinecache (IC ic) (VALUE val) (VALUE val) Index: compile.c =================================================================== --- compile.c (revision 65599) +++ compile.c (revision 65600) @@ -6829,9 +6829,9 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/compile.c#L6829 LABEL *lend = NEW_LABEL(line); int ic_index = body->is_size++; - ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index)); + ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index)); ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_vid)); - ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index)); + ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index)); ADD_LABEL(ret, lend); } else { @@ -7187,7 +7187,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/compile.c#L7187 CHECK(compile_const_prefix(iseq, node, pref, body)); if (LIST_INSN_SIZE_ZERO(pref)) { if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) { - ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index)); + ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index)); } else { ADD_INSN(ret, line, putnil); @@ -7196,7 +7196,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/compile.c#L7196 ADD_SEQ(ret, body); if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) { - ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index)); + ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index)); ADD_LABEL(ret, lend); } } @@ -7224,7 +7224,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/compile.c#L7224 /* add cache insn */ if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) { - ADD_INSN2(ret, line, getinlinecache, lend, INT2FIX(ic_index)); + ADD_INSN2(ret, line, opt_getinlinecache, lend, INT2FIX(ic_index)); ADD_INSN(ret, line, pop); } @@ -7232,7 +7232,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK https://github.com/ruby/ruby/blob/trunk/compile.c#L7232 ADD_INSN1(ret, line, getconstant, ID2SYM(node->nd_mid)); if (ISEQ_COMPILE_DATA(iseq)->option->inline_const_cache) { - ADD_INSN1(ret, line, setinlinecache, INT2FIX(ic_index)); + ADD_INSN1(ret, line, opt_setinlinecache, INT2FIX(ic_index)); ADD_LABEL(ret, lend); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/