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

Side by Side Diff: frog/leg/ssa/builder.dart

Issue 9310066: Generate a resolution error if a unary + is used for something other than numbers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
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 unified diff | Download patch | Annotate | Revision Log
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 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 void visitLogicalNot(Send node) { 675 void visitLogicalNot(Send node) {
676 assert(node.argumentsNode is Prefix); 676 assert(node.argumentsNode is Prefix);
677 visit(node.receiver); 677 visit(node.receiver);
678 HNot not = new HNot(popBoolified()); 678 HNot not = new HNot(popBoolified());
679 push(not); 679 push(not);
680 } 680 }
681 681
682 void visitUnary(Send node, Operator op) { 682 void visitUnary(Send node, Operator op) {
683 assert(node.argumentsNode is Prefix); 683 assert(node.argumentsNode is Prefix);
684 visit(node.receiver); 684 visit(node.receiver);
685 if (op.source.stringValue == '+') return;
685 HInstruction operand = pop(); 686 HInstruction operand = pop();
686 HInstruction target = 687 HInstruction target =
687 new HStatic(interceptors.getPrefixOperatorInterceptor(op)); 688 new HStatic(interceptors.getPrefixOperatorInterceptor(op));
688 add(target); 689 add(target);
689 switch (op.source.stringValue) { 690 switch (op.source.stringValue) {
690 case "-": push(new HNegate(target, operand)); break; 691 case "-": push(new HNegate(target, operand)); break;
691 case "~": push(new HBitNot(target, operand)); break; 692 case "~": push(new HBitNot(target, operand)); break;
692 default: unreachable(); 693 default: unreachable();
693 } 694 }
694 } 695 }
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 } 1528 }
1528 1529
1529 visitCatchBlock(CatchBlock node) { 1530 visitCatchBlock(CatchBlock node) {
1530 compiler.unimplemented('SsaBuilder.visitCatchBlock', node: node); 1531 compiler.unimplemented('SsaBuilder.visitCatchBlock', node: node);
1531 } 1532 }
1532 1533
1533 visitTypedef(Typedef node) { 1534 visitTypedef(Typedef node) {
1534 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); 1535 compiler.unimplemented('SsaBuilder.visitTypedef', node: node);
1535 } 1536 }
1536 } 1537 }
OLDNEW
« no previous file with comments | « frog/leg/resolver.dart ('k') | frog/leg/tree/nodes.dart » ('j') | frog/leg/warnings.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698