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

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

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 1 month 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; 5 part of dart2js;
6 6
7 /** 7 /**
8 * The [ConstantHandler] keeps track of compile-time constants, 8 * The [ConstantHandler] keeps track of compile-time constants,
9 * initializations of global and static fields, and default values of 9 * initializations of global and static fields, and default values of
10 * optional parameters. 10 * optional parameters.
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 assignArgumentsToParameters(arguments); 798 assignArgumentsToParameters(arguments);
799 evaluateConstructorInitializers(); 799 evaluateConstructorInitializers();
800 }); 800 });
801 } 801 }
802 802
803 List<Constant> buildJsNewArguments(ClassElement classElement) { 803 List<Constant> buildJsNewArguments(ClassElement classElement) {
804 List<Constant> jsNewArguments = <Constant>[]; 804 List<Constant> jsNewArguments = <Constant>[];
805 classElement.implementation.forEachInstanceField( 805 classElement.implementation.forEachInstanceField(
806 (ClassElement enclosing, Element field) { 806 (ClassElement enclosing, Element field) {
807 Constant fieldValue = fieldValues[field]; 807 Constant fieldValue = fieldValues[field];
808 if (fieldValue === null) { 808 if (fieldValue == null) {
809 // Use the default value. 809 // Use the default value.
810 fieldValue = compiler.compileConstant(field); 810 fieldValue = compiler.compileConstant(field);
811 } 811 }
812 jsNewArguments.add(fieldValue); 812 jsNewArguments.add(fieldValue);
813 }, 813 },
814 includeBackendMembers: true, 814 includeBackendMembers: true,
815 includeSuperMembers: true); 815 includeSuperMembers: true);
816 return jsNewArguments; 816 return jsNewArguments;
817 } 817 }
818 } 818 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698