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

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

Issue 2742283002: Add ConstantUse to WorldImpact (Closed)
Patch Set: Cleanup. Created 3 years, 9 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/type_variable_handler.dart
diff --git a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
index fc24665ae6ac60866ed409ae662365023cbfb14e..b1782ee1948ae7959facc17b24ad1fa38bf83753 100644
--- a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
+++ b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
@@ -12,6 +12,7 @@ import '../js/js.dart' as jsAst;
import '../js_emitter/js_emitter.dart'
show CodeEmitterTask, MetadataCollector, Placeholder;
import '../universe/call_structure.dart' show CallStructure;
+import '../universe/use.dart' show ConstantUse;
import '../universe/world_impact.dart';
import 'backend.dart';
import 'backend_usage.dart' show BackendUsageBuilder;
@@ -79,7 +80,7 @@ class TypeVariableHandler {
new Map<TypeVariableElement, jsAst.Expression>();
/// Impact builder used for the codegen world computation.
- final StagedWorldImpactBuilder impactBuilderForCodegen =
+ final StagedWorldImpactBuilder _impactBuilder =
new StagedWorldImpactBuilder();
TypeVariableHandler(this._backend, this._helpers, this._mirrorsData);
@@ -90,7 +91,7 @@ class TypeVariableHandler {
/// Compute the [WorldImpact] for the type variables registered since last
/// flush.
WorldImpact flush() {
- return impactBuilderForCodegen.flush();
+ return _impactBuilder.flush();
}
void registerClassWithTypeVariables(ClassElement cls) {
@@ -124,10 +125,8 @@ class TypeVariableHandler {
_backend.constants.evaluate(constant);
ConstantValue value = _backend.constants.getConstantValue(constant);
- _backend.computeImpactForCompileTimeConstant(
- value, impactBuilderForCodegen,
- forResolution: false);
- _backend.addCompileTimeConstantForEmission(value);
+ _impactBuilder
+ .registerConstantUse(new ConstantUse.typeVariableMirror(value));
constants
.add(_reifyTypeVariableConstant(value, currentTypeVariable.element));
}

Powered by Google App Engine
This is Rietveld 408576698