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

Side by Side Diff: pkg/compiler/lib/src/js_backend/type_variable_handler.dart

Issue 2378063002: Remove Enqueuer argument from Backend.registerStaticUse (Closed)
Patch Set: Updated cf. comments. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import '../common.dart'; 5 import '../common.dart';
6 import '../common/registry.dart' show Registry; 6 import '../common/registry.dart' show Registry;
7 import '../compiler.dart' show Compiler; 7 import '../compiler.dart' show Compiler;
8 import '../constants/expressions.dart'; 8 import '../constants/expressions.dart';
9 import '../constants/values.dart'; 9 import '../constants/values.dart';
10 import '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 final StagedWorldImpactBuilder impactBuilder = new StagedWorldImpactBuilder(); 50 final StagedWorldImpactBuilder impactBuilder = new StagedWorldImpactBuilder();
51 51
52 TypeVariableHandler(this._compiler); 52 TypeVariableHandler(this._compiler);
53 53
54 ClassElement get _typeVariableClass => _backend.helpers.typeVariableClass; 54 ClassElement get _typeVariableClass => _backend.helpers.typeVariableClass;
55 CodeEmitterTask get _task => _backend.emitter; 55 CodeEmitterTask get _task => _backend.emitter;
56 MetadataCollector get _metadataCollector => _task.metadataCollector; 56 MetadataCollector get _metadataCollector => _task.metadataCollector;
57 JavaScriptBackend get _backend => _compiler.backend; 57 JavaScriptBackend get _backend => _compiler.backend;
58 DiagnosticReporter get reporter => _compiler.reporter; 58 DiagnosticReporter get reporter => _compiler.reporter;
59 59
60 void onQueueEmpty(Enqueuer enqueuer) { 60 /// Compute the [WorldImpact] for the type variables registered since last
61 if (enqueuer.isResolutionQueue) return; 61 /// flush.
62 62 WorldImpact flush({bool forResolution}) {
63 enqueuer.applyImpact(null, impactBuilder.flush()); 63 if (forResolution) return const WorldImpact();
64 return impactBuilder.flush();
64 } 65 }
65 66
66 void registerClassWithTypeVariables( 67 void registerClassWithTypeVariables(
67 ClassElement cls, Enqueuer enqueuer, Registry registry) { 68 ClassElement cls, Enqueuer enqueuer, Registry registry) {
68 if (enqueuer.isResolutionQueue) { 69 if (enqueuer.isResolutionQueue) {
69 // On first encounter, we have to ensure that the support classes get 70 // On first encounter, we have to ensure that the support classes get
70 // resolved. 71 // resolved.
71 if (!_seenClassesWithTypeVariables) { 72 if (!_seenClassesWithTypeVariables) {
72 _backend.enqueueClass(enqueuer, _typeVariableClass, registry); 73 _backend.enqueueClass(enqueuer, _typeVariableClass, registry);
73 _typeVariableClass.ensureResolved(_compiler.resolution); 74 _typeVariableClass.ensureResolved(_compiler.resolution);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 169 }
169 170
170 List<jsAst.Expression> typeVariablesOf(ClassElement classElement) { 171 List<jsAst.Expression> typeVariablesOf(ClassElement classElement) {
171 List<jsAst.Expression> result = _typeVariables[classElement]; 172 List<jsAst.Expression> result = _typeVariables[classElement];
172 if (result == null) { 173 if (result == null) {
173 result = const <jsAst.Expression>[]; 174 result = const <jsAst.Expression>[];
174 } 175 }
175 return result; 176 return result;
176 } 177 }
177 } 178 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698