| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 * instantiated generic class. | 204 * instantiated generic class. |
| 205 */ | 205 */ |
| 206 void registerGenericClosure(Element closure, | 206 void registerGenericClosure(Element closure, |
| 207 Enqueuer enqueuer, | 207 Enqueuer enqueuer, |
| 208 TreeElements elements) {} | 208 TreeElements elements) {} |
| 209 /** | 209 /** |
| 210 * Call this to register that the [:runtimeType:] property has been accessed. | 210 * Call this to register that the [:runtimeType:] property has been accessed. |
| 211 */ | 211 */ |
| 212 void registerRuntimeType(Enqueuer enqueuer, TreeElements elements) {} | 212 void registerRuntimeType(Enqueuer enqueuer, TreeElements elements) {} |
| 213 | 213 |
| 214 /** |
| 215 * Call this method to enable [noSuchMethod] handling in the |
| 216 * backend. |
| 217 */ |
| 218 void enableNoSuchMethod(Enqueuer enqueuer) {} |
| 219 |
| 214 void registerRequiredType(DartType type, Element enclosingElement) {} | 220 void registerRequiredType(DartType type, Element enclosingElement) {} |
| 215 void registerClassUsingVariableExpression(ClassElement cls) {} | 221 void registerClassUsingVariableExpression(ClassElement cls) {} |
| 216 | 222 |
| 217 void registerConstSymbol(String name, TreeElements elements) {} | 223 void registerConstSymbol(String name, TreeElements elements) {} |
| 218 void registerNewSymbol(TreeElements elements) {} | 224 void registerNewSymbol(TreeElements elements) {} |
| 219 | 225 |
| 220 bool isNullImplementation(ClassElement cls) { | 226 bool isNullImplementation(ClassElement cls) { |
| 221 return cls == compiler.nullClass; | 227 return cls == compiler.nullClass; |
| 222 } | 228 } |
| 223 ClassElement get intImplementation => compiler.intClass; | 229 ClassElement get intImplementation => compiler.intClass; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 // Initialized when dart:mirrors is loaded. | 449 // Initialized when dart:mirrors is loaded. |
| 444 ClassElement deferredLibraryClass; | 450 ClassElement deferredLibraryClass; |
| 445 | 451 |
| 446 ClassElement jsInvocationMirrorClass; | 452 ClassElement jsInvocationMirrorClass; |
| 447 /// Document class from dart:mirrors. | 453 /// Document class from dart:mirrors. |
| 448 ClassElement documentClass; | 454 ClassElement documentClass; |
| 449 Element assertMethod; | 455 Element assertMethod; |
| 450 Element identicalFunction; | 456 Element identicalFunction; |
| 451 Element functionApplyMethod; | 457 Element functionApplyMethod; |
| 452 Element invokeOnMethod; | 458 Element invokeOnMethod; |
| 453 Element createInvocationMirrorElement; | |
| 454 | 459 |
| 455 Element get currentElement => _currentElement; | 460 Element get currentElement => _currentElement; |
| 456 | 461 |
| 457 /** | 462 /** |
| 458 * Perform an operation, [f], returning the return value from [f]. If an | 463 * Perform an operation, [f], returning the return value from [f]. If an |
| 459 * error occurs then report it as having occurred during compilation of | 464 * error occurs then report it as having occurred during compilation of |
| 460 * [element]. Can be nested. | 465 * [element]. Can be nested. |
| 461 */ | 466 */ |
| 462 withCurrentElement(Element element, f()) { | 467 withCurrentElement(Element element, f()) { |
| 463 Element old = currentElement; | 468 Element old = currentElement; |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 | 1034 |
| 1030 log('Compiling...'); | 1035 log('Compiling...'); |
| 1031 phase = PHASE_COMPILING; | 1036 phase = PHASE_COMPILING; |
| 1032 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. | 1037 // TODO(johnniwinther): Move these to [CodegenEnqueuer]. |
| 1033 if (hasIsolateSupport()) { | 1038 if (hasIsolateSupport()) { |
| 1034 enqueuer.codegen.addToWorkList( | 1039 enqueuer.codegen.addToWorkList( |
| 1035 isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE)); | 1040 isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE)); |
| 1036 enqueuer.codegen.registerGetOfStaticFunction(mainApp.find(MAIN)); | 1041 enqueuer.codegen.registerGetOfStaticFunction(mainApp.find(MAIN)); |
| 1037 } | 1042 } |
| 1038 if (enabledNoSuchMethod) { | 1043 if (enabledNoSuchMethod) { |
| 1039 enqueuer.codegen.registerInvocation(noSuchMethodSelector); | 1044 backend.enableNoSuchMethod(enqueuer.codegen); |
| 1040 enqueuer.codegen.addToWorkList(createInvocationMirrorElement); | |
| 1041 } | 1045 } |
| 1042 if (compileAll) { | 1046 if (compileAll) { |
| 1043 libraries.forEach((_, lib) => fullyEnqueueLibrary(lib, enqueuer.codegen)); | 1047 libraries.forEach((_, lib) => fullyEnqueueLibrary(lib, enqueuer.codegen)); |
| 1044 } | 1048 } |
| 1045 processQueue(enqueuer.codegen, main); | 1049 processQueue(enqueuer.codegen, main); |
| 1046 enqueuer.codegen.logSummary(log); | 1050 enqueuer.codegen.logSummary(log); |
| 1047 | 1051 |
| 1048 if (compilationFailed) return; | 1052 if (compilationFailed) return; |
| 1049 | 1053 |
| 1050 backend.assembleProgram(); | 1054 backend.assembleProgram(); |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1535 | 1539 |
| 1536 void close() {} | 1540 void close() {} |
| 1537 | 1541 |
| 1538 toString() => name; | 1542 toString() => name; |
| 1539 | 1543 |
| 1540 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1544 /// Convenience method for getting an [api.CompilerOutputProvider]. |
| 1541 static NullSink outputProvider(String name, String extension) { | 1545 static NullSink outputProvider(String name, String extension) { |
| 1542 return new NullSink('$name.$extension'); | 1546 return new NullSink('$name.$extension'); |
| 1543 } | 1547 } |
| 1544 } | 1548 } |
| OLD | NEW |