Thursday, 5 June 2014

Had a funsie with vtables. In the previous implementation, vtables were only initialized if the more derived type had a virtual pointer. This was always the case when needed before because if you had any virtual functions you had a virtual pointer. Of course, with RTTI and offset-to-top implemented, you need to override the base vtable even if you don't change the functions that are called.

Now constructors always call the vtable initialization routine, and then if the type doesn't have any vptrs, nothing happens.

Furthermore, I now have a run-time dependency on the C++ Standard Library, even for pure Wide code. I have cracked up typeid() and a couple tests for it. dynamic_cast should not be hard- the routine is a library routine, all I need to do is implement a small Expression wrapper on top.

So the ABI checklist now looks like this:

  • Dynamic_cast (easy)
  • Exception handling (oh shit...)
  • Change layout algorithm to be Itanium-compliant (shouldn't be too hard)
  • Fix Wide types to be exposable even if they inherit (really depends on Clang)
  • Fix some Wide types exposure like overload set, lambda (shouldn't be too hard)
  • Look into MS ABI support (dunno)
  • Implement abstract types (should be easy I hope)
  • Fix deleting destructors. Right now they only destroy and that's bad.

No comments:

Post a Comment