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

Side by Side Diff: lib/compiler/implementation/compiler.dart

Issue 10875040: Support customizing API (and hence mock) compiler to minify the output. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 final bool REPORT_EXCESS_RESOLUTION = false; 10 final bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 int phase; 160 int phase;
161 161
162 bool compilationFailed = false; 162 bool compilationFailed = false;
163 163
164 bool hasCrashed = false; 164 bool hasCrashed = false;
165 165
166 Compiler([this.tracer = const Tracer(), 166 Compiler([this.tracer = const Tracer(),
167 this.enableTypeAssertions = false, 167 this.enableTypeAssertions = false,
168 this.enableUserAssertions = false, 168 this.enableUserAssertions = false,
169 bool emitJavascript = true, 169 bool emitJavascript = true,
170 generateSourceMap = true]) 170 bool generateSourceMap = true,
171 bool minify = false])
171 : libraries = new Map<String, LibraryElement>(), 172 : libraries = new Map<String, LibraryElement>(),
172 world = new World(), 173 world = new World(),
173 progress = new Stopwatch.start() { 174 progress = new Stopwatch.start() {
174 namer = new Namer(this); 175 namer = new Namer(this);
175 constantHandler = new ConstantHandler(this); 176 constantHandler = new ConstantHandler(this);
176 scanner = new ScannerTask(this); 177 scanner = new ScannerTask(this);
177 dietParser = new DietParserTask(this); 178 dietParser = new DietParserTask(this);
178 parser = new ParserTask(this); 179 parser = new ParserTask(this);
179 patchParser = new PatchParserTask(this); 180 patchParser = new PatchParserTask(this);
180 validator = new TreeValidatorTask(this); 181 validator = new TreeValidatorTask(this);
181 resolver = new ResolverTask(this); 182 resolver = new ResolverTask(this);
182 closureToClassMapper = new closureMapping.ClosureTask(this); 183 closureToClassMapper = new closureMapping.ClosureTask(this);
183 checker = new TypeCheckerTask(this); 184 checker = new TypeCheckerTask(this);
184 typesTask = new ti.TypesTask(this); 185 typesTask = new ti.TypesTask(this);
185 backend = emitJavascript ? 186 backend = emitJavascript ?
186 new js_backend.JavaScriptBackend(this, generateSourceMap) : 187 new js_backend.JavaScriptBackend(this, generateSourceMap) :
187 new dart_backend.DartBackend(this); 188 new dart_backend.DartBackend(this, minify);
188 enqueuer = new EnqueueTask(this); 189 enqueuer = new EnqueueTask(this);
189 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper, 190 tasks = [scanner, dietParser, parser, resolver, closureToClassMapper,
190 checker, typesTask, constantHandler, enqueuer]; 191 checker, typesTask, constantHandler, enqueuer];
191 tasks.addAll(backend.tasks); 192 tasks.addAll(backend.tasks);
192 } 193 }
193 194
194 Universe get resolverWorld => enqueuer.resolution.universe; 195 Universe get resolverWorld => enqueuer.resolution.universe;
195 Universe get codegenWorld => enqueuer.codegen.universe; 196 Universe get codegenWorld => enqueuer.codegen.universe;
196 197
197 int getNextFreeClassId() => nextFreeClassId++; 198 int getNextFreeClassId() => nextFreeClassId++;
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 final endOffset = end.charOffset + end.slowCharCount; 896 final endOffset = end.charOffset + end.slowCharCount;
896 897
897 // [begin] and [end] might be the same for the same empty token. This 898 // [begin] and [end] might be the same for the same empty token. This
898 // happens for instance when scanning '$$'. 899 // happens for instance when scanning '$$'.
899 assert(endOffset >= beginOffset); 900 assert(endOffset >= beginOffset);
900 return f(beginOffset, endOffset); 901 return f(beginOffset, endOffset);
901 } 902 }
902 903
903 String toString() => 'SourceSpan($uri, $begin, $end)'; 904 String toString() => 'SourceSpan($uri, $begin, $end)';
904 } 905 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698