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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 226953003: Revert "Compute frontend/backend specific constants." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/js_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 18395c182672783cf01350cbd0fd7fef3c1df733..64d62e5ddb59080d42670c5b33adced238e82dfa 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -52,6 +52,7 @@ class FunctionInlineCache {
}
}
+
class JavaScriptBackend extends Backend {
SsaBuilderTask builder;
SsaOptimizerTask optimizer;
@@ -287,30 +288,19 @@ class JavaScriptBackend extends Backend {
/// constructors for custom elements.
CustomElementsAnalysis customElementsAnalysis;
- JavaScriptConstantTask constantCompilerTask;
-
JavaScriptBackend(Compiler compiler, bool generateSourceMap)
: namer = determineNamer(compiler),
oneShotInterceptors = new Map<String, Selector>(),
interceptedElements = new Map<String, Set<Element>>(),
rti = new RuntimeTypes(compiler),
specializedGetInterceptors = new Map<String, Set<ClassElement>>(),
- super(compiler) {
+ super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) {
emitter = new CodeEmitterTask(compiler, namer, generateSourceMap);
builder = new SsaBuilderTask(this);
optimizer = new SsaOptimizerTask(this);
generator = new SsaCodeGeneratorTask(this);
typeVariableHandler = new TypeVariableHandler(this);
customElementsAnalysis = new CustomElementsAnalysis(this);
- constantCompilerTask = new JavaScriptConstantTask(compiler);
- }
-
- ConstantSystem get constantSystem => constants.constantSystem;
-
- /// Returns constant environment for the JavaScript interpretation of the
- /// constants.
- JavaScriptConstantCompiler get constants {
- return constantCompilerTask.jsConstantCompiler;
}
static Namer determineNamer(Compiler compiler) {
@@ -1152,10 +1142,12 @@ class JavaScriptBackend extends Backend {
return;
}
if (kind.category == ElementCategory.VARIABLE) {
- Constant initialValue = constants.getConstantForVariable(element);
+ Constant initialValue =
+ compiler.constantHandler.getConstantForVariable(element);
if (initialValue != null) {
registerCompileTimeConstant(initialValue, work.resolutionTree);
- constants.addCompileTimeConstantForEmission(initialValue);
+ compiler.constantHandler.addCompileTimeConstantForEmission(
+ initialValue);
// We don't need to generate code for static or top-level
// variables. For instance variables, we may need to generate
// the checked setter.
@@ -1615,8 +1607,8 @@ class JavaScriptBackend extends Backend {
if (mustRetainMetadata && isNeededForReflection(element)) {
for (MetadataAnnotation metadata in element.metadata) {
metadata.ensureResolved(compiler);
- Constant constant = constants.getConstantForMetadata(metadata);
- constants.addCompileTimeConstantForEmission(constant);
+ compiler.constantHandler.addCompileTimeConstantForEmission(
+ metadata.value);
}
return true;
}
@@ -1894,3 +1886,4 @@ class Dependency {
const Dependency(this.constant, this.user);
}
+

Powered by Google App Engine
This is Rietveld 408576698