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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_emitter/code_emitter_task.dart

Issue 574683002: Use ConstExp for storing constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove ConstExpBuilder. Created 6 years, 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter"); 7 const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter");
8 8
9 /** 9 /**
10 * Generates the code for all used classes in the program. Static fields (even 10 * Generates the code for all used classes in the program. Static fields (even
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 void emitStaticNonFinalFieldInitializations(CodeBuffer buffer) { 928 void emitStaticNonFinalFieldInitializations(CodeBuffer buffer) {
929 JavaScriptConstantCompiler handler = backend.constants; 929 JavaScriptConstantCompiler handler = backend.constants;
930 Iterable<VariableElement> staticNonFinalFields = 930 Iterable<VariableElement> staticNonFinalFields =
931 handler.getStaticNonFinalFieldsForEmission(); 931 handler.getStaticNonFinalFieldsForEmission();
932 for (Element element in Elements.sortedByPosition(staticNonFinalFields)) { 932 for (Element element in Elements.sortedByPosition(staticNonFinalFields)) {
933 // [:interceptedNames:] is handled in [emitInterceptedNames]. 933 // [:interceptedNames:] is handled in [emitInterceptedNames].
934 if (element == backend.interceptedNames) continue; 934 if (element == backend.interceptedNames) continue;
935 // `mapTypeToInterceptor` is handled in [emitMapTypeToInterceptor]. 935 // `mapTypeToInterceptor` is handled in [emitMapTypeToInterceptor].
936 if (element == backend.mapTypeToInterceptor) continue; 936 if (element == backend.mapTypeToInterceptor) continue;
937 compiler.withCurrentElement(element, () { 937 compiler.withCurrentElement(element, () {
938 Constant initialValue = handler.getInitialValueFor(element); 938 Constant initialValue = handler.getInitialValueFor(element).value;
939 jsAst.Expression init = 939 jsAst.Expression init =
940 js('$isolateProperties.# = #', 940 js('$isolateProperties.# = #',
941 [namer.getNameOfGlobalField(element), 941 [namer.getNameOfGlobalField(element),
942 constantEmitter.referenceInInitializationContext(initialValue)]); 942 constantEmitter.referenceInInitializationContext(initialValue)]);
943 buffer.write(jsAst.prettyPrint(init, compiler, 943 buffer.write(jsAst.prettyPrint(init, compiler,
944 monitor: compiler.dumpInfoTask)); 944 monitor: compiler.dumpInfoTask));
945 buffer.write('$N'); 945 buffer.write('$N');
946 }); 946 });
947 } 947 }
948 } 948 }
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2083 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2084 if (element.isInstanceMember) { 2084 if (element.isInstanceMember) {
2085 cachedClassBuilders.remove(element.enclosingClass); 2085 cachedClassBuilders.remove(element.enclosingClass);
2086 2086
2087 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2087 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2088 2088
2089 } 2089 }
2090 } 2090 }
2091 } 2091 }
2092 } 2092 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698