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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1768143003: Use specific messages for const constructor with body. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 9 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
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/tree/nodes.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 ssa; 5 part of ssa;
6 6
7 class SsaFunctionCompiler implements FunctionCompiler { 7 class SsaFunctionCompiler implements FunctionCompiler {
8 final SsaCodeGeneratorTask generator; 8 final SsaCodeGeneratorTask generator;
9 final SsaBuilderTask builder; 9 final SsaBuilderTask builder;
10 final SsaOptimizerTask optimizer; 10 final SsaOptimizerTask optimizer;
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1747 * creates a new constructor body, if none can be found. 1747 * creates a new constructor body, if none can be found.
1748 * 1748 *
1749 * Returns [:null:] if the constructor does not have a body. 1749 * Returns [:null:] if the constructor does not have a body.
1750 */ 1750 */
1751 ConstructorBodyElement getConstructorBody(FunctionElement constructor) { 1751 ConstructorBodyElement getConstructorBody(FunctionElement constructor) {
1752 assert(constructor.isGenerativeConstructor); 1752 assert(constructor.isGenerativeConstructor);
1753 assert(invariant(constructor, constructor.isImplementation)); 1753 assert(invariant(constructor, constructor.isImplementation));
1754 if (constructor.isSynthesized) return null; 1754 if (constructor.isSynthesized) return null;
1755 ast.FunctionExpression node = constructor.node; 1755 ast.FunctionExpression node = constructor.node;
1756 // If we know the body doesn't have any code, we don't generate it. 1756 // If we know the body doesn't have any code, we don't generate it.
1757 if (!node.hasBody()) return null; 1757 if (!node.hasBody) return null;
1758 if (node.hasEmptyBody()) return null; 1758 if (node.hasEmptyBody) return null;
1759 ClassElement classElement = constructor.enclosingClass; 1759 ClassElement classElement = constructor.enclosingClass;
1760 ConstructorBodyElement bodyElement; 1760 ConstructorBodyElement bodyElement;
1761 classElement.forEachBackendMember((Element backendMember) { 1761 classElement.forEachBackendMember((Element backendMember) {
1762 if (backendMember.isGenerativeConstructorBody) { 1762 if (backendMember.isGenerativeConstructorBody) {
1763 ConstructorBodyElement body = backendMember; 1763 ConstructorBodyElement body = backendMember;
1764 if (body.constructor == constructor) { 1764 if (body.constructor == constructor) {
1765 // TODO(kasperl): Find a way of stopping the iteration 1765 // TODO(kasperl): Find a way of stopping the iteration
1766 // through the backend members. 1766 // through the backend members.
1767 bodyElement = backendMember; 1767 bodyElement = backendMember;
1768 } 1768 }
(...skipping 7468 matching lines...) Expand 10 before | Expand all | Expand 10 after
9237 if (unaliased is TypedefType) throw 'unable to unalias $type'; 9237 if (unaliased is TypedefType) throw 'unable to unalias $type';
9238 unaliased.accept(this, builder); 9238 unaliased.accept(this, builder);
9239 } 9239 }
9240 9240
9241 void visitDynamicType(DynamicType type, SsaBuilder builder) { 9241 void visitDynamicType(DynamicType type, SsaBuilder builder) {
9242 JavaScriptBackend backend = builder.compiler.backend; 9242 JavaScriptBackend backend = builder.compiler.backend;
9243 ClassElement cls = backend.helpers.DynamicRuntimeType; 9243 ClassElement cls = backend.helpers.DynamicRuntimeType;
9244 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 9244 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
9245 } 9245 }
9246 } 9246 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698