@@ -251,6 +251,8 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
251251
252252 IncrementalKernelTarget ? get kernelTargetForTesting => _lastGoodKernelTarget;
253253
254+ bool get skipExperimentalInvalidationChecksForTesting => false ;
255+
254256 /// Returns the [Package] used for the package [packageName] in the most
255257 /// recent compilation.
256258 Package ? getPackageForPackageName (String packageName) =>
@@ -1245,52 +1247,54 @@ class IncrementalCompiler implements IncrementalKernelGenerator {
12451247 // procedures, if the changed file is used as a mixin anywhere else
12461248 // we can't only recompile the changed file.
12471249 // TODO(jensj): Check for mixins in a smarter and faster way.
1248- for (LibraryBuilder builder in reusedResult.notReusedLibraries) {
1249- if (missingSources! .contains (builder.fileUri)) {
1250- continue ;
1251- }
1252- Library lib = builder.library;
1253- for (Class c in lib.classes) {
1254- if (! c.isAnonymousMixin && ! c.isEliminatedMixin) {
1250+ if (! skipExperimentalInvalidationChecksForTesting) {
1251+ for (LibraryBuilder builder in reusedResult.notReusedLibraries) {
1252+ if (missingSources! .contains (builder.fileUri)) {
12551253 continue ;
12561254 }
1257- for (Supertype supertype in c.implementedTypes) {
1258- if (missingSources.contains (supertype.classNode.fileUri)) {
1259- // This is probably a mixin from one of the libraries we want
1260- // to rebuild only the body of.
1261- // TODO(jensj): We can probably add this to the rebuildBodies
1262- // list and just rebuild that library too.
1263- // print("Usage of mixin in ${lib.importUri}");
1264- return null ;
1255+ Library lib = builder.library;
1256+ for (Class c in lib.classes) {
1257+ if (! c.isAnonymousMixin && ! c.isEliminatedMixin) {
1258+ continue ;
1259+ }
1260+ for (Supertype supertype in c.implementedTypes) {
1261+ if (missingSources.contains (supertype.classNode.fileUri)) {
1262+ // This is probably a mixin from one of the libraries we want
1263+ // to rebuild only the body of.
1264+ // TODO(jensj): We can probably add this to the rebuildBodies
1265+ // list and just rebuild that library too.
1266+ // print("Usage of mixin in ${lib.importUri}");
1267+ return null ;
1268+ }
12651269 }
12661270 }
12671271 }
1268- }
12691272
1270- // Special case FFI: Because the VM ffi transformation inlines
1271- // size and position, if the changed file contains ffi structs
1272- // we can't only recompile the changed file.
1273- // TODO(jensj): Come up with something smarter for this. E.g. we might
1274- // check if the FFI-classes are used in other libraries, or as actual nested
1275- // structures in other FFI-classes etc.
1276- // Alternatively (https://github.com/dart-lang/sdk/issues/45899) we might
1277- // do something else entirely that doesn't require special handling.
1278- if (_importsFfi ()) {
1279- for (LibraryBuilder builder in rebuildBodies! ) {
1280- Library lib = builder.library;
1281- for (LibraryDependency dependency in lib.dependencies) {
1282- Library importLibrary = dependency.targetLibrary;
1283- if (importLibrary.importUri == dartFfiUri) {
1284- // Explicitly imports dart:ffi.
1285- return null ;
1286- }
1287- for (Reference exportReference in importLibrary.additionalExports) {
1288- NamedNode ? export = exportReference.node;
1289- if (export is Class ) {
1290- Class c = export;
1291- if (c.enclosingLibrary.importUri == dartFfiUri) {
1292- // Implicitly imports a dart:ffi class.
1293- return null ;
1273+ // Special case FFI: Because the VM ffi transformation inlines
1274+ // size and position, if the changed file contains ffi structs
1275+ // we can't only recompile the changed file.
1276+ // TODO(jensj): Come up with something smarter for this. E.g. we might
1277+ // check if the FFI-classes are used in other libraries, or as actual
1278+ // nested structures in other FFI-classes etc.
1279+ // Alternatively (https://github.com/dart-lang/sdk/issues/45899) we might
1280+ // do something else entirely that doesn't require special handling.
1281+ if (_importsFfi ()) {
1282+ for (LibraryBuilder builder in rebuildBodies! ) {
1283+ Library lib = builder.library;
1284+ for (LibraryDependency dependency in lib.dependencies) {
1285+ Library importLibrary = dependency.targetLibrary;
1286+ if (importLibrary.importUri == dartFfiUri) {
1287+ // Explicitly imports dart:ffi.
1288+ return null ;
1289+ }
1290+ for (Reference exportReference in importLibrary.additionalExports) {
1291+ NamedNode ? export = exportReference.node;
1292+ if (export is Class ) {
1293+ Class c = export;
1294+ if (c.enclosingLibrary.importUri == dartFfiUri) {
1295+ // Implicitly imports a dart:ffi class.
1296+ return null ;
1297+ }
12941298 }
12951299 }
12961300 }
0 commit comments