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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart

Issue 1136843006: dart2js cps: Access to lazily initialized fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 7 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) 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 library tree_ir_builder; 5 library tree_ir_builder;
6 6
7 import '../dart2jslib.dart' as dart2js; 7 import '../dart2jslib.dart' as dart2js;
8 import '../dart_types.dart'; 8 import '../dart_types.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; 10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 Node visitTypeExpression(cps_ir.TypeExpression node) { 660 Node visitTypeExpression(cps_ir.TypeExpression node) {
661 return new TypeExpression( 661 return new TypeExpression(
662 node.dartType, 662 node.dartType,
663 node.arguments.map(getVariableUse).toList()); 663 node.arguments.map(getVariableUse).toList());
664 } 664 }
665 665
666 Expression visitGetStatic(cps_ir.GetStatic node) { 666 Expression visitGetStatic(cps_ir.GetStatic node) {
667 return new GetStatic(node.element, node.sourceInformation); 667 return new GetStatic(node.element, node.sourceInformation);
668 } 668 }
669 669
670 Statement visitGetLazyStatic(cps_ir.GetLazyStatic node) {
671 // In the tree IR, GetStatic handles lazy fields because tree
672 // expressions are allowed to have side effects.
673 GetStatic value = new GetStatic(node.element, node.sourceInformation);
674 return continueWithExpression(node.continuation, value);
675 }
676
670 Statement visitSetStatic(cps_ir.SetStatic node) { 677 Statement visitSetStatic(cps_ir.SetStatic node) {
671 SetStatic setStatic = new SetStatic( 678 SetStatic setStatic = new SetStatic(
672 node.element, 679 node.element,
673 getVariableUse(node.value), 680 getVariableUse(node.value),
674 node.sourceInformation); 681 node.sourceInformation);
675 return new ExpressionStatement(setStatic, visit(node.body)); 682 return new ExpressionStatement(setStatic, visit(node.body));
676 } 683 }
677 } 684 }
678 685
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/task.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698