Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 487 } | 487 } |
| 488 | 488 |
| 489 class Parameter extends Primitive { | 489 class Parameter extends Primitive { |
| 490 Parameter(Element element) { | 490 Parameter(Element element) { |
| 491 super.hint = element; | 491 super.hint = element; |
| 492 } | 492 } |
| 493 | 493 |
| 494 accept(Visitor visitor) => visitor.visitParameter(this); | 494 accept(Visitor visitor) => visitor.visitParameter(this); |
| 495 } | 495 } |
| 496 | 496 |
| 497 /// Continuations are normally bound by 'let cont'. A continuation with no | 497 /// Continuations are normally bound by 'let cont'. A continuation with one |
| 498 /// parameter (or body) is used to represent a function's return continuation. | 498 /// parameter and no body is used to represent a function's return continuation. |
| 499 /// The return continuation is bound by the Function, not by 'let cont'. | 499 /// The return continuation is bound by the Function, not by 'let cont'. |
| 500 class Continuation extends Definition implements NodeWithBody { | 500 class Continuation extends Definition implements NodeWithBody { |
| 501 final List<Parameter> parameters; | 501 final List<Parameter> parameters; |
| 502 Expression body = null; | 502 Expression body = null; |
| 503 | 503 |
| 504 // A continuation is recursive if it has any recursive invocations. | 504 // A continuation is recursive if it has any recursive invocations. |
| 505 bool isRecursive = false; | 505 bool isRecursive = false; |
| 506 | 506 |
| 507 Continuation(this.parameters); | 507 Continuation(this.parameters); |
| 508 | 508 |
| 509 Continuation.retrn() : parameters = null; | 509 Continuation.retrn() : parameters = new List<Parameter>(1) { |
|
Kevin Millikin (Google)
2014/08/08 08:44:53
= <Parameter>[new Parameter(null)] {}
jgruber1
2014/08/08 09:04:02
Done.
| |
| 510 parameters[0] = new Parameter(null); | |
| 511 } | |
| 510 | 512 |
| 511 accept(Visitor visitor) => visitor.visitContinuation(this); | 513 accept(Visitor visitor) => visitor.visitContinuation(this); |
| 512 } | 514 } |
| 513 | 515 |
| 514 /// A function definition, consisting of parameters and a body. The parameters | 516 /// A function definition, consisting of parameters and a body. The parameters |
| 515 /// include a distinguished continuation parameter. | 517 /// include a distinguished continuation parameter. |
| 516 class FunctionDefinition extends Node implements NodeWithBody { | 518 class FunctionDefinition extends Node implements NodeWithBody { |
| 517 final FunctionElement element; | 519 final FunctionElement element; |
| 518 final Continuation returnContinuation; | 520 final Continuation returnContinuation; |
| 519 final List<Parameter> parameters; | 521 final List<Parameter> parameters; |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 896 release(node.parameters[i]); | 898 release(node.parameters[i]); |
| 897 } | 899 } |
| 898 } | 900 } |
| 899 | 901 |
| 900 void visitIsTrue(IsTrue node) { | 902 void visitIsTrue(IsTrue node) { |
| 901 visitReference(node.value); | 903 visitReference(node.value); |
| 902 } | 904 } |
| 903 | 905 |
| 904 } | 906 } |
| 905 | 907 |
| OLD | NEW |