When upgrading to SpiderMonkey 45, I forgot to update ObjectToIDMap, which is based on upstream's js/ipc/JavaScriptShared files.
This change is the equivalent of upstream's commit: https://hg.mozilla.org/mozilla-central/rev/fa3bffbe3ec8
As of now, I kept the patch minimal and I preserved the call to JS_AddExtraGCRootsTracer. I believe it would be equivalent to keep the Table inside a JS::PermanentRooted. We could even get rid of this whole class and just make a typedef.
However, the current patch doesn't work. This does not build on MSVC and it segfaults on GCC.
As far as I understand, this is because the implementation of MovableCellHasher<JS::Heap<T>> is broken. In js/public/RootingAPI.h, we can read
template <typename T> struct JS_PUBLIC_API(MovableCellHasher<JS::Heap<T>>) { using Key = JS::Heap<T>; using Lookup = T; [...] static void rekey(Key& k, const Key& newKey) { k.unsafeSet(newKey); } };
However, JS::Heap<T> does not have a unsafeSet method.
Right now, this bug prevents me from testing SM52. I would prefer to figure it out under SM45 in order to make the upgrade less painful.