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

Side by Side Diff: pkg/compiler/lib/src/constants/evaluation.dart

Issue 2595493002: Merge CoreTypes and CoreClasses into CommonElements. (Closed)
Patch Set: Updated cf. comment 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
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.constants.evaluation; 5 library dart2js.constants.evaluation;
6 6
7 import '../compiler.dart' show Compiler; 7 import '../compiler.dart' show Compiler;
8 import '../universe/call_structure.dart' show CallStructure; 8 import '../universe/call_structure.dart' show CallStructure;
9 import 'expressions.dart'; 9 import 'expressions.dart';
10 10
11 /// Environment used for evaluating constant expressions. 11 /// Environment used for evaluating constant expressions.
12 abstract class Environment { 12 abstract class Environment {
13 // TODO(johnniwinther): Replace this with [CoreTypes] and maybe [Backend]. 13 // TODO(johnniwinther): Replace this with [CommonElements] and maybe
14 // [Backend].
14 Compiler get compiler; 15 Compiler get compiler;
15 16
16 /// Read environments string passed in using the '-Dname=value' option. 17 /// Read environments string passed in using the '-Dname=value' option.
17 String readFromEnvironment(String name); 18 String readFromEnvironment(String name);
18 } 19 }
19 20
20 /// The normalized arguments passed to a const constructor computed from the 21 /// The normalized arguments passed to a const constructor computed from the
21 /// actual [arguments] and the [defaultValues] of the called construrctor. 22 /// actual [arguments] and the [defaultValues] of the called construrctor.
22 class NormalizedArguments { 23 class NormalizedArguments {
23 final Map<dynamic /*int|String*/, ConstantExpression> defaultValues; 24 final Map<dynamic /*int|String*/, ConstantExpression> defaultValues;
(...skipping 14 matching lines...) Expand all
38 39
39 /// Returns the normalized [index]th positional argument. 40 /// Returns the normalized [index]th positional argument.
40 ConstantExpression getPositionalArgument(int index) { 41 ConstantExpression getPositionalArgument(int index) {
41 if (index >= callStructure.positionalArgumentCount) { 42 if (index >= callStructure.positionalArgumentCount) {
42 // The positional argument is not provided. 43 // The positional argument is not provided.
43 return defaultValues[index]; 44 return defaultValues[index];
44 } 45 }
45 return arguments[index]; 46 return arguments[index];
46 } 47 }
47 } 48 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constant_system_dart.dart ('k') | pkg/compiler/lib/src/constants/expressions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698