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

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

Issue 834133002: dart2js OldEmitter: Small cleanups in output. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added check for using Function.apply. Created 5 years, 11 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 7
8 class OldEmitter implements Emitter { 8 class OldEmitter implements Emitter {
9 final Compiler compiler; 9 final Compiler compiler;
10 final CodeEmitterTask task; 10 final CodeEmitterTask task;
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 jsAst.Expression finishedClassesAccess = 1011 jsAst.Expression finishedClassesAccess =
1012 generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES); 1012 generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES);
1013 jsAst.Expression cyclicThrow = 1013 jsAst.Expression cyclicThrow =
1014 staticFunctionAccess(backend.getCyclicThrowHelper()); 1014 staticFunctionAccess(backend.getCyclicThrowHelper());
1015 jsAst.Expression laziesAccess = 1015 jsAst.Expression laziesAccess =
1016 generateEmbeddedGlobalAccess(embeddedNames.LAZIES); 1016 generateEmbeddedGlobalAccess(embeddedNames.LAZIES);
1017 1017
1018 jsAst.FunctionDeclaration decl = js.statement(''' 1018 jsAst.FunctionDeclaration decl = js.statement('''
1019 function init() { 1019 function init() {
1020 $isolateProperties = Object.create(null); 1020 $isolateProperties = Object.create(null);
1021 (function(){ 1021 #allClasses = Object.create(null);
1022 #allClasses = Object.create(null); 1022 #interceptorsByTag = Object.create(null);
1023 #interceptorsByTag = Object.create(null); 1023 #leafTags = Object.create(null);
1024 #leafTags = Object.create(null); 1024 #finishedClasses = Object.create(null);
1025 #finishedClasses = Object.create(null);
1026 })();
1027 1025
1028 if (#needsLazyInitializer) { 1026 if (#needsLazyInitializer) {
1029 $lazyInitializerName = function (prototype, staticName, fieldName, 1027 $lazyInitializerName = function (prototype, staticName, fieldName,
1030 getterName, lazyValue) { 1028 getterName, lazyValue) {
1031 if (!#lazies) #lazies = Object.create(null); 1029 if (!#lazies) #lazies = Object.create(null);
1032 #lazies[fieldName] = getterName; 1030 #lazies[fieldName] = getterName;
1033 1031
1034 var sentinelUndefined = {}; 1032 var sentinelUndefined = {};
1035 var sentinelInProgress = {}; 1033 var sentinelInProgress = {};
1036 prototype[fieldName] = sentinelUndefined; 1034 prototype[fieldName] = sentinelUndefined;
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2028 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2031 if (element.isInstanceMember) { 2029 if (element.isInstanceMember) {
2032 cachedClassBuilders.remove(element.enclosingClass); 2030 cachedClassBuilders.remove(element.enclosingClass);
2033 2031
2034 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2032 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2035 2033
2036 } 2034 }
2037 } 2035 }
2038 } 2036 }
2039 } 2037 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698