{
// PInvokes depend on details of the core library, so for now only compile them if:
// 1) We're compiling the core library module, or
- // 2) We're compiling any module, and no marshalling is needed
- //
- // TODO Future: consider compiling PInvokes with complex marshalling in version bubble
- // mode when the core library is included in the bubble.
+ // 2) We're compiling any module, and no marshalling is needed, or
+ // 3) We're compiling any module, and core library module is in the same bubble, and marshaller supports compilation
Debug.Assert(method is EcmaMethod);
if (!_versionBubbleModuleSet.Contains(((EcmaMethod)method).Module))
return false;
- if (((EcmaMethod)method).Module.Equals(method.Context.SystemModule))
+ if (_versionBubbleModuleSet.Contains(method.Context.SystemModule))
return true;
return !Marshaller.IsMarshallingRequired(method);