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

Side by Side Diff: pkg/compiler/lib/src/constant_system_dart.dart

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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) 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 library dart2js.constant_system.dart; 5 library dart2js.constant_system.dart;
6 6
7 import 'compiler.dart' show 7 import 'compiler.dart' show
8 Compiler; 8 Compiler;
9 import 'constants/constant_system.dart'; 9 import 'constants/constant_system.dart';
10 import 'constants/values.dart'; 10 import 'constants/values.dart';
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 List<ConstantValue> values) { 427 List<ConstantValue> values) {
428 return new MapConstantValue(type, keys, values); 428 return new MapConstantValue(type, keys, values);
429 } 429 }
430 430
431 @override 431 @override
432 ConstantValue createType(Compiler compiler, DartType type) { 432 ConstantValue createType(Compiler compiler, DartType type) {
433 // TODO(johnniwinther): Change the `Type` type to 433 // TODO(johnniwinther): Change the `Type` type to
434 // `compiler.coreTypes.typeType` and check the backend specific value in 434 // `compiler.coreTypes.typeType` and check the backend specific value in
435 // [checkConstMapKeysDontOverrideEquals] in 'members.dart'. 435 // [checkConstMapKeysDontOverrideEquals] in 'members.dart'.
436 return new TypeConstantValue(type, 436 return new TypeConstantValue(type,
437 compiler.backend.typeImplementation.computeType(compiler)); 437 compiler.backend.typeImplementation.computeType(compiler.resolution));
438 } 438 }
439 439
440 bool isInt(ConstantValue constant) => constant.isInt; 440 bool isInt(ConstantValue constant) => constant.isInt;
441 bool isDouble(ConstantValue constant) => constant.isDouble; 441 bool isDouble(ConstantValue constant) => constant.isDouble;
442 bool isString(ConstantValue constant) => constant.isString; 442 bool isString(ConstantValue constant) => constant.isString;
443 bool isBool(ConstantValue constant) => constant.isBool; 443 bool isBool(ConstantValue constant) => constant.isBool;
444 bool isNull(ConstantValue constant) => constant.isNull; 444 bool isNull(ConstantValue constant) => constant.isNull;
445 445
446 bool isSubtype(DartTypes types, DartType s, DartType t) { 446 bool isSubtype(DartTypes types, DartType s, DartType t) {
447 return types.isSubtype(s, t); 447 return types.isSubtype(s, t);
448 } 448 }
449 } 449 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698