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

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

Issue 1408193009: dart2js cps_ir: propagate constant field values (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/native_helper.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library dart2js.cps_ir.type_propagation; 4 library dart2js.cps_ir.type_propagation;
5 5
6 import 'optimizers.dart'; 6 import 'optimizers.dart';
7 7
8 import '../closure.dart' show 8 import '../closure.dart' show
9 ClosureClassElement; 9 ClosureClassElement;
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 3009 matching lines...) Expand 10 before | Expand all | Expand 10 after
3020 // TODO(asgerf): Add the NullInterceptor when it enables us to 3020 // TODO(asgerf): Add the NullInterceptor when it enables us to
3021 // propagate an assignment. 3021 // propagate an assignment.
3022 setValue(node, nonConstant()); 3022 setValue(node, nonConstant());
3023 } else { 3023 } else {
3024 setValue(node, nonConstant(typeSystem.nonNullType)); 3024 setValue(node, nonConstant(typeSystem.nonNullType));
3025 } 3025 }
3026 } 3026 }
3027 3027
3028 void visitGetField(GetField node) { 3028 void visitGetField(GetField node) {
3029 node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull; 3029 node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
3030 setValue(node, nonConstant(typeSystem.getFieldType(node.field))); 3030 setValue(node, lattice.fromMask(typeSystem.getFieldType(node.field)));
3031 } 3031 }
3032 3032
3033 void visitSetField(SetField node) {} 3033 void visitSetField(SetField node) {}
3034 3034
3035 void visitCreateBox(CreateBox node) { 3035 void visitCreateBox(CreateBox node) {
3036 setValue(node, nonConstant(typeSystem.nonNullType)); 3036 setValue(node, nonConstant(typeSystem.nonNullType));
3037 } 3037 }
3038 3038
3039 void visitCreateInstance(CreateInstance node) { 3039 void visitCreateInstance(CreateInstance node) {
3040 setValue(node, nonConstant(typeSystem.nonNullExact(node.classElement.declara tion))); 3040 setValue(node, nonConstant(typeSystem.nonNullExact(node.classElement.declara tion)));
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
3230 processLetPrim(LetPrim node) { 3230 processLetPrim(LetPrim node) {
3231 node.primitive.type = null; 3231 node.primitive.type = null;
3232 values[node.primitive] = null; 3232 values[node.primitive] = null;
3233 } 3233 }
3234 3234
3235 processLetMutable(LetMutable node) { 3235 processLetMutable(LetMutable node) {
3236 node.variable.type = null; 3236 node.variable.type = null;
3237 values[node.variable] = null; 3237 values[node.variable] = null;
3238 } 3238 }
3239 } 3239 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/native_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698