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

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

Issue 1248483008: Split MessageKind into a MessageKind key and a MessageTemplate. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 years, 5 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
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 SsaCodeGeneratorTask generator; 8 SsaCodeGeneratorTask generator;
9 SsaBuilderTask builder; 9 SsaBuilderTask builder;
10 SsaOptimizerTask optimizer; 10 SsaOptimizerTask optimizer;
(...skipping 5618 matching lines...) Expand 10 before | Expand all | Expand 10 after
5629 stack.add(graph.addConstantNull(compiler)); 5629 stack.add(graph.addConstantNull(compiler));
5630 return; 5630 return;
5631 } 5631 }
5632 ErroneousElement error = element; 5632 ErroneousElement error = element;
5633 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR) { 5633 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR) {
5634 generateThrowNoSuchMethod( 5634 generateThrowNoSuchMethod(
5635 node.send, 5635 node.send,
5636 noSuchMethodTargetSymbolString(error, 'constructor'), 5636 noSuchMethodTargetSymbolString(error, 'constructor'),
5637 argumentNodes: node.send.arguments); 5637 argumentNodes: node.send.arguments);
5638 } else { 5638 } else {
5639 Message message = error.messageKind.message(error.messageArguments); 5639 MessageTemplate template = MessageTemplate.TEMPLATES[error.messageKind];
5640 Message message = template.message(error.messageArguments);
5640 generateRuntimeError(node.send, message.toString()); 5641 generateRuntimeError(node.send, message.toString());
5641 } 5642 }
5642 } else if (node.isConst) { 5643 } else if (node.isConst) {
5643 stack.add(addConstant(node)); 5644 stack.add(addConstant(node));
5644 if (isSymbolConstructor) { 5645 if (isSymbolConstructor) {
5645 ConstructedConstantValue symbol = getConstantForNode(node); 5646 ConstructedConstantValue symbol = getConstantForNode(node);
5646 StringConstantValue stringConstant = symbol.fields.values.single; 5647 StringConstantValue stringConstant = symbol.fields.values.single;
5647 String nameString = stringConstant.toDartString().slowToString(); 5648 String nameString = stringConstant.toDartString().slowToString();
5648 registry.registerConstSymbol(nameString); 5649 registry.registerConstSymbol(nameString);
5649 } 5650 }
(...skipping 3223 matching lines...) Expand 10 before | Expand all | Expand 10 after
8873 if (unaliased is TypedefType) throw 'unable to unalias $type'; 8874 if (unaliased is TypedefType) throw 'unable to unalias $type';
8874 unaliased.accept(this, builder); 8875 unaliased.accept(this, builder);
8875 } 8876 }
8876 8877
8877 void visitDynamicType(DynamicType type, SsaBuilder builder) { 8878 void visitDynamicType(DynamicType type, SsaBuilder builder) {
8878 JavaScriptBackend backend = builder.compiler.backend; 8879 JavaScriptBackend backend = builder.compiler.backend;
8879 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 8880 ClassElement cls = backend.findHelper('DynamicRuntimeType');
8880 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 8881 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
8881 } 8882 }
8882 } 8883 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698