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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1411783005: Remove [addForEmission] parameter from [registerCompileTimeConstant] (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 4d4490cf6b4946a24eb7fb6fbc6c13d5cc1229e2..d13892965e660baee1268a07c65d76aa5a34826d 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -979,8 +979,7 @@ class JavaScriptBackend extends Backend {
}
}
- void registerCompileTimeConstant(ConstantValue constant, Registry registry,
- {bool addForEmission: true}) {
+ void registerCompileTimeConstant(ConstantValue constant, Registry registry) {
registerCompileTimeConstantInternal(constant, registry);
if (!registry.isForResolution &&
@@ -991,11 +990,12 @@ class JavaScriptBackend extends Backend {
}
for (ConstantValue dependency in constant.getDependencies()) {
- registerCompileTimeConstant(dependency, registry,
- addForEmission: false);
+ registerCompileTimeConstant(dependency, registry);
}
+ }
- if (addForEmission) constants.addCompileTimeConstantForEmission(constant);
+ void addCompileTimeConstantForEmission(ConstantValue constant) {
+ constants.addCompileTimeConstantForEmission(constant);
}
void registerCompileTimeConstantInternal(ConstantValue constant,
@@ -1039,7 +1039,7 @@ class JavaScriptBackend extends Backend {
Registry registry) {
assert(registry.isForResolution);
ConstantValue constant = constants.getConstantValueForMetadata(metadata);
- registerCompileTimeConstant(constant, registry, addForEmission: false);
+ registerCompileTimeConstant(constant, registry);
metadataConstants.add(new Dependency(constant, annotatedElement));
}
@@ -1574,6 +1574,7 @@ class JavaScriptBackend extends Backend {
constants.getConstantValueForVariable(element);
if (initialValue != null) {
registerCompileTimeConstant(initialValue, work.registry);
+ 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.
@@ -2501,16 +2502,14 @@ class JavaScriptBackend extends Backend {
registerCompileTimeConstant(
dependency.constant,
new EagerRegistry(compiler,
- dependency.annotatedElement.analyzableElement.treeElements),
- addForEmission: false);
+ dependency.annotatedElement.analyzableElement.treeElements));
}
} else {
for (Dependency dependency in metadataConstants) {
registerCompileTimeConstant(
dependency.constant,
new CodegenRegistry(compiler,
- dependency.annotatedElement.analyzableElement.treeElements),
- addForEmission: false);
+ dependency.annotatedElement.analyzableElement.treeElements));
}
metadataConstants.clear();
}
« no previous file with comments | « pkg/compiler/lib/src/common/codegen.dart ('k') | pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698