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

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

Issue 14168003: Implement implicit constructors in mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove debug code and rebase Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 97c585ccde362a4701c7c1b34710a1b0d9d3c07b..b1ad844be6ba07fb7dba7c313ebd0e742678f201 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -105,8 +105,9 @@ class SsaBuilderTask extends CompilerTask {
HGraph compileConstructor(SsaBuilder builder, CodegenWorkItem work) {
// The body of the constructor will be generated in a separate function.
final ClassElement classElement = work.element.getEnclosingClass();
+ FunctionElement constructor = work.element.implementation;
return builder.buildFactory(classElement.implementation,
- work.element.implementation);
+ constructor);
ahe 2013/04/15 13:36:46 Why this change?
karlklose 2013/04/25 11:25:53 Reverted.
}
}
@@ -1255,9 +1256,11 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
// Build the initializers in the context of the new constructor.
TreeElements oldElements = elements;
+ if (constructor is ForwardingConstructorElement) {
ahe 2013/04/15 13:36:46 Is there a method you can call?
+ constructor = constructor.superConstructor;
+ }
elements =
compiler.enqueuer.resolution.getCachedElements(constructor);
-
ClosureClassMap oldClosureData = localsHandler.closureData;
Node node = constructor.parseNode(compiler);
ClosureClassMap newClosureData =
@@ -2841,6 +2844,9 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
HInstruction handleConstant(Element parameter) {
Constant constant;
+ if (element is ForwardingConstructorElement) {
ahe 2013/04/15 13:36:46 Is there a method you can call?
+ element = element.superConstructor;
+ }
TreeElements calleeElements =
compiler.enqueuer.resolution.getCachedElements(element);
if (calleeElements.isParameterChecked(parameter)) {
@@ -3368,6 +3374,10 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
Element constructor = elements[node];
Selector selector = elements.getSelector(node);
+ if (constructor is ForwardingConstructorElement) {
ahe 2013/04/15 13:36:46 Is there a method you can call?
+ compiler.unimplemented('forwarded constructor in named mixin application',
+ element: constructor.superConstructor);
ahe 2013/04/15 13:36:46 I don't think this position is helpful. It doesn'
karlklose 2013/04/25 11:25:53 Changed to the enclosing class.
+ }
if (compiler.enqueuer.resolution.getCachedElements(constructor) == null) {
compiler.internalError("Unresolved element: $constructor", node: node);
}

Powered by Google App Engine
This is Rietveld 408576698