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

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

Issue 917033002: Redo "Steps towards making dart2js JS AST templates an indepentent library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « pkg/compiler/lib/src/js/template.dart ('k') | pkg/compiler/lib/src/use_unused_api.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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 if (compiler.hasIncrementalSupport && isMainFragment) { 861 if (compiler.hasIncrementalSupport && isMainFragment) {
862 constantOutput = cachedEmittedConstantsBuffer; 862 constantOutput = cachedEmittedConstantsBuffer;
863 } 863 }
864 for (Constant constant in constants) { 864 for (Constant constant in constants) {
865 ConstantValue constantValue = constant.value; 865 ConstantValue constantValue = constant.value;
866 if (compiler.hasIncrementalSupport && isMainFragment) { 866 if (compiler.hasIncrementalSupport && isMainFragment) {
867 if (cachedEmittedConstants.contains(constantValue)) continue; 867 if (cachedEmittedConstants.contains(constantValue)) continue;
868 cachedEmittedConstants.add(constantValue); 868 cachedEmittedConstants.add(constantValue);
869 } 869 }
870 jsAst.Expression init = buildConstantInitializer(constantValue); 870 jsAst.Expression init = buildConstantInitializer(constantValue);
871 constantOutput.addBuffer(jsAst.prettyPrint(init, compiler, 871 constantOutput.addBuffer(
872 monitor: compiler.dumpInfoTask)); 872 jsAst.prettyPrint(init, compiler, monitor: compiler.dumpInfoTask));
873 constantOutput.add('$N'); 873 constantOutput.add('$N');
874 } 874 }
875 if (compiler.hasIncrementalSupport && isMainFragment) { 875 if (compiler.hasIncrementalSupport && isMainFragment) {
876 output.addBuffer(constantOutput); 876 output.addBuffer(constantOutput);
877 } 877 }
878 } 878 }
879 879
880 jsAst.Expression buildConstantInitializer(ConstantValue constant) { 880 jsAst.Expression buildConstantInitializer(ConstantValue constant) {
881 String name = namer.constantName(constant); 881 String name = namer.constantName(constant);
882 return js('#.# = #', 882 return js('#.# = #',
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 1997 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
1998 if (element.isInstanceMember) { 1998 if (element.isInstanceMember) {
1999 cachedClassBuilders.remove(element.enclosingClass); 1999 cachedClassBuilders.remove(element.enclosingClass);
2000 2000
2001 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2001 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2002 2002
2003 } 2003 }
2004 } 2004 }
2005 } 2005 }
2006 } 2006 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js/template.dart ('k') | pkg/compiler/lib/src/use_unused_api.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698