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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/eagerly_load_statics.dart

Issue 2221893003: pkg/compiler: fix imports (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.cps_ir.eagerly_load_statics; 5 library dart2js.cps_ir.eagerly_load_statics;
6 6
7 import '../elements/elements.dart';
8 import 'cps_fragment.dart';
7 import 'cps_ir_nodes.dart'; 9 import 'cps_ir_nodes.dart';
8 import 'optimizers.dart' show Pass; 10 import 'optimizers.dart' show Pass;
9 import '../elements/elements.dart';
10 import 'cps_fragment.dart';
11 11
12 /// Replaces [GetLazyStatic] with [GetStatic] when the static field is known 12 /// Replaces [GetLazyStatic] with [GetStatic] when the static field is known
13 /// to have been initialized. 13 /// to have been initialized.
14 /// 14 ///
15 /// Apart from [GetStatic] generating better code, this improves the side-effect 15 /// Apart from [GetStatic] generating better code, this improves the side-effect
16 /// analysis in the [GVN] pass, since [GetStatic] has no effects. 16 /// analysis in the [GVN] pass, since [GetStatic] has no effects.
17 class EagerlyLoadStatics extends TrampolineRecursiveVisitor implements Pass { 17 class EagerlyLoadStatics extends TrampolineRecursiveVisitor implements Pass {
18 String get passName => 'Eagerly load statics'; 18 String get passName => 'Eagerly load statics';
19 19
20 Map<FieldElement, Primitive> initializerFor = <FieldElement, Primitive>{}; 20 Map<FieldElement, Primitive> initializerFor = <FieldElement, Primitive>{};
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 node.replaceWith(newNode); 67 node.replaceWith(newNode);
68 } else { 68 } else {
69 initializerFor[node.element] = node; 69 initializerFor[node.element] = node;
70 } 70 }
71 } 71 }
72 72
73 void visitSetStatic(SetStatic node) { 73 void visitSetStatic(SetStatic node) {
74 initializerFor.putIfAbsent(node.element, () => node); 74 initializerFor.putIfAbsent(node.element, () => node);
75 } 75 }
76 } 76 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart ('k') | pkg/compiler/lib/src/cps_ir/effects.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698