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

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

Issue 10947024: Made dart2js constructor lookup logic "private"-aware, fixed 4740 bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 746
747 if (!foundSuperOrRedirect) { 747 if (!foundSuperOrRedirect) {
748 // No super initializer found. Try to find the default constructor if 748 // No super initializer found. Try to find the default constructor if
749 // the class is not Object. 749 // the class is not Object.
750 ClassElement enclosingClass = constructor.getEnclosingClass(); 750 ClassElement enclosingClass = constructor.getEnclosingClass();
751 ClassElement superClass = enclosingClass.superclass; 751 ClassElement superClass = enclosingClass.superclass;
752 if (enclosingClass != compiler.objectClass) { 752 if (enclosingClass != compiler.objectClass) {
753 assert(superClass !== null); 753 assert(superClass !== null);
754 assert(superClass.resolutionState == STATE_DONE); 754 assert(superClass.resolutionState == STATE_DONE);
755 FunctionElement targetConstructor = 755 FunctionElement targetConstructor =
756 superClass.lookupConstructor(superClass.name); 756 superClass.lookupConstructor(enclosingClass.getLibrary(),
kasperl 2012/09/19 05:59:17 Could we start using the selector to lookup the co
757 superClass.name);
757 if (targetConstructor === null) { 758 if (targetConstructor === null) {
758 compiler.internalError("no default constructor available", 759 compiler.internalError("no default constructor available",
759 node: functionNode); 760 node: functionNode);
760 } 761 }
761 762
762 Selector selector = new Selector.call(superClass.name, 763 Selector selector = new Selector.call(superClass.name,
763 enclosingClass.getLibrary(), 764 enclosingClass.getLibrary(),
764 0); 765 0);
765 evaluateSuperOrRedirectSend(functionNode, 766 evaluateSuperOrRedirectSend(functionNode,
766 selector, 767 selector,
(...skipping 24 matching lines...) Expand all
791 Constant fieldValue = fieldValues[field]; 792 Constant fieldValue = fieldValues[field];
792 if (fieldValue === null) { 793 if (fieldValue === null) {
793 // Use the default value. 794 // Use the default value.
794 fieldValue = compiler.compileConstant(field); 795 fieldValue = compiler.compileConstant(field);
795 } 796 }
796 jsNewArguments.add(fieldValue); 797 jsNewArguments.add(fieldValue);
797 }); 798 });
798 return jsNewArguments; 799 return jsNewArguments;
799 } 800 }
800 } 801 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698