@@ -18,7 +18,6 @@ import '../js_backend/field_analysis.dart'
1818 show FieldAnalysisData, JFieldAnalysis;
1919import '../js_backend/backend.dart' show CodegenInputs;
2020import '../js_backend/native_data.dart' show NativeData;
21- import '../js_backend/runtime_types_codegen.dart' ;
2221import '../js_model/type_recipe.dart'
2322 show
2423 TypeRecipe,
@@ -89,37 +88,19 @@ class SsaOptimizerTask extends CompilerTask {
8988 List <OptimizationPhase > phases = < OptimizationPhase > [
9089 // Run trivial instruction simplification first to optimize
9190 // some patterns useful for type conversion.
92- new SsaInstructionSimplifier (
93- globalInferenceResults,
94- _options,
95- codegen.rtiSubstitutions,
96- closedWorld,
97- typeRecipeDomain,
98- registry,
99- log),
91+ new SsaInstructionSimplifier (globalInferenceResults, _options,
92+ closedWorld, typeRecipeDomain, registry, log),
10093 new SsaTypeConversionInserter (closedWorld),
10194 new SsaRedundantPhiEliminator (),
10295 new SsaDeadPhiEliminator (),
10396 new SsaTypePropagator (globalInferenceResults,
10497 closedWorld.commonElements, closedWorld, log),
10598 // After type propagation, more instructions can be
10699 // simplified.
107- new SsaInstructionSimplifier (
108- globalInferenceResults,
109- _options,
110- codegen.rtiSubstitutions,
111- closedWorld,
112- typeRecipeDomain,
113- registry,
114- log),
115- new SsaInstructionSimplifier (
116- globalInferenceResults,
117- _options,
118- codegen.rtiSubstitutions,
119- closedWorld,
120- typeRecipeDomain,
121- registry,
122- log),
100+ new SsaInstructionSimplifier (globalInferenceResults, _options,
101+ closedWorld, typeRecipeDomain, registry, log),
102+ new SsaInstructionSimplifier (globalInferenceResults, _options,
103+ closedWorld, typeRecipeDomain, registry, log),
123104 new SsaTypePropagator (globalInferenceResults,
124105 closedWorld.commonElements, closedWorld, log),
125106 // Run a dead code eliminator before LICM because dead
@@ -143,14 +124,8 @@ class SsaOptimizerTask extends CompilerTask {
143124 new SsaValueRangeAnalyzer (closedWorld, this ),
144125 // Previous optimizations may have generated new
145126 // opportunities for instruction simplification.
146- new SsaInstructionSimplifier (
147- globalInferenceResults,
148- _options,
149- codegen.rtiSubstitutions,
150- closedWorld,
151- typeRecipeDomain,
152- registry,
153- log),
127+ new SsaInstructionSimplifier (globalInferenceResults, _options,
128+ closedWorld, typeRecipeDomain, registry, log),
154129 ];
155130 phases.forEach (runPhase);
156131
@@ -171,14 +146,8 @@ class SsaOptimizerTask extends CompilerTask {
171146 new SsaGlobalValueNumberer (closedWorld.abstractValueDomain),
172147 new SsaCodeMotion (closedWorld.abstractValueDomain),
173148 new SsaValueRangeAnalyzer (closedWorld, this ),
174- new SsaInstructionSimplifier (
175- globalInferenceResults,
176- _options,
177- codegen.rtiSubstitutions,
178- closedWorld,
179- typeRecipeDomain,
180- registry,
181- log),
149+ new SsaInstructionSimplifier (globalInferenceResults, _options,
150+ closedWorld, typeRecipeDomain, registry, log),
182151 new SsaSimplifyInterceptors (closedWorld, member.enclosingClass),
183152 new SsaDeadCodeEliminator (closedWorld, this ),
184153 ];
@@ -188,14 +157,8 @@ class SsaOptimizerTask extends CompilerTask {
188157 closedWorld.commonElements, closedWorld, log),
189158 // Run the simplifier to remove unneeded type checks inserted by
190159 // type propagation.
191- new SsaInstructionSimplifier (
192- globalInferenceResults,
193- _options,
194- codegen.rtiSubstitutions,
195- closedWorld,
196- typeRecipeDomain,
197- registry,
198- log),
160+ new SsaInstructionSimplifier (globalInferenceResults, _options,
161+ closedWorld, typeRecipeDomain, registry, log),
199162 ];
200163 }
201164 phases.forEach (runPhase);
@@ -250,21 +213,14 @@ class SsaInstructionSimplifier extends HBaseVisitor
250213 final String name = "SsaInstructionSimplifier" ;
251214 final GlobalTypeInferenceResults _globalInferenceResults;
252215 final CompilerOptions _options;
253- final RuntimeTypesSubstitutions _rtiSubstitutions;
254216 final JClosedWorld _closedWorld;
255217 final TypeRecipeDomain _typeRecipeDomain;
256218 final CodegenRegistry _registry;
257219 final OptimizationTestLog _log;
258220 HGraph _graph;
259221
260- SsaInstructionSimplifier (
261- this ._globalInferenceResults,
262- this ._options,
263- this ._rtiSubstitutions,
264- this ._closedWorld,
265- this ._typeRecipeDomain,
266- this ._registry,
267- this ._log);
222+ SsaInstructionSimplifier (this ._globalInferenceResults, this ._options,
223+ this ._closedWorld, this ._typeRecipeDomain, this ._registry, this ._log);
268224
269225 JCommonElements get commonElements => _closedWorld.commonElements;
270226
@@ -1882,15 +1838,6 @@ class SsaInstructionSimplifier extends HBaseVisitor
18821838 return handleInterceptedCall (node);
18831839 }
18841840
1885- bool needsSubstitutionForTypeVariableAccess (ClassEntity cls) {
1886- if (_closedWorld.isUsedAsMixin (cls)) return true ;
1887-
1888- return _closedWorld.classHierarchy.anyStrictSubclassOf (cls,
1889- (ClassEntity subclass) {
1890- return ! _rtiSubstitutions.isTrivialSubstitution (subclass, cls);
1891- });
1892- }
1893-
18941841 @override
18951842 HInstruction visitTypeEval (HTypeEval node) {
18961843 HInstruction environment = node.inputs.single;
0 commit comments