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

Unified Diff: sdk/lib/_internal/compiler/implementation/universe/universe.dart

Issue 574683002: Use ConstExp for storing constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/universe/universe.dart
diff --git a/sdk/lib/_internal/compiler/implementation/universe/universe.dart b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
index 896233cd430ee504c4d0d1a8fe6d76f705145156..b233a369e32cc2ce71c63711fbd7762d7845b549 100644
--- a/sdk/lib/_internal/compiler/implementation/universe/universe.dart
+++ b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
@@ -395,12 +395,12 @@ class Selector {
}
/**
- * Fills [list] with the arguments in a defined order.
+ * Fills [list] with the arguments in the normalized order.
*
* [compileArgument] is a function that returns a compiled version
* of an argument located in [arguments].
*
- * [compileConstant] is a function that returns a compiled constant
+ * [compileDefaultValue] is a function that returns a compiled constant
* of an optional argument that is not in [arguments].
*
* Returns [:true:] if the selector and the [element] match; [:false:]
@@ -408,28 +408,29 @@ class Selector {
*
* Invariant: [element] must be the implementation element.
*/
- bool addArgumentsToList(Link<Node> arguments,
- List list,
- FunctionElement element,
- compileArgument(Node argument),
- compileConstant(Element element),
- World world) {
+ /*<T>*/ bool addArgumentsToList(
+ Link<Node> arguments,
+ List/*<T>*/ list,
+ FunctionElement element,
+ /*T*/ compileArgument(Node argument),
+ /*T*/ compileDefaultValue(ParameterElement element),
+ World world) {
assert(invariant(element, element.isImplementation));
if (!this.applies(element, world)) return false;
FunctionSignature parameters = element.functionSignature;
- parameters.forEachRequiredParameter((element) {
+ parameters.forEachRequiredParameter((ParameterElement element) {
list.add(compileArgument(arguments.head));
arguments = arguments.tail;
});
if (!parameters.optionalParametersAreNamed) {
- parameters.forEachOptionalParameter((element) {
+ parameters.forEachOptionalParameter((ParameterElement element) {
if (!arguments.isEmpty) {
list.add(compileArgument(arguments.head));
arguments = arguments.tail;
} else {
- list.add(compileConstant(element));
+ list.add(compileDefaultValue(element));
}
});
} else {
@@ -442,12 +443,12 @@ class Selector {
// Iterate over the optional parameters of the signature, and try to
// find them in [compiledNamedArguments]. If found, we use the
// value in the temporary list, otherwise the default value.
- parameters.orderedOptionalParameters.forEach((element) {
+ parameters.orderedOptionalParameters.forEach((ParameterElement element) {
int foundIndex = namedArguments.indexOf(element.name);
if (foundIndex != -1) {
list.add(compiledNamedArguments[foundIndex]);
} else {
- list.add(compileConstant(element));
+ list.add(compileDefaultValue(element));
}
});
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/ssa.dart ('k') | tests/compiler/dart2js/backend_dart/opt_constprop_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698