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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 /// Erases the precompiled information for csp mode for all output units. | 199 /// Erases the precompiled information for csp mode for all output units. |
200 /// Used by the incremental compiler. | 200 /// Used by the incremental compiler. |
201 void clearCspPrecompiledNodes() { | 201 void clearCspPrecompiledNodes() { |
202 _cspPrecompiledFunctions.clear(); | 202 _cspPrecompiledFunctions.clear(); |
203 _cspPrecompiledConstructorNames.clear(); | 203 _cspPrecompiledConstructorNames.clear(); |
204 } | 204 } |
205 | 205 |
206 @override | 206 @override |
| 207 String get patchVersion => "full"; |
| 208 |
| 209 @override |
207 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant) { | 210 bool isConstantInlinedOrAlreadyEmitted(ConstantValue constant) { |
208 if (constant.isFunction) return true; // Already emitted. | 211 if (constant.isFunction) return true; // Already emitted. |
209 if (constant.isPrimitive) return true; // Inlined. | 212 if (constant.isPrimitive) return true; // Inlined. |
210 if (constant.isDummy) return true; // Inlined. | 213 if (constant.isDummy) return true; // Inlined. |
211 // The name is null when the constant is already a JS constant. | 214 // The name is null when the constant is already a JS constant. |
212 // TODO(floitsch): every constant should be registered, so that we can | 215 // TODO(floitsch): every constant should be registered, so that we can |
213 // share the ones that take up too much space (like some strings). | 216 // share the ones that take up too much space (like some strings). |
214 if (namer.constantName(constant) == null) return true; | 217 if (namer.constantName(constant) == null) return true; |
215 return false; | 218 return false; |
216 } | 219 } |
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2095 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2098 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
2096 if (element.isInstanceMember) { | 2099 if (element.isInstanceMember) { |
2097 cachedClassBuilders.remove(element.enclosingClass); | 2100 cachedClassBuilders.remove(element.enclosingClass); |
2098 | 2101 |
2099 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2102 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
2100 | 2103 |
2101 } | 2104 } |
2102 } | 2105 } |
2103 } | 2106 } |
2104 } | 2107 } |
OLD | NEW |