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

Unified Diff: frog/leg/ssa/builder.dart

Issue 9391004: Implement cycle-checking and code generation for redirecting constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and add a test. Created 8 years, 10 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: frog/leg/ssa/builder.dart
diff --git a/frog/leg/ssa/builder.dart b/frog/leg/ssa/builder.dart
index 20007b41b5f6caa303862715e7de68caefd0ca4c..35c21f70e80bcbc8f6a73c2c125405a92d8aa8f5 100644
--- a/frog/leg/ssa/builder.dart
+++ b/frog/leg/ssa/builder.dart
@@ -547,19 +547,17 @@ class SsaBuilder implements Visitor {
if (link.head is !SendSet) {
// A super initializer or constructor redirection.
Send call = link.head;
- if (Initializers.isSuperConstructorCall(call)) {
- assert(nextConstructor === null);
- nextConstructor = elements[call];
- // Visit arguments and map the corresponding parameter value to
- // the resulting HInstruction value.
- forEachArgument(call, nextConstructor, (parameter, node) {
- visit(node);
- HInstruction value = pop();
- localsHandler.updateLocal(parameter, value);
- });
- } else {
- compiler.unimplemented('SsaBuilder.buildFactory redirect');
- }
+ assert(Initializers.isSuperConstructorCall(call) ||
+ Initializers.isConstructorRedirect(call));
+ assert(nextConstructor === null);
+ nextConstructor = elements[call];
+ // Visit arguments and map the corresponding parameter value to
+ // the resulting HInstruction value.
+ forEachArgument(call, nextConstructor, (parameter, node) {
+ visit(node);
+ HInstruction value = pop();
+ localsHandler.updateLocal(parameter, value);
+ });
} else {
// A field initializer.
SendSet init = link.head;
« frog/leg/resolver.dart ('K') | « frog/leg/resolver.dart ('k') | frog/leg/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698