Rework frame management, and backref/lastline along with it.

These changes should bring us more in line with the way other
implementations manage "frame" data and bindings that capture it.
It should also reduce the cost of framing, binding captures,
blocks and procs, and operations that manipulate blocks and procs
like define_method and instance_eval.

The new logic works as follows:

* Rather than a binding immediately duplicating a frame, it
  instead grabs a reference to it and marks it as captured.
* When popping a frame, if it has been marked captured it is
  discarded rather than being cleared. This moves the cost of
  creating a binding to the pop of the surrounding method, which
  reduces the cost of nested bindings re-cloning the frame many
  times.
* Bindings that are still active (have captured a frame that has
  not been popped) will update the method's frame data in-place.
* Once the frame has been popped, it will live only in that
  binding.

This commit passes mspec ci and test:mri19, but I am continuing
to test it for a while.

Note that this commit also moves backref and lastline to
the frame. They have always been frame-local, but for a long time
we kept them on the scope so we could avoid touching the frame for
methods that did not need it. However, because we used the scope,
it was difficult or impossible to isolate backref and lastline
changes to the block. Moving to the frame, which has a lifespan
only as long as the method that activated it, makes isolation
easier.

This should also make it easier to fix thread-safety issues with
backref/lastline, as reported in JRUBY-7167.
Force heap scope when named captures are present.

Named captures currently require that there be a heap scope
available, since that's how the match logic updates the local
variables that go with the capture names. Because backref no
longer requires a scope on its own, the method did not properly
use heap-based local variables in the presence of a named capture,
and as a result did not see the updated values.

My fix adds logic to ASTInspector that forces a heap scope when
there is a Match2CaptureNode present, indicating named captures.

Note: There's nothing about named captures that *must* have a
heap scope. We could update them in the calling code after the
call returns, one by one. This would be slower than updating them
as a group, as in the current logic, but it would not force us to
allocate the extra scope and force all local variables to the
heap.
isBindingFrame no longer used.
Remove unused frame-related fields and methods.
Avoid using $~ as an out parameter in Regexp search/match logic.

This fixes issues where threads would step on each others results
by updating $~ between the time the match was created deeper in
the stack and retrieved higher up. The result was that the match
logic would return another thread's MatchData.

My fix is to never read $~ in these methods and only ever write
it; this does not help the issue (across all impls) where $~ is
shared and not reliable across threads, but it should fix issues
where it was being used internally to pass MatchData to calls
higher in the stack.

Fixes JRUBY-7167 and JRUBY-7176.
Merge branch 'new_framing'