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 part of ssa; | 5 part of ssa; |
6 | 6 |
7 class SsaCodeGeneratorTask extends CompilerTask { | 7 class SsaCodeGeneratorTask extends CompilerTask { |
8 | 8 |
9 final JavaScriptBackend backend; | 9 final JavaScriptBackend backend; |
10 | 10 |
(...skipping 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2618 // the same parameter index. | 2618 // the same parameter index. |
2619 int i = 0; | 2619 int i = 0; |
2620 for (; i < target.inputs.length; i++) { | 2620 for (; i < target.inputs.length; i++) { |
2621 assert(guard.inputs.indexOf(target.inputs[i]) >= 0); | 2621 assert(guard.inputs.indexOf(target.inputs[i]) >= 0); |
2622 use(target.inputs[i]); | 2622 use(target.inputs[i]); |
2623 arguments.add(pop()); | 2623 arguments.add(pop()); |
2624 } | 2624 } |
2625 | 2625 |
2626 js.Expression bailoutTarget; | 2626 js.Expression bailoutTarget; |
2627 if (element.isInstanceMember()) { | 2627 if (element.isInstanceMember()) { |
2628 // TODO(ngeoffray): This does not work in case we come from a | |
2629 // super call. We must make bailout names unique. | |
2630 String bailoutName = namer.getBailoutName(element); | 2628 String bailoutName = namer.getBailoutName(element); |
2631 bailoutTarget = new js.PropertyAccess.field(new js.This(), bailoutName); | 2629 bailoutTarget = new js.PropertyAccess.field(new js.This(), bailoutName); |
2632 } else { | 2630 } else { |
2633 assert(!element.isField()); | 2631 assert(!element.isField()); |
2634 bailoutTarget = new js.VariableUse(namer.isolateBailoutAccess(element)); | 2632 bailoutTarget = new js.VariableUse(namer.isolateBailoutAccess(element)); |
2635 } | 2633 } |
2636 js.Call call = new js.Call(bailoutTarget, arguments); | 2634 js.Call call = new js.Call(bailoutTarget, arguments); |
2637 attachLocation(call, guard); | 2635 attachLocation(call, guard); |
2638 return new js.Return(call); | 2636 return new js.Return(call); |
2639 } | 2637 } |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3104 if (leftType.canBeNull() && rightType.canBeNull()) { | 3102 if (leftType.canBeNull() && rightType.canBeNull()) { |
3105 if (left.isConstantNull() || right.isConstantNull() || | 3103 if (left.isConstantNull() || right.isConstantNull() || |
3106 (leftType.isPrimitive() && leftType == rightType)) { | 3104 (leftType.isPrimitive() && leftType == rightType)) { |
3107 return '=='; | 3105 return '=='; |
3108 } | 3106 } |
3109 return null; | 3107 return null; |
3110 } else { | 3108 } else { |
3111 return '==='; | 3109 return '==='; |
3112 } | 3110 } |
3113 } | 3111 } |
OLD | NEW |