| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |