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

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
« no previous file with comments | « frog/leg/resolver.dart ('k') | frog/leg/tree/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 void visitLogicalNot(Send node) { 679 void visitLogicalNot(Send node) {
680 assert(node.argumentsNode is Prefix); 680 assert(node.argumentsNode is Prefix);
681 visit(node.receiver); 681 visit(node.receiver);
682 HNot not = new HNot(popBoolified()); 682 HNot not = new HNot(popBoolified());
683 push(not); 683 push(not);
684 } 684 }
685 685
686 void visitUnary(Send node, Operator op) { 686 void visitUnary(Send node, Operator op) {
687 assert(node.argumentsNode is Prefix); 687 assert(node.argumentsNode is Prefix);
688 visit(node.receiver); 688 visit(node.receiver);
689 if (op.source.stringValue == '+') return;
689 HInstruction operand = pop(); 690 HInstruction operand = pop();
690 HInstruction target = 691 HInstruction target =
691 new HStatic(interceptors.getPrefixOperatorInterceptor(op)); 692 new HStatic(interceptors.getPrefixOperatorInterceptor(op));
692 add(target); 693 add(target);
693 switch (op.source.stringValue) { 694 switch (op.source.stringValue) {
694 case "-": push(new HNegate(target, operand)); break; 695 case "-": push(new HNegate(target, operand)); break;
695 case "~": push(new HBitNot(target, operand)); break; 696 case "~": push(new HBitNot(target, operand)); break;
696 default: unreachable(); 697 default: unreachable();
697 } 698 }
698 } 699 }
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 } 1532 }
1532 1533
1533 visitCatchBlock(CatchBlock node) { 1534 visitCatchBlock(CatchBlock node) {
1534 compiler.unimplemented('SsaBuilder.visitCatchBlock', node: node); 1535 compiler.unimplemented('SsaBuilder.visitCatchBlock', node: node);
1535 } 1536 }
1536 1537
1537 visitTypedef(Typedef node) { 1538 visitTypedef(Typedef node) {
1538 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); 1539 compiler.unimplemented('SsaBuilder.visitTypedef', node: node);
1539 } 1540 }
1540 } 1541 }
OLDNEW
« no previous file with comments | « frog/leg/resolver.dart ('k') | frog/leg/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698