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

Side by Side Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 2577423002: Further reduce use of Compiler.closedWorld. (Closed)
Patch Set: Created 4 years 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 | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/types/constants.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import '../closure.dart'; 5 import '../closure.dart';
6 import '../common.dart'; 6 import '../common.dart';
7 import '../common/backend_api.dart' show BackendClasses; 7 import '../common/backend_api.dart' show BackendClasses;
8 import '../compiler.dart' show Compiler; 8 import '../compiler.dart' show Compiler;
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 HConstant addConstant(ConstantValue constant, Compiler compiler, 210 HConstant addConstant(ConstantValue constant, Compiler compiler,
211 {SourceInformation sourceInformation}) { 211 {SourceInformation sourceInformation}) {
212 HConstant result = constants[constant]; 212 HConstant result = constants[constant];
213 // TODO(johnniwinther): Support source information per constant reference. 213 // TODO(johnniwinther): Support source information per constant reference.
214 if (result == null) { 214 if (result == null) {
215 if (!constant.isConstant) { 215 if (!constant.isConstant) {
216 // We use `null` as the value for invalid constant expressions. 216 // We use `null` as the value for invalid constant expressions.
217 constant = const NullConstantValue(); 217 constant = const NullConstantValue();
218 } 218 }
219 TypeMask type = computeTypeMask(compiler, constant); 219 TypeMask type =
220 computeTypeMask(compiler.closedWorld, compiler.backend, constant);
220 result = new HConstant.internal(constant, type) 221 result = new HConstant.internal(constant, type)
221 ..sourceInformation = sourceInformation; 222 ..sourceInformation = sourceInformation;
222 entry.addAtExit(result); 223 entry.addAtExit(result);
223 constants[constant] = result; 224 constants[constant] = result;
224 } else if (result.block == null) { 225 } else if (result.block == null) {
225 // The constant was not used anymore. 226 // The constant was not used anymore.
226 entry.addAtExit(result); 227 entry.addAtExit(result);
227 } 228 }
228 return result; 229 return result;
229 } 230 }
(...skipping 3217 matching lines...) Expand 10 before | Expand all | Expand 10 after
3447 class HDynamicType extends HRuntimeType { 3448 class HDynamicType extends HRuntimeType {
3448 HDynamicType(DynamicType dartType, TypeMask instructionType) 3449 HDynamicType(DynamicType dartType, TypeMask instructionType)
3449 : super(const <HInstruction>[], dartType, instructionType); 3450 : super(const <HInstruction>[], dartType, instructionType);
3450 3451
3451 accept(HVisitor visitor) => visitor.visitDynamicType(this); 3452 accept(HVisitor visitor) => visitor.visitDynamicType(this);
3452 3453
3453 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; 3454 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE;
3454 3455
3455 bool typeEquals(HInstruction other) => other is HDynamicType; 3456 bool typeEquals(HInstruction other) => other is HDynamicType;
3456 } 3457 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/types/constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698