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

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10095014: Implement interface types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index 367c719fafb73fcf2df7c61c3cbe9d4a28038275..da8542eef5e9143ea6636a564b45b875ed69f759 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -1720,15 +1720,16 @@ class SsaBuilder implements Visitor {
visit(node.receiver);
HInstruction expression = pop();
Node argument = node.arguments.head;
- TypeAnnotation type = argument.asTypeAnnotation();
+ TypeAnnotation typeAnnotation = argument.asTypeAnnotation();
bool isNot = false;
// TODO(ngeoffray): Duplicating pattern in resolver. We should
// add a new kind of node.
- if (type == null) {
- type = argument.asSend().receiver;
+ if (typeAnnotation == null) {
+ typeAnnotation = argument.asSend().receiver;
isNot = true;
}
- HInstruction instruction = new HIs(elements[type], expression);
+ Type type = elements.getType(typeAnnotation);
+ HInstruction instruction = new HIs(type, expression);
if (isNot) {
add(instruction);
instruction = new HNot(instruction);
@@ -2784,11 +2785,11 @@ class SsaBuilder implements Visitor {
condition = graph.addConstantBool(true);
stack.add(condition);
} else {
- Element typeElement = elements[declaration.type];
- if (typeElement == null) {
+ Type type = elements.getType(declaration.type);
+ if (type == null) {
compiler.cancel('Catch with unresolved type', node: catchBlock);
}
- condition = new HIs(typeElement, unwrappedException, nullOk: true);
+ condition = new HIs(type, unwrappedException, nullOk: true);
push(condition);
}
}
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698