Please sign in to comment.
Improve JIT fixup logic for inlined blocks
In the case where the original method called in the creator had a block set, we need to propagate this to the call frame when do an uncommon exit. This would cause a LocalJumpError in the following situation: class Foo def bar ary, obj ary.each do obj.quz a = yield end end end If quz was redefined, we have to do an uncommon exit from the obj.quz call. If the jitted method is Foo#bar, it was passed a block originally that was yielded inline in the JIT'ed code. We need to store it in the call frame we exit from. What needs to be done here is similar as in when we emit blocks in the JIT uncommon exit code, but in this case this wouldn't happen since the original block wasn't created inside the JIT. This means this fixup logic wouldn't handle this case and so the call frame fixup code needs to handle this. Also moves the uncommon exit fixup code into call frame because we had it in multiple places now and was becoming more code. Originally found because of spec failures in the Discourse spec suite: https://github.com/discourse/discourse
- Loading branch information...
Showing with 14 additions and 6 deletions.