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

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

Issue 2000323006: Make CompilerTask independent of compiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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.compile_time_constant_evaluator; 5 library dart2js.compile_time_constant_evaluator;
6 6
7 import 'common.dart'; 7 import 'common.dart';
8 import 'common/resolution.dart' show Resolution; 8 import 'common/resolution.dart' show Resolution;
9 import 'common/tasks.dart' show CompilerTask; 9 import 'common/tasks.dart' show CompilerTask, Measurer;
10 import 'compiler.dart' show Compiler; 10 import 'compiler.dart' show Compiler;
11 import 'constant_system_dart.dart'; 11 import 'constant_system_dart.dart';
12 import 'constants/constant_system.dart'; 12 import 'constants/constant_system.dart';
13 import 'constants/evaluation.dart'; 13 import 'constants/evaluation.dart';
14 import 'constants/expressions.dart'; 14 import 'constants/expressions.dart';
15 import 'constants/values.dart'; 15 import 'constants/values.dart';
16 import 'core_types.dart' show CoreTypes; 16 import 'core_types.dart' show CoreTypes;
17 import 'dart_types.dart'; 17 import 'dart_types.dart';
18 import 'elements/elements.dart'; 18 import 'elements/elements.dart';
19 import 'elements/modelx.dart' 19 import 'elements/modelx.dart'
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 ConstantExpression getConstantForNode(Node node, TreeElements elements); 103 ConstantExpression getConstantForNode(Node node, TreeElements elements);
104 104
105 /// Returns the compile-time constant value of [metadata]. 105 /// Returns the compile-time constant value of [metadata].
106 ConstantValue getConstantValueForMetadata(MetadataAnnotation metadata); 106 ConstantValue getConstantValueForMetadata(MetadataAnnotation metadata);
107 } 107 }
108 108
109 /// Interface for the task that compiles the constant environments for the 109 /// Interface for the task that compiles the constant environments for the
110 /// frontend and backend interpretation of compile-time constants. 110 /// frontend and backend interpretation of compile-time constants.
111 abstract class ConstantCompilerTask extends CompilerTask 111 abstract class ConstantCompilerTask extends CompilerTask
112 implements ConstantCompiler { 112 implements ConstantCompiler {
113 ConstantCompilerTask(Compiler compiler) : super(compiler); 113 ConstantCompilerTask(Measurer measurer) : super(measurer);
114 114
115 /// Copy all cached constant values from [task]. 115 /// Copy all cached constant values from [task].
116 /// 116 ///
117 /// This is a hack to support reuse cached compilers in memory_compiler. 117 /// This is a hack to support reuse cached compilers in memory_compiler.
118 // TODO(johnniwinther): Remove this when values are computed from the 118 // TODO(johnniwinther): Remove this when values are computed from the
119 // expressions. 119 // expressions.
120 void copyConstantValues(ConstantCompilerTask task); 120 void copyConstantValues(ConstantCompilerTask task);
121 } 121 }
122 122
123 /** 123 /**
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 class _CompilerEnvironment implements Environment { 1363 class _CompilerEnvironment implements Environment {
1364 final Compiler compiler; 1364 final Compiler compiler;
1365 1365
1366 _CompilerEnvironment(this.compiler); 1366 _CompilerEnvironment(this.compiler);
1367 1367
1368 @override 1368 @override
1369 String readFromEnvironment(String name) { 1369 String readFromEnvironment(String name) {
1370 return compiler.fromEnvironment(name); 1370 return compiler.fromEnvironment(name);
1371 } 1371 }
1372 } 1372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698