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

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

Issue 2349163003: Move towards using WorldImpact for codegen (Closed)
Patch Set: Reinsert missing features uses. Created 4 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: pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
diff --git a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
index 11ff3c94415dfa6040d433b1d2c9c8e1aca0e321..807bcb95cedcb12c590189f40c2386ecb0c40a4c 100644
--- a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
@@ -8,6 +8,8 @@ import '../dart_types.dart';
import '../elements/elements.dart';
import '../enqueue.dart' show Enqueuer;
import '../universe/use.dart' show StaticUse;
+import '../universe/world_impact.dart'
+ show WorldImpact, StagedWorldImpactBuilder;
import 'backend.dart';
/**
@@ -130,6 +132,8 @@ class CustomElementsAnalysisJoin {
final JavaScriptBackend backend;
Compiler get compiler => backend.compiler;
+ final StagedWorldImpactBuilder impactBuilder = new StagedWorldImpactBuilder();
+
// Classes that are candidates for needing constructors. Classes are moved to
// [activeClasses] when we know they need constructors.
final instantiatedClasses = new Set<ClassElement>();
@@ -171,13 +175,14 @@ class CustomElementsAnalysisJoin {
// Force the generaton of the type constant that is the key to an entry
// in the generated table.
ConstantValue constant = makeTypeConstant(classElement);
- backend.registerCompileTimeConstant(
- constant, compiler.globalDependencies);
+ backend.computeImpactForCompileTimeConstant(
+ constant, impactBuilder, false);
backend.addCompileTimeConstantForEmission(constant);
}
}
activeClasses.addAll(newActiveClasses);
instantiatedClasses.removeAll(newActiveClasses);
+ enqueuer.applyImpact(null, impactBuilder.flush());
}
TypeConstantValue makeTypeConstant(ClassElement element) {
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_impact.dart ('k') | pkg/compiler/lib/src/js_backend/js_interop_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698