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 /** | 7 /** |
8 * A special element for the extra parameter taken by intercepted | 8 * A special element for the extra parameter taken by intercepted |
9 * methods. We need to implement [TypedElement.type] because our | 9 * methods. We need to implement [TypedElement.type] because our |
10 * optimizers may look at its declared type. | 10 * optimizers may look at its declared type. |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 bodyElement = backendMember; | 1485 bodyElement = backendMember; |
1486 } | 1486 } |
1487 } | 1487 } |
1488 }); | 1488 }); |
1489 if (bodyElement == null) { | 1489 if (bodyElement == null) { |
1490 bodyElement = new ConstructorBodyElementX(constructor); | 1490 bodyElement = new ConstructorBodyElementX(constructor); |
1491 classElement.addBackendMember(bodyElement); | 1491 classElement.addBackendMember(bodyElement); |
1492 | 1492 |
1493 if (constructor.isPatch) { | 1493 if (constructor.isPatch) { |
1494 // Create origin body element for patched constructors. | 1494 // Create origin body element for patched constructors. |
1495 bodyElement.origin = new ConstructorBodyElementX(constructor.origin); | 1495 ConstructorBodyElementX patch = bodyElement; |
1496 bodyElement.origin.patch = bodyElement; | 1496 ConstructorBodyElementX origin = |
| 1497 new ConstructorBodyElementX(constructor.origin); |
| 1498 origin.applyPatch(patch); |
1497 classElement.origin.addBackendMember(bodyElement.origin); | 1499 classElement.origin.addBackendMember(bodyElement.origin); |
1498 } | 1500 } |
1499 } | 1501 } |
1500 assert(bodyElement.isGenerativeConstructorBody()); | 1502 assert(bodyElement.isGenerativeConstructorBody()); |
1501 return bodyElement; | 1503 return bodyElement; |
1502 } | 1504 } |
1503 | 1505 |
1504 HParameterValue addParameter(Element element, TypeMask type) { | 1506 HParameterValue addParameter(Element element, TypeMask type) { |
1505 assert(inliningStack.isEmpty); | 1507 assert(inliningStack.isEmpty); |
1506 HParameterValue result = new HParameterValue(element, type); | 1508 HParameterValue result = new HParameterValue(element, type); |
(...skipping 4809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6316 DartType unaliased = type.unalias(builder.compiler); | 6318 DartType unaliased = type.unalias(builder.compiler); |
6317 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 6319 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
6318 unaliased.accept(this, builder); | 6320 unaliased.accept(this, builder); |
6319 } | 6321 } |
6320 | 6322 |
6321 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 6323 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
6322 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType'); | 6324 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType'); |
6323 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); | 6325 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); |
6324 } | 6326 } |
6325 } | 6327 } |
OLD | NEW |