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

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

Issue 574683002: Use ConstExp for storing constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes and further implementation. Created 6 years, 2 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
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, invariant; 10 StringConstant, ListConstant, MapConstant, invariant;
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 Branch(this.condition, Continuation trueCont, Continuation falseCont) 444 Branch(this.condition, Continuation trueCont, Continuation falseCont)
445 : trueContinuation = new Reference(trueCont), 445 : trueContinuation = new Reference(trueCont),
446 falseContinuation = new Reference(falseCont); 446 falseContinuation = new Reference(falseCont);
447 447
448 accept(Visitor visitor) => visitor.visitBranch(this); 448 accept(Visitor visitor) => visitor.visitBranch(this);
449 } 449 }
450 450
451 class Constant extends Primitive { 451 class Constant extends Primitive {
452 final ConstExp expression; 452 final ConstExp expression;
453 final dart2js.Constant value;
454 453
455 Constant(this.expression, this.value); 454 Constant(this.expression);
455
456 dart2js.Constant get value => expression.value;
456 457
457 accept(Visitor visitor) => visitor.visitConstant(this); 458 accept(Visitor visitor) => visitor.visitConstant(this);
458 } 459 }
459 460
460 class This extends Primitive { 461 class This extends Primitive {
461 This(); 462 This();
462 463
463 accept(Visitor visitor) => visitor.visitThis(this); 464 accept(Visitor visitor) => visitor.visitThis(this);
464 } 465 }
465 466
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 release(node.parameters[i]); 936 release(node.parameters[i]);
936 } 937 }
937 } 938 }
938 939
939 void visitIsTrue(IsTrue node) { 940 void visitIsTrue(IsTrue node) {
940 visitReference(node.value); 941 visitReference(node.value);
941 } 942 }
942 943
943 } 944 }
944 945
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698