| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_incremental; | 5 part of dart2js_incremental; |
| 6 | 6 |
| 7 /// Do not call this method directly. It will be made private. | 7 /// Do not call this method directly. It will be made private. |
| 8 // TODO(ahe): Make this method private. | 8 // TODO(ahe): Make this method private. |
| 9 Future<CompilerImpl> reuseCompiler( | 9 Future<CompilerImpl> reuseCompiler( |
| 10 {CompilerDiagnostics diagnosticHandler, | 10 {CompilerDiagnostics diagnosticHandler, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 if (outputProvider == null) { | 30 if (outputProvider == null) { |
| 31 outputProvider = const NullCompilerOutput(); | 31 outputProvider = const NullCompilerOutput(); |
| 32 } | 32 } |
| 33 if (environment == null) { | 33 if (environment == null) { |
| 34 environment = {}; | 34 environment = {}; |
| 35 } | 35 } |
| 36 CompilerImpl compiler = cachedCompiler; | 36 CompilerImpl compiler = cachedCompiler; |
| 37 if (compiler == null || | 37 if (compiler == null || |
| 38 compiler.libraryRoot != libraryRoot || | 38 compiler.libraryRoot != libraryRoot || |
| 39 !compiler.hasIncrementalSupport || | 39 !compiler.options.hasIncrementalSupport || |
| 40 compiler.hasCrashed || | 40 compiler.hasCrashed || |
| 41 compiler.enqueuer.resolution.hasEnqueuedReflectiveElements || | 41 compiler.enqueuer.resolution.hasEnqueuedReflectiveElements || |
| 42 compiler.deferredLoadTask.isProgramSplit) { | 42 compiler.deferredLoadTask.isProgramSplit) { |
| 43 if (compiler != null && compiler.hasIncrementalSupport) { | 43 if (compiler != null && compiler.options.hasIncrementalSupport) { |
| 44 print('***FLUSH***'); | 44 print('***FLUSH***'); |
| 45 if (compiler.hasCrashed) { | 45 if (compiler.hasCrashed) { |
| 46 print('Unable to reuse compiler due to crash.'); | 46 print('Unable to reuse compiler due to crash.'); |
| 47 } else if (compiler.enqueuer.resolution.hasEnqueuedReflectiveElements) { | 47 } else if (compiler.enqueuer.resolution.hasEnqueuedReflectiveElements) { |
| 48 print('Unable to reuse compiler due to dart:mirrors.'); | 48 print('Unable to reuse compiler due to dart:mirrors.'); |
| 49 } else if (compiler.deferredLoadTask.isProgramSplit) { | 49 } else if (compiler.deferredLoadTask.isProgramSplit) { |
| 50 print('Unable to reuse compiler due to deferred loading.'); | 50 print('Unable to reuse compiler due to deferred loading.'); |
| 51 } else { | 51 } else { |
| 52 print('Unable to reuse compiler.'); | 52 print('Unable to reuse compiler.'); |
| 53 } | 53 } |
| 54 } | 54 } |
| 55 oldTag.makeCurrent(); | 55 oldTag.makeCurrent(); |
| 56 compiler = new CompilerImpl( | 56 compiler = new CompilerImpl( |
| 57 inputProvider, | 57 inputProvider, |
| 58 outputProvider, | 58 outputProvider, |
| 59 diagnosticHandler, | 59 diagnosticHandler, |
| 60 libraryRoot, | 60 new CompilerOptions.parse( |
| 61 packageRoot, | 61 libraryRoot: libraryRoot, |
| 62 options, | 62 packageRoot: packageRoot, |
| 63 environment, | 63 options: options, |
| 64 null, | 64 environment: environment)); |
| 65 null); | |
| 66 JavaScriptBackend backend = compiler.backend; | 65 JavaScriptBackend backend = compiler.backend; |
| 67 | 66 |
| 68 full.Emitter emitter = backend.emitter.emitter; | 67 full.Emitter emitter = backend.emitter.emitter; |
| 69 | 68 |
| 70 // Much like a scout, an incremental compiler is always prepared. For | 69 // Much like a scout, an incremental compiler is always prepared. For |
| 71 // mixins, classes, and lazy statics, at least. | 70 // mixins, classes, and lazy statics, at least. |
| 72 emitter | 71 emitter |
| 73 ..needsClassSupport = true | 72 ..needsClassSupport = true |
| 74 ..needsMixinSupport = true | 73 ..needsMixinSupport = true |
| 75 ..needsLazyInitializer = true | 74 ..needsLazyInitializer = true |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 final Map<String, String> output = new Map<String, String>(); | 191 final Map<String, String> output = new Map<String, String>(); |
| 193 | 192 |
| 194 EventSink<String> createEventSink(String name, String extension) { | 193 EventSink<String> createEventSink(String name, String extension) { |
| 195 return new StringEventSink((String data) { | 194 return new StringEventSink((String data) { |
| 196 output['$name.$extension'] = data; | 195 output['$name.$extension'] = data; |
| 197 }); | 196 }); |
| 198 } | 197 } |
| 199 | 198 |
| 200 String operator[] (String key) => output[key]; | 199 String operator[] (String key) => output[key]; |
| 201 } | 200 } |
| OLD | NEW |