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

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

Issue 14907008: Remove support for interface in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 7 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 640
641 Constant visitNewExpression(NewExpression node) { 641 Constant visitNewExpression(NewExpression node) {
642 if (!node.isConst()) { 642 if (!node.isConst()) {
643 return signalNotCompileTimeConstant(node); 643 return signalNotCompileTimeConstant(node);
644 } 644 }
645 645
646 Send send = node.send; 646 Send send = node.send;
647 FunctionElement constructor = elements[send]; 647 FunctionElement constructor = elements[send];
648 constructor = constructor.redirectionTarget; 648 constructor = constructor.redirectionTarget;
649 ClassElement classElement = constructor.getEnclosingClass(); 649 ClassElement classElement = constructor.getEnclosingClass();
650 if (classElement.isInterface()) {
651 compiler.resolver.resolveMethodElement(constructor);
652 constructor = constructor.defaultImplementation;
653 classElement = constructor.getEnclosingClass();
654 }
655 // The constructor must be an implementation to ensure that field 650 // The constructor must be an implementation to ensure that field
656 // initializers are handled correctly. 651 // initializers are handled correctly.
657 constructor = constructor.implementation; 652 constructor = constructor.implementation;
658 assert(invariant(node, constructor.isImplementation)); 653 assert(invariant(node, constructor.isImplementation));
659 654
660 Selector selector = elements.getSelector(send); 655 Selector selector = elements.getSelector(send);
661 List<Constant> arguments = evaluateArgumentsToConstructor( 656 List<Constant> arguments = evaluateArgumentsToConstructor(
662 node, selector, send.arguments, constructor); 657 node, selector, send.arguments, constructor);
663 ConstructorEvaluator evaluator = 658 ConstructorEvaluator evaluator =
664 new ConstructorEvaluator(node, constructor, handler, compiler); 659 new ConstructorEvaluator(node, constructor, handler, compiler);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 // Use the default value. 882 // Use the default value.
888 fieldValue = handler.compileConstant(field); 883 fieldValue = handler.compileConstant(field);
889 } 884 }
890 jsNewArguments.add(fieldValue); 885 jsNewArguments.add(fieldValue);
891 }, 886 },
892 includeBackendMembers: true, 887 includeBackendMembers: true,
893 includeSuperMembers: true); 888 includeSuperMembers: true);
894 return jsNewArguments; 889 return jsNewArguments;
895 } 890 }
896 } 891 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698