| 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |