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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 2684783003: Refactor ConstantSystem (Closed)
Patch Set: Updated cf. comments. Created 3 years, 10 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
« no previous file with comments | « pkg/compiler/lib/src/common/backend_api.dart ('k') | pkg/compiler/lib/src/constant_system_dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index 3e14c92d1a80b61563ede308dd8cd7226762f114..bcb4613c46e293399ebcdf956823b4fcbc691270 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -4,6 +4,7 @@
library dart2js.compile_time_constant_evaluator;
+import 'common/backend_api.dart' show BackendClasses;
import 'common/resolution.dart' show Resolution;
import 'common/tasks.dart' show CompilerTask, Measurer;
import 'common.dart';
@@ -506,7 +507,11 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
node,
new MapConstantExpression(type, keyExpressions, valueExpressions),
constantSystem.createMap(
- compiler, type, keyValues, map.values.toList()));
+ compiler.commonElements,
+ compiler.backend.backendClasses,
+ type,
+ keyValues,
+ map.values.toList()));
}
AstConstant visitLiteralNull(LiteralNull node) {
@@ -601,7 +606,8 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
}
ConstantValue makeTypeConstant(ResolutionDartType elementType) {
- return constantSystem.createType(compiler, elementType);
+ return constantSystem.createType(
+ compiler.commonElements, compiler.backend.backendClasses, elementType);
}
/// Returns true if the prefix of the send resolves to a deferred import
@@ -1442,13 +1448,19 @@ class ErroneousAstConstant extends AstConstant {
}
class _CompilerEnvironment implements Environment {
- final Compiler compiler;
+ final Compiler _compiler;
+
+ _CompilerEnvironment(this._compiler);
- _CompilerEnvironment(this.compiler);
+ @override
+ BackendClasses get backendClasses => _compiler.backend.backendClasses;
+
+ @override
+ CommonElements get commonElements => _compiler.commonElements;
@override
String readFromEnvironment(String name) {
- return compiler.fromEnvironment(name);
+ return _compiler.fromEnvironment(name);
}
@override
« no previous file with comments | « pkg/compiler/lib/src/common/backend_api.dart ('k') | pkg/compiler/lib/src/constant_system_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698