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

Unified Diff: dart/frog/leg/ssa/builder.dart

Issue 9380006: Support is!. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 10 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 | « dart/frog/leg/scanner/listener.dart ('k') | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/ssa/builder.dart
===================================================================
--- dart/frog/leg/ssa/builder.dart (revision 4223)
+++ dart/frog/leg/ssa/builder.dart (working copy)
@@ -1225,7 +1225,21 @@
} else if (const SourceString("is") == op.source) {
visit(node.receiver);
HInstruction expression = pop();
- push(new HIs(elements[node.arguments.head], expression));
+ Node argument = node.arguments.head;
+ TypeAnnotation type = 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;
+ isNot = true;
+ }
+ HInstruction instruction = new HIs(elements[type], expression);
+ if (isNot) {
+ add(instruction);
+ instruction = new HNot(instruction);
+ }
+ push(instruction);
} else {
visit(node.receiver);
visit(node.argumentsNode);
« no previous file with comments | « dart/frog/leg/scanner/listener.dart ('k') | dart/frog/leg/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698