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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/cps_ir/cps_ir_nodes.dart

Issue 442363002: Add a parameter to return continuations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 6 years, 4 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 | « no previous file | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // IrNodes are kept in a separate library to have precise control over their 5 // IrNodes are kept in a separate library to have precise control over their
6 // dependencies on other parts of the system. 6 // dependencies on other parts of the system.
7 library dart2js.ir_nodes; 7 library dart2js.ir_nodes;
8 8
9 import '../dart2jslib.dart' as dart2js show Constant, ConstructedConstant, 9 import '../dart2jslib.dart' as dart2js show Constant, ConstructedConstant,
10 StringConstant, ListConstant, MapConstant; 10 StringConstant, ListConstant, MapConstant;
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 } 486 }
487 487
488 class Parameter extends Primitive { 488 class Parameter extends Primitive {
489 Parameter(Element element) { 489 Parameter(Element element) {
490 super.hint = element; 490 super.hint = element;
491 } 491 }
492 492
493 accept(Visitor visitor) => visitor.visitParameter(this); 493 accept(Visitor visitor) => visitor.visitParameter(this);
494 } 494 }
495 495
496 /// Continuations are normally bound by 'let cont'. A continuation with no 496 /// Continuations are normally bound by 'let cont'. A continuation with one
497 /// parameter (or body) is used to represent a function's return continuation. 497 /// parameter and no body is used to represent a function's return continuation.
498 /// The return continuation is bound by the Function, not by 'let cont'. 498 /// The return continuation is bound by the Function, not by 'let cont'.
499 class Continuation extends Definition implements InteriorNode { 499 class Continuation extends Definition implements InteriorNode {
500 final List<Parameter> parameters; 500 final List<Parameter> parameters;
501 Expression body = null; 501 Expression body = null;
502 502
503 // A continuation is recursive if it has any recursive invocations. 503 // A continuation is recursive if it has any recursive invocations.
504 bool isRecursive = false; 504 bool isRecursive = false;
505 505
506 Continuation(this.parameters); 506 Continuation(this.parameters);
507 507
508 Continuation.retrn() : parameters = null; 508 Continuation.retrn() : parameters = <Parameter>[new Parameter(null)];
509 509
510 accept(Visitor visitor) => visitor.visitContinuation(this); 510 accept(Visitor visitor) => visitor.visitContinuation(this);
511 } 511 }
512 512
513 /// A function definition, consisting of parameters and a body. The parameters 513 /// A function definition, consisting of parameters and a body. The parameters
514 /// include a distinguished continuation parameter. 514 /// include a distinguished continuation parameter.
515 class FunctionDefinition extends Node implements InteriorNode { 515 class FunctionDefinition extends Node implements InteriorNode {
516 final FunctionElement element; 516 final FunctionElement element;
517 final Continuation returnContinuation; 517 final Continuation returnContinuation;
518 final List<Parameter> parameters; 518 final List<Parameter> parameters;
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 release(node.parameters[i]); 801 release(node.parameters[i]);
802 } 802 }
803 } 803 }
804 804
805 void visitIsTrue(IsTrue node) { 805 void visitIsTrue(IsTrue node) {
806 visitReference(node.value); 806 visitReference(node.value);
807 } 807 }
808 808
809 } 809 }
810 810
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698