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

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

Issue 1305863010: dart2js cps: Store the TypeMask for each primitive in a field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 3 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.share_interceptors; 5 library dart2js.cps_ir.share_interceptors;
6 6
7 import 'cps_ir_nodes.dart'; 7 import 'cps_ir_nodes.dart';
8 import 'optimizers.dart'; 8 import 'optimizers.dart';
9 import 'type_mask_system.dart';
10 import '../elements/elements.dart';
9 import '../constants/values.dart'; 11 import '../constants/values.dart';
10 12
11 /// Merges calls to `getInterceptor` when one call dominates the other. 13 /// Merges calls to `getInterceptor` when one call is in scope of the other.
14 ///
15 /// Also replaces `getInterceptor` calls with an interceptor constant when
16 /// the result is known statically, and there is no interceptor already in
17 /// scope.
12 /// 18 ///
13 /// Should run after [LoopInvariantCodeMotion] so interceptors lifted out from 19 /// Should run after [LoopInvariantCodeMotion] so interceptors lifted out from
14 /// loops can be merged. 20 /// loops can be merged.
15 class ShareInterceptors extends RecursiveVisitor implements Pass { 21 class ShareInterceptors extends RecursiveVisitor implements Pass {
16 String get passName => 'Share interceptors'; 22 String get passName => 'Share interceptors';
17 23
18 final Map<Primitive, Primitive> interceptorFor = 24 final Map<Primitive, Primitive> interceptorFor =
19 <Primitive, Primitive>{}; 25 <Primitive, Primitive>{};
20 26
21 final Map<ConstantValue, Primitive> sharedConstantFor = 27 final Map<ConstantValue, Primitive> sharedConstantFor =
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return node.body; 89 return node.body;
84 } 90 }
85 91
86 Expression getEnclosingExpression(Node node) { 92 Expression getEnclosingExpression(Node node) {
87 while (node is! Expression) { 93 while (node is! Expression) {
88 node = node.parent; 94 node = node.parent;
89 } 95 }
90 return node; 96 return node;
91 } 97 }
92 } 98 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/scalar_replacement.dart ('k') | pkg/compiler/lib/src/cps_ir/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698