Chromium Code Reviews| 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 SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 final JavaScriptBackend backend; | 6 final JavaScriptBackend backend; |
| 7 SsaCodeGeneratorTask(JavaScriptBackend backend) | 7 SsaCodeGeneratorTask(JavaScriptBackend backend) |
| 8 : this.backend = backend, | 8 : this.backend = backend, |
| 9 super(backend.compiler); | 9 super(backend.compiler); |
| 10 String get name() => 'SSA code generator'; | 10 String get name() => 'SSA code generator'; |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1492 if (superMethod.kind == ElementKind.FIELD) { | 1492 if (superMethod.kind == ElementKind.FIELD) { |
| 1493 ClassElement currentClass = work.element.getEnclosingClass(); | 1493 ClassElement currentClass = work.element.getEnclosingClass(); |
| 1494 String fieldName; | 1494 String fieldName; |
| 1495 if (currentClass.isShadowedByField(superMethod)) { | 1495 if (currentClass.isShadowedByField(superMethod)) { |
| 1496 fieldName = compiler.namer.shadowedFieldName(superMethod); | 1496 fieldName = compiler.namer.shadowedFieldName(superMethod); |
| 1497 } else { | 1497 } else { |
| 1498 LibraryElement library = superMethod.getLibrary(); | 1498 LibraryElement library = superMethod.getLibrary(); |
| 1499 SourceString name = superMethod.name; | 1499 SourceString name = superMethod.name; |
| 1500 fieldName = compiler.namer.instanceFieldName(library, name); | 1500 fieldName = compiler.namer.instanceFieldName(library, name); |
| 1501 } | 1501 } |
| 1502 push(new js.PropertyAccess.field(new js.This(), fieldName), node); | 1502 js.PropertyAccess access = |
| 1503 new js.PropertyAccess.field(new js.This(), fieldName); | |
|
floitsch
2012/08/15 18:20:47
indent 4.
| |
| 1504 if (node.isSetter) { | |
| 1505 use(node.inputs[2]); | |
|
floitsch
2012/08/15 18:20:47
make this a getter with a telling name.
ahe
2012/08/15 19:10:49
How about:
get rhs {
assert(isSetter);
return
floitsch
2012/08/15 19:26:32
LGTM, but I don't see right now, why the value wou
| |
| 1506 push(new js.Assignment(access, pop()), node); | |
| 1507 } else { | |
| 1508 push(access, node); | |
| 1509 } | |
| 1503 } else { | 1510 } else { |
| 1504 String methodName; | 1511 String methodName; |
| 1505 if (superMethod.kind == ElementKind.FUNCTION || | 1512 if (superMethod.kind == ElementKind.FUNCTION || |
| 1506 superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { | 1513 superMethod.kind == ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 1507 methodName = compiler.namer.instanceMethodName( | 1514 methodName = compiler.namer.instanceMethodName( |
| 1508 currentLibrary, superMethod.name, argumentCount); | 1515 currentLibrary, superMethod.name, argumentCount); |
| 1509 } else if (superMethod.kind == ElementKind.GETTER) { | 1516 } else if (superMethod.kind == ElementKind.GETTER) { |
| 1510 methodName = | 1517 methodName = |
| 1511 compiler.namer.getterName(currentLibrary, superMethod.name); | 1518 compiler.namer.getterName(currentLibrary, superMethod.name); |
| 1512 } else { | 1519 } else { |
| (...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2883 if (leftType.canBeNull() && rightType.canBeNull()) { | 2890 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2884 if (left.isConstantNull() || right.isConstantNull() || | 2891 if (left.isConstantNull() || right.isConstantNull() || |
| 2885 (leftType.isPrimitive() && leftType == rightType)) { | 2892 (leftType.isPrimitive() && leftType == rightType)) { |
| 2886 return '=='; | 2893 return '=='; |
| 2887 } | 2894 } |
| 2888 return null; | 2895 return null; |
| 2889 } else { | 2896 } else { |
| 2890 return '==='; | 2897 return '==='; |
| 2891 } | 2898 } |
| 2892 } | 2899 } |
| OLD | NEW |