OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js.js_emitter.full_emitter; | 5 library dart2js.js_emitter.full_emitter; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'dart:collection' show HashMap; | 8 import 'dart:collection' show HashMap; |
9 | 9 |
10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; | 10 import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames; |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 /// Erases the precompiled information for csp mode for all output units. | 201 /// Erases the precompiled information for csp mode for all output units. |
202 /// Used by the incremental compiler. | 202 /// Used by the incremental compiler. |
203 void clearCspPrecompiledNodes() { | 203 void clearCspPrecompiledNodes() { |
204 _cspPrecompiledFunctions.clear(); | 204 _cspPrecompiledFunctions.clear(); |
205 _cspPrecompiledConstructorNames.clear(); | 205 _cspPrecompiledConstructorNames.clear(); |
206 } | 206 } |
207 | 207 |
208 @override | 208 @override |
| 209 String get patchVersion => "full"; |
| 210 |
| 211 @override |
209 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant) { | 212 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant) { |
210 if (constant.isFunction) return true; // Already emitted. | 213 if (constant.isFunction) return true; // Already emitted. |
211 if (constant.isPrimitive) return true; // Inlined. | 214 if (constant.isPrimitive) return true; // Inlined. |
212 if (constant.isDummy) return true; // Inlined. | 215 if (constant.isDummy) return true; // Inlined. |
213 // The name is null when the constant is already a JS constant. | 216 // The name is null when the constant is already a JS constant. |
214 // TODO(floitsch): every constant should be registered, so that we can | 217 // TODO(floitsch): every constant should be registered, so that we can |
215 // share the ones that take up too much space (like some strings). | 218 // share the ones that take up too much space (like some strings). |
216 if (namer.constantName(constant) == null) return true; | 219 if (namer.constantName(constant) == null) return true; |
217 return false; | 220 return false; |
218 } | 221 } |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2100 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
2098 if (element.isInstanceMember) { | 2101 if (element.isInstanceMember) { |
2099 cachedClassBuilders.remove(element.enclosingClass); | 2102 cachedClassBuilders.remove(element.enclosingClass); |
2100 | 2103 |
2101 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2104 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
2102 | 2105 |
2103 } | 2106 } |
2104 } | 2107 } |
2105 } | 2108 } |
2106 } | 2109 } |
OLD | NEW |