Since serialization will only receive a NativeModule, which is Isolate-independent, it should not rely on any information currently stored in the Isolate.
This basically means that WasmSerializer::isolate_ needs to disappear.
AFAICT it only takes the Isolate argument to get to a ExternalReferenceTable. The code that is being serialized should only contain external references that are Isolate-independent themselves. Unfortunately we don't have a reliable way to tell whether an external reference is independent of the Isolate or not. The only indication is where the factory function on ExternalReference takes the Isolate or not (i.e. see the EXTERNAL_REFERENCE_LIST_WITH_ISOLATE versus EXTERNAL_REFERENCE_LIST lists).
Comment 1 by mstarzinger@chromium.org
, Dec 5