Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1181)

Side by Side Diff: pkg/dart2js_incremental/lib/caching_compiler.dart

Issue 1226733010: dart2js: Remove oldEmitter field in emitter-task. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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<Compiler> reuseCompiler( 9 Future<Compiler> reuseCompiler(
10 {DiagnosticHandler diagnosticHandler, 10 {DiagnosticHandler diagnosticHandler,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 outputProvider, 58 outputProvider,
59 diagnosticHandler, 59 diagnosticHandler,
60 libraryRoot, 60 libraryRoot,
61 packageRoot, 61 packageRoot,
62 options, 62 options,
63 environment, 63 environment,
64 null, 64 null,
65 null); 65 null);
66 JavaScriptBackend backend = compiler.backend; 66 JavaScriptBackend backend = compiler.backend;
67 67
68 OldEmitter emitter = backend.emitter.emitter;
69
68 // Much like a scout, an incremental compiler is always prepared. For 70 // Much like a scout, an incremental compiler is always prepared. For
69 // mixins, classes, and lazy statics, at least. 71 // mixins, classes, and lazy statics, at least.
70 backend.emitter.oldEmitter 72 emitter
71 ..needsClassSupport = true 73 ..needsClassSupport = true
72 ..needsMixinSupport = true 74 ..needsMixinSupport = true
73 ..needsLazyInitializer = true 75 ..needsLazyInitializer = true
74 ..needsStructuredMemberInfo = true; 76 ..needsStructuredMemberInfo = true;
75 77
76 Uri core = Uri.parse("dart:core"); 78 Uri core = Uri.parse("dart:core");
77 return compiler.libraryLoader.loadLibrary(core).then((_) { 79 return compiler.libraryLoader.loadLibrary(core).then((_) {
78 // Likewise, always be prepared for runtimeType support. 80 // Likewise, always be prepared for runtimeType support.
79 // TODO(johnniwinther): Add global switch to force RTI. 81 // TODO(johnniwinther): Add global switch to force RTI.
80 compiler.enabledRuntimeType = true; 82 compiler.enabledRuntimeType = true;
(...skipping 12 matching lines...) Expand all
93 ..provider = inputProvider 95 ..provider = inputProvider
94 ..handler = diagnosticHandler 96 ..handler = diagnosticHandler
95 ..enqueuer.resolution.queueIsClosed = false 97 ..enqueuer.resolution.queueIsClosed = false
96 ..enqueuer.resolution.hasEnqueuedReflectiveElements = false 98 ..enqueuer.resolution.hasEnqueuedReflectiveElements = false
97 ..enqueuer.resolution.hasEnqueuedReflectiveStaticFields = false 99 ..enqueuer.resolution.hasEnqueuedReflectiveStaticFields = false
98 ..enqueuer.codegen.queueIsClosed = false 100 ..enqueuer.codegen.queueIsClosed = false
99 ..enqueuer.codegen.hasEnqueuedReflectiveElements = false 101 ..enqueuer.codegen.hasEnqueuedReflectiveElements = false
100 ..enqueuer.codegen.hasEnqueuedReflectiveStaticFields = false 102 ..enqueuer.codegen.hasEnqueuedReflectiveStaticFields = false
101 ..compilationFailed = false; 103 ..compilationFailed = false;
102 JavaScriptBackend backend = compiler.backend; 104 JavaScriptBackend backend = compiler.backend;
105 OldEmitter emitter = backend.emitter.emitter;
103 106
104 // TODO(ahe): Seems this cache only serves to tell 107 // TODO(ahe): Seems this cache only serves to tell
105 // [OldEmitter.invalidateCaches] if it was invoked on a full compile (in 108 // [emitter.invalidateCaches] if it was invoked on a full compile (in
106 // which case nothing should be invalidated), or if it is an incremental 109 // which case nothing should be invalidated), or if it is an incremental
107 // compilation (in which case, holders/owners of newly compiled methods 110 // compilation (in which case, holders/owners of newly compiled methods
108 // must be invalidated). 111 // must be invalidated).
109 backend.emitter.oldEmitter.cachedElements.add(null); 112 emitter.cachedElements.add(null);
110 113
111 compiler.enqueuer.codegen 114 compiler.enqueuer.codegen
112 ..newlyEnqueuedElements.clear() 115 ..newlyEnqueuedElements.clear()
113 ..newlySeenSelectors.clear(); 116 ..newlySeenSelectors.clear();
114 117
115 backend.emitter.oldEmitter.nsmEmitter 118 emitter.nsmEmitter
116 ..trivialNsmHandlers.clear(); 119 ..trivialNsmHandlers.clear();
117 120
118 backend.emitter.typeTestRegistry 121 backend.emitter.typeTestRegistry
119 ..checkedClasses = null 122 ..checkedClasses = null
120 ..checkedFunctionTypes = null 123 ..checkedFunctionTypes = null
121 ..rtiNeededClasses.clear() 124 ..rtiNeededClasses.clear()
122 ..cachedClassesUsingTypeVariableTests = null; 125 ..cachedClassesUsingTypeVariableTests = null;
123 126
124 backend.emitter.oldEmitter.interceptorEmitter 127 emitter.interceptorEmitter
125 ..interceptorInvocationNames.clear(); 128 ..interceptorInvocationNames.clear();
126 129
127 backend.emitter.nativeEmitter 130 backend.emitter.nativeEmitter
128 ..hasNativeClasses = false 131 ..hasNativeClasses = false
129 ..nativeMethods.clear(); 132 ..nativeMethods.clear();
130 133
131 backend.emitter.readTypeVariables.clear(); 134 backend.emitter.readTypeVariables.clear();
132 135
133 backend.emitter.oldEmitter 136 emitter
134 ..outputBuffers.clear() 137 ..outputBuffers.clear()
135 ..classesCollector = null 138 ..classesCollector = null
136 ..mangledFieldNames.clear() 139 ..mangledFieldNames.clear()
137 ..mangledGlobalFieldNames.clear() 140 ..mangledGlobalFieldNames.clear()
138 ..recordedMangledNames.clear() 141 ..recordedMangledNames.clear()
139 ..clearCspPrecompiledNodes() 142 ..clearCspPrecompiledNodes()
140 ..elementDescriptors.clear(); 143 ..elementDescriptors.clear();
141 144
142 backend 145 backend
143 ..preMirrorsMethodCount = 0; 146 ..preMirrorsMethodCount = 0;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 final Map<String, String> output = new Map<String, String>(); 189 final Map<String, String> output = new Map<String, String>();
187 190
188 EventSink<String> call(String name, String extension) { 191 EventSink<String> call(String name, String extension) {
189 return new StringEventSink((String data) { 192 return new StringEventSink((String data) {
190 output['$name.$extension'] = data; 193 output['$name.$extension'] = data;
191 }); 194 });
192 } 195 }
193 196
194 String operator[] (String key) => output[key]; 197 String operator[] (String key) => output[key];
195 } 198 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/use_unused_api.dart ('k') | pkg/dart2js_incremental/lib/dart2js_incremental.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698