| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 dart2js.cps_ir.optimizers; | 5 part of dart2js.cps_ir.optimizers; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * [ShrinkingReducer] applies shrinking reductions to CPS terms as described | 8 * [ShrinkingReducer] applies shrinking reductions to CPS terms as described |
| 9 * in 'Compiling with Continuations, Continued' by Andrew Kennedy. | 9 * in 'Compiling with Continuations, Continued' by Andrew Kennedy. |
| 10 */ | 10 */ |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 // JavaScript specific nodes. | 413 // JavaScript specific nodes. |
| 414 | 414 |
| 415 processIdentical(Identical node) { | 415 processIdentical(Identical node) { |
| 416 node.left.parent = node; | 416 node.left.parent = node; |
| 417 node.right.parent = node; | 417 node.right.parent = node; |
| 418 } | 418 } |
| 419 | 419 |
| 420 processInterceptor(Interceptor node) { | 420 processInterceptor(Interceptor node) { |
| 421 node.input.parent = node; | 421 node.input.parent = node; |
| 422 } | 422 } |
| 423 |
| 424 processSetField(SetField node) { |
| 425 node.object.parent = node; |
| 426 node.value.parent = node; |
| 427 node.body.parent = node; |
| 428 } |
| 429 |
| 430 processGetField(GetField node) { |
| 431 node.object.parent = node; |
| 432 } |
| 433 |
| 434 processCreateClosureClass(CreateClosureClass node) { |
| 435 node.arguments.forEach((Reference ref) => ref.parent = node); |
| 436 } |
| 437 |
| 438 processCreateBox(CreateBox node) { |
| 439 } |
| 423 } | 440 } |
| 424 | 441 |
| 425 class _ReductionKind { | 442 class _ReductionKind { |
| 426 final String name; | 443 final String name; |
| 427 final int hashCode; | 444 final int hashCode; |
| 428 | 445 |
| 429 const _ReductionKind(this.name, this.hashCode); | 446 const _ReductionKind(this.name, this.hashCode); |
| 430 | 447 |
| 431 static const _ReductionKind DEAD_VAL = const _ReductionKind('dead-val', 0); | 448 static const _ReductionKind DEAD_VAL = const _ReductionKind('dead-val', 0); |
| 432 static const _ReductionKind DEAD_CONT = const _ReductionKind('dead-cont', 1); | 449 static const _ReductionKind DEAD_CONT = const _ReductionKind('dead-cont', 1); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 459 } | 476 } |
| 460 | 477 |
| 461 String toString() => "$kind: $node"; | 478 String toString() => "$kind: $node"; |
| 462 } | 479 } |
| 463 | 480 |
| 464 /// A dummy class used solely to mark nodes as deleted once they are removed | 481 /// A dummy class used solely to mark nodes as deleted once they are removed |
| 465 /// from a term. | 482 /// from a term. |
| 466 class _DeletedNode extends Node { | 483 class _DeletedNode extends Node { |
| 467 accept(_) => null; | 484 accept(_) => null; |
| 468 } | 485 } |
| OLD | NEW |