On Wed, Dec 18, 2013 at 12:20 AM, awong-dev <notifications@github.com>wrote:

> In sources/cxx-stl/llvm-libc++abi/libcxxabi/src/Unwind/Unwind-arm.cpp:
>
> > @@ -252,6 +252,7 @@ _Unwind_Reason_Code unwindOneFrame(
> >              }
> >              case 0xb3:
> >                // TODO(piman): pop VFP single precision from FSTMFDX.
> > +              // (Only in phase 2, see 4.7 on lazy saving of these)
>
> @pimanttr <https://github.com/pimanttr>: I was thinking through this and
> have been wondering whether it would just be safer and more efficient to
> always snapshot the VFP.
>
> The alternative is we have to store some sort of dirty bit in
> Registers_arm and then understand how to conditional restore registers in
> libunwind::Registers_arm::jumpto in Unwind/UnwindRegistersRestore.S.
> Totally doable, but unsure whether it's worth the complexity?
>

The reasoning in section 4.7 is that since every sub-architecture has a
different set of registers, then we'd need some detection code to know
which registers we can snapshot. But the unwind logic essentially encodes
which registers are used, and the assumption is that if they're used by the
code, they're valid to save/restore.
Either way, we need some bits in UnwindRegistersRestore.S to know whether
we should restore them (be it because we may have snapshot them or not, or
because they're available on the sub-arch or not).

> —
> Reply to this email directly or view it on GitHub<https://github.com/awong-dev/ndk/pull/41/files#r8429045>
> .
>