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

Side by Side Diff: lib/compiler/implementation/compile_time_constants.dart

Issue 10905305: Patch refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 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 /** 5 /**
6 * The [ConstantHandler] keeps track of compile-time constants, 6 * The [ConstantHandler] keeps track of compile-time constants,
7 * initializations of global and static fields, and default values of 7 * initializations of global and static fields, and default values of
8 * optional parameters. 8 * optional parameters.
9 */ 9 */
10 class ConstantHandler extends CompilerTask { 10 class ConstantHandler extends CompilerTask {
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 assignArgumentsToParameters(arguments); 797 assignArgumentsToParameters(arguments);
798 evaluateConstructorInitializers(); 798 evaluateConstructorInitializers();
799 }); 799 });
800 } 800 }
801 801
802 List<Constant> buildJsNewArguments(ClassElement classElement) { 802 List<Constant> buildJsNewArguments(ClassElement classElement) {
803 List<Constant> jsNewArguments = <Constant>[]; 803 List<Constant> jsNewArguments = <Constant>[];
804 classElement.forEachInstanceField( 804 classElement.forEachInstanceField(
805 includeBackendMembers: true, 805 includeBackendMembers: true,
806 includeSuperMembers: true, 806 includeSuperMembers: true,
807 includeInjectedMembers: true,
807 f: (ClassElement enclosing, Element field) { 808 f: (ClassElement enclosing, Element field) {
808 Constant fieldValue = fieldValues[field]; 809 Constant fieldValue = fieldValues[field];
809 if (fieldValue === null) { 810 if (fieldValue === null) {
810 // Use the default value. 811 // Use the default value.
811 fieldValue = compiler.compileConstant(field); 812 fieldValue = compiler.compileConstant(field);
812 } 813 }
813 jsNewArguments.add(fieldValue); 814 jsNewArguments.add(fieldValue);
814 }); 815 });
815 return jsNewArguments; 816 return jsNewArguments;
816 } 817 }
817 } 818 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/compiler.dart » ('j') | lib/compiler/implementation/elements/elements.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698