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

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

Issue 1423623008: Improve messages and static use for super/this-calls. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment. Created 5 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
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 5713 matching lines...) Expand 10 before | Expand all | Expand 10 after
5724 @override 5724 @override
5725 void bulkHandleNew(ast.NewExpression node, [_]) { 5725 void bulkHandleNew(ast.NewExpression node, [_]) {
5726 Element element = elements[node.send]; 5726 Element element = elements[node.send];
5727 final bool isSymbolConstructor = element == compiler.symbolConstructor; 5727 final bool isSymbolConstructor = element == compiler.symbolConstructor;
5728 if (!Elements.isMalformed(element)) { 5728 if (!Elements.isMalformed(element)) {
5729 ConstructorElement function = element; 5729 ConstructorElement function = element;
5730 element = function.effectiveTarget; 5730 element = function.effectiveTarget;
5731 } 5731 }
5732 if (Elements.isError(element)) { 5732 if (Elements.isError(element)) {
5733 ErroneousElement error = element; 5733 ErroneousElement error = element;
5734 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR) { 5734 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR ||
5735 error.messageKind == MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR) {
5735 generateThrowNoSuchMethod( 5736 generateThrowNoSuchMethod(
5736 node.send, 5737 node.send,
5737 noSuchMethodTargetSymbolString(error, 'constructor'), 5738 noSuchMethodTargetSymbolString(error, 'constructor'),
5738 argumentNodes: node.send.arguments); 5739 argumentNodes: node.send.arguments);
5739 } else { 5740 } else {
5740 MessageTemplate template = MessageTemplate.TEMPLATES[error.messageKind]; 5741 MessageTemplate template = MessageTemplate.TEMPLATES[error.messageKind];
5741 Message message = template.message(error.messageArguments); 5742 Message message = template.message(error.messageArguments);
5742 generateRuntimeError(node.send, message.toString()); 5743 generateRuntimeError(node.send, message.toString());
5743 } 5744 }
5744 } else if (Elements.isMalformed(element)) { 5745 } else if (Elements.isMalformed(element)) {
(...skipping 3403 matching lines...) Expand 10 before | Expand all | Expand 10 after
9148 if (unaliased is TypedefType) throw 'unable to unalias $type'; 9149 if (unaliased is TypedefType) throw 'unable to unalias $type';
9149 unaliased.accept(this, builder); 9150 unaliased.accept(this, builder);
9150 } 9151 }
9151 9152
9152 void visitDynamicType(DynamicType type, SsaBuilder builder) { 9153 void visitDynamicType(DynamicType type, SsaBuilder builder) {
9153 JavaScriptBackend backend = builder.compiler.backend; 9154 JavaScriptBackend backend = builder.compiler.backend;
9154 ClassElement cls = backend.helpers.DynamicRuntimeType; 9155 ClassElement cls = backend.helpers.DynamicRuntimeType;
9155 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 9156 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
9156 } 9157 }
9157 } 9158 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_resolver.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698