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

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

Issue 10901002: Hook up the --minify option in dart2js and use it to get rid of unnecessary whitespace inside funct… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 typedef void Recompile(Element element); 5 typedef void Recompile(Element element);
6 6
7 // Gather the type information provided. If the types contains no 7 // Gather the type information provided. If the types contains no
8 // useful information there is no need to actually store them. 8 // useful information there is no need to actually store them.
9 List<HType> computeProvidedTypes(HInvoke node, HTypeMap types) { 9 List<HType> computeProvidedTypes(HInvoke node, HTypeMap types) {
10 bool allUnknown = true; 10 bool allUnknown = true;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 final HTypeMap types; 130 final HTypeMap types;
131 131
132 JavaScriptItemCompilationContext() : types = new HTypeMap(); 132 JavaScriptItemCompilationContext() : types = new HTypeMap();
133 } 133 }
134 134
135 class JavaScriptBackend extends Backend { 135 class JavaScriptBackend extends Backend {
136 SsaBuilderTask builder; 136 SsaBuilderTask builder;
137 SsaOptimizerTask optimizer; 137 SsaOptimizerTask optimizer;
138 SsaCodeGeneratorTask generator; 138 SsaCodeGeneratorTask generator;
139 CodeEmitterTask emitter; 139 CodeEmitterTask emitter;
140
140 final Map<Element, Map<Element, HType>> fieldInitializers; 141 final Map<Element, Map<Element, HType>> fieldInitializers;
141 final Map<Element, Map<Element, HType>> fieldConstructorSetters; 142 final Map<Element, Map<Element, HType>> fieldConstructorSetters;
142 final Map<Element, Map<Element, HType>> fieldSettersType; 143 final Map<Element, Map<Element, HType>> fieldSettersType;
143 144
144 final Map<Element, InvocationInfo> staticInvocationInfo; 145 final Map<Element, InvocationInfo> staticInvocationInfo;
145 final Map<SourceString, Map<Selector, InvocationInfo>> invocationInfo; 146 final Map<SourceString, Map<Selector, InvocationInfo>> invocationInfo;
146 final Map<Element, ReturnInfo> returnInfo; 147 final Map<Element, ReturnInfo> returnInfo;
147 148
148 final List<Element> invalidateAfterCodegen; 149 final List<Element> invalidateAfterCodegen;
149 final SelectorMap<List<HType>> selectorTypeMap; 150 final SelectorMap<List<HType>> selectorTypeMap;
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 HType optimisticReturnTypesWithRecompilationOnTypeChange( 486 HType optimisticReturnTypesWithRecompilationOnTypeChange(
486 FunctionElement caller, FunctionElement callee) { 487 FunctionElement caller, FunctionElement callee) {
487 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType()); 488 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType());
488 ReturnInfo info = returnInfo[callee]; 489 ReturnInfo info = returnInfo[callee];
489 if (info.returnType != HType.UNKNOWN && caller != null) { 490 if (info.returnType != HType.UNKNOWN && caller != null) {
490 info.addCompiledFunction(caller); 491 info.addCompiledFunction(caller);
491 } 492 }
492 return info.returnType; 493 return info.returnType;
493 } 494 }
494 } 495 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698