Chromium Code Reviews| Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart |
| diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart |
| index 671b02a5ff90feac2055f8dc4d618b835f0a239f..41b1d22bfdc55e7573b8613b96f040c74d5a5f43 100644 |
| --- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart |
| +++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart |
| @@ -254,14 +254,14 @@ abstract class Compiler implements DiagnosticListener { |
| final bool enableUserAssertions; |
| final bool trustTypeAnnotations; |
| final bool enableConcreteTypeInference; |
| - final bool disableTypeInference; |
| + final bool disableTypeInferenceFlag; |
| /** |
| * The maximum size of a concrete type before it widens to dynamic during |
| * concrete type inference. |
| */ |
| final int maxConcreteTypeSize; |
| - final bool analyzeAll; |
| + final bool analyzeAllFlag; |
| final bool analyzeOnly; |
| /** |
| * If true, skip analysis of method bodies and field initializers. Implies |
| @@ -457,14 +457,14 @@ abstract class Compiler implements DiagnosticListener { |
| this.enableUserAssertions: false, |
| this.trustTypeAnnotations: false, |
| this.enableConcreteTypeInference: false, |
| - this.disableTypeInference: false, |
| + this.disableTypeInferenceFlag: false, |
| this.maxConcreteTypeSize: 5, |
| this.enableMinification: false, |
| this.enableNativeLiveTypeAnalysis: false, |
| bool emitJavaScript: true, |
| bool generateSourceMap: true, |
| bool disallowUnsafeEval: false, |
| - this.analyzeAll: false, |
| + this.analyzeAllFlag: false, |
| bool analyzeOnly: false, |
| bool analyzeSignaturesOnly: false, |
| this.rejectDeprecatedFeatures: false, |
| @@ -525,6 +525,12 @@ abstract class Compiler implements DiagnosticListener { |
| bool get mirrorsEnabled => mirrorSystemClass != null; |
| + bool get analyzeAll => analyzeAllFlag || compileAll; |
| + |
| + bool get compileAll => mirrorsEnabled; |
| + |
| + bool get disableTypeInference => disableTypeInferenceFlag || mirrorsEnabled; |
| + |
| int getNextFreeClassId() => nextFreeClassId++; |
| void ensure(bool condition) { |
| @@ -836,7 +842,8 @@ abstract class Compiler implements DiagnosticListener { |
| log('Resolving...'); |
| phase = PHASE_RESOLVING; |
| if (analyzeAll) { |
| - libraries.forEach((_, lib) => fullyEnqueueLibrary(lib)); |
| + libraries.forEach( |
| + (_, lib) => fullyEnqueueLibrary(lib, enqueuer.resolution)); |
| } |
| // Elements required by enqueueHelpers are global dependencies |
| // that are not pulled in by a particular element. |
| @@ -874,6 +881,9 @@ abstract class Compiler implements DiagnosticListener { |
| enqueuer.codegen.registerInvocation(NO_SUCH_METHOD, noSuchMethodSelector); |
| enqueuer.codegen.addToWorkList(createInvocationMirrorElement); |
| } |
| + if (compileAll) { |
| + libraries.forEach((_, lib) => fullyEnqueueLibrary(lib, enqueuer.codegen)); |
| + } |
| processQueue(enqueuer.codegen, main); |
| enqueuer.codegen.logSummary(log); |
| @@ -895,19 +905,24 @@ abstract class Compiler implements DiagnosticListener { |
| } |
| } |
| - void fullyEnqueueLibrary(LibraryElement library) { |
| - library.implementation.forEachLocalMember(fullyEnqueueTopLevelElement); |
| + void fullyEnqueueLibrary(LibraryElement library, Enqueuer world) { |
| + // The JS backend gets confused when it tries to compile code for |
| + // interceptor classes. |
|
ngeoffray
2013/06/10 19:21:00
But it is compiling methods for interceptor classe
ahe
2013/06/11 14:24:45
I've sent you some additional details in a mail.
|
| + if (!world.isResolutionQueue && library.isInternalLibrary) return; |
| + void enqueueAll(Element element) { |
| + fullyEnqueueTopLevelElement(element, world); |
| + } |
| + library.implementation.forEachLocalMember(enqueueAll); |
| } |
| - void fullyEnqueueTopLevelElement(Element element) { |
| + void fullyEnqueueTopLevelElement(Element element, Enqueuer world) { |
| if (element.isClass()) { |
| ClassElement cls = element; |
| cls.ensureResolved(this); |
| - cls.forEachLocalMember(enqueuer.resolution.addToWorkList); |
| - enqueuer.resolution.registerInstantiatedClass( |
| - element, globalDependencies); |
| + cls.forEachLocalMember(world.addToWorkList); |
| + world.registerInstantiatedClass(element, globalDependencies); |
| } else { |
| - enqueuer.resolution.addToWorkList(element); |
| + world.addToWorkList(element); |
| } |
| } |