Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 266193004: Clean patch implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698