[ruby-core:66476] Re: [ruby-trunk - Feature #8543] rb_iseq_load

From: Eric Wong <normalperson@...>
Date: 2014-11-26 08:09:21 UTC
List: ruby-core #66476
nop; nop works, but I don't think it's an improvement (or regression).
I prefer to save 2 words entirely.

I planned to workaround the issue by doing ISeq#load twice:

   first = iseq.to_a       # useless jump|nop here
   junk = ISeq.load(first) # second pass optimization removes jump|nop
   a = ISeq.load(junk.to_a)
   b = ISeq.load(a.to_a)
   assert_equal a, b

But I encountered other bugs with to_a + load on test/ruby/test_io.rb
and test_settracefunc.rb which I have not investigated, yet...

Works-in-progress:

[PATCH 1/2] http://80x24.org/spew/m/iseq_calc_param_size%40r48578.txt
[PATCH 2/2] http://80x24.org/spew/m/rb_iseq_load_fix-v4%40r48578.txt

In This Thread