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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart

Issue 1229923005: dart2js: support tear-offs in the startup emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix bad assert. Created 5 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/code_emitter_task.dart ('k') | pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698