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

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

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 years, 6 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 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 bool inMainUnit = (outputUnit == compiler.deferredLoadTask.mainOutputUnit); 544 bool inMainUnit = (outputUnit == compiler.deferredLoadTask.mainOutputUnit);
545 JavaScriptConstantCompiler handler = backend.constants; 545 JavaScriptConstantCompiler handler = backend.constants;
546 List<jsAst.Statement> parts = <jsAst.Statement>[]; 546 List<jsAst.Statement> parts = <jsAst.Statement>[];
547 547
548 Iterable<Element> fields = task.outputStaticNonFinalFieldLists[outputUnit]; 548 Iterable<Element> fields = task.outputStaticNonFinalFieldLists[outputUnit];
549 // If the outputUnit does not contain any static non-final fields, then 549 // If the outputUnit does not contain any static non-final fields, then
550 // [fields] is `null`. 550 // [fields] is `null`.
551 if (fields != null) { 551 if (fields != null) {
552 for (Element element in fields) { 552 for (Element element in fields) {
553 compiler.withCurrentElement(element, () { 553 compiler.withCurrentElement(element, () {
554 ConstantValue constant = handler.getInitialValueFor(element).value; 554 ConstantValue constant = handler.getInitialValueFor(element);
555 parts.add(buildInitialization(element, constantReference(constant))); 555 parts.add(buildInitialization(element, constantReference(constant)));
556 }); 556 });
557 } 557 }
558 } 558 }
559 559
560 if (inMainUnit && task.outputStaticNonFinalFieldLists.length > 1) { 560 if (inMainUnit && task.outputStaticNonFinalFieldLists.length > 1) {
561 // In the main output-unit we output a stub initializer for deferred 561 // In the main output-unit we output a stub initializer for deferred
562 // variables, so that `isolateProperties` stays a fast object. 562 // variables, so that `isolateProperties` stays a fast object.
563 task.outputStaticNonFinalFieldLists.forEach( 563 task.outputStaticNonFinalFieldLists.forEach(
564 (OutputUnit fieldsOutputUnit, Iterable<VariableElement> fields) { 564 (OutputUnit fieldsOutputUnit, Iterable<VariableElement> fields) {
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 1980 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
1981 if (element.isInstanceMember) { 1981 if (element.isInstanceMember) {
1982 cachedClassBuilders.remove(element.enclosingClass); 1982 cachedClassBuilders.remove(element.enclosingClass);
1983 1983
1984 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 1984 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
1985 1985
1986 } 1986 }
1987 } 1987 }
1988 } 1988 }
1989 } 1989 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698