| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
| 9 * compiled. | 9 * compiled. |
| 10 */ | 10 */ |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 } | 1360 } |
| 1361 }).then((_) { | 1361 }).then((_) { |
| 1362 if (!compilationFailed) { | 1362 if (!compilationFailed) { |
| 1363 // TODO(johnniwinther): Reenable analysis of programs with load failures | 1363 // TODO(johnniwinther): Reenable analysis of programs with load failures |
| 1364 // when these are handled as erroneous libraries/compilation units. | 1364 // when these are handled as erroneous libraries/compilation units. |
| 1365 compileLoadedLibraries(); | 1365 compileLoadedLibraries(); |
| 1366 } | 1366 } |
| 1367 }); | 1367 }); |
| 1368 } | 1368 } |
| 1369 | 1369 |
| 1370 bool irEnabled() { |
| 1371 // TODO(sigurdm,kmillikin): Support checked-mode checks. |
| 1372 return const bool.fromEnvironment('USE_NEW_BACKEND') && |
| 1373 backend is DartBackend && |
| 1374 enableTypeAssertions && |
| 1375 enableConcreteTypeInference; |
| 1376 } |
| 1377 |
| 1370 void computeMain() { | 1378 void computeMain() { |
| 1371 if (mainApp == null) return; | 1379 if (mainApp == null) return; |
| 1372 | 1380 |
| 1373 Element main = mainApp.findExported(MAIN); | 1381 Element main = mainApp.findExported(MAIN); |
| 1374 ErroneousElement errorElement = null; | 1382 ErroneousElement errorElement = null; |
| 1375 if (main == null) { | 1383 if (main == null) { |
| 1376 if (analyzeOnly) { | 1384 if (analyzeOnly) { |
| 1377 if (!analyzeAll) { | 1385 if (!analyzeAll) { |
| 1378 errorElement = new ErroneousElementX( | 1386 errorElement = new ErroneousElementX( |
| 1379 MessageKind.CONSIDER_ANALYZE_ALL, {'main': MAIN}, MAIN, mainApp); | 1387 MessageKind.CONSIDER_ANALYZE_ALL, {'main': MAIN}, MAIN, mainApp); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 assert(mainFunction != null); | 1490 assert(mainFunction != null); |
| 1483 phase = PHASE_DONE_RESOLVING; | 1491 phase = PHASE_DONE_RESOLVING; |
| 1484 | 1492 |
| 1485 world.populate(); | 1493 world.populate(); |
| 1486 // Compute whole-program-knowledge that the backend needs. (This might | 1494 // Compute whole-program-knowledge that the backend needs. (This might |
| 1487 // require the information computed in [world.populate].) | 1495 // require the information computed in [world.populate].) |
| 1488 backend.onResolutionComplete(); | 1496 backend.onResolutionComplete(); |
| 1489 | 1497 |
| 1490 deferredLoadTask.onResolutionComplete(mainFunction); | 1498 deferredLoadTask.onResolutionComplete(mainFunction); |
| 1491 | 1499 |
| 1492 log('Building IR...'); | 1500 if (irEnabled()) { |
| 1493 irBuilder.buildNodes(); | 1501 log('Building IR...'); |
| 1502 irBuilder.buildNodes(); |
| 1503 } |
| 1494 | 1504 |
| 1495 log('Inferring types...'); | 1505 log('Inferring types...'); |
| 1496 typesTask.onResolutionComplete(mainFunction); | 1506 typesTask.onResolutionComplete(mainFunction); |
| 1497 | 1507 |
| 1498 if (stopAfterTypeInference) return; | 1508 if (stopAfterTypeInference) return; |
| 1499 | 1509 |
| 1500 log('Compiling...'); | 1510 log('Compiling...'); |
| 1501 phase = PHASE_COMPILING; | 1511 phase = PHASE_COMPILING; |
| 1502 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. | 1512 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. |
| 1503 if (hasIsolateSupport) { | 1513 if (hasIsolateSupport) { |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2175 int warnings = 0; | 2185 int warnings = 0; |
| 2176 int hints = 0; | 2186 int hints = 0; |
| 2177 } | 2187 } |
| 2178 | 2188 |
| 2179 class GenericTask extends CompilerTask { | 2189 class GenericTask extends CompilerTask { |
| 2180 final String name; | 2190 final String name; |
| 2181 | 2191 |
| 2182 GenericTask(this.name, Compiler compiler) | 2192 GenericTask(this.name, Compiler compiler) |
| 2183 : super(compiler); | 2193 : super(compiler); |
| 2184 } | 2194 } |
| OLD | NEW |