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

Side by Side Diff: pkg/compiler/lib/src/ssa/type_builder.dart

Issue 2989453002: Add support for compiling Dart via the FE in dart2js. (Closed)
Patch Set: update status Created 3 years, 5 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 'graph_builder.dart'; 5 import 'graph_builder.dart';
6 import 'nodes.dart'; 6 import 'nodes.dart';
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../types/types.dart'; 9 import '../types/types.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 TypeInfoExpressionKind.INSTANCE, 158 TypeInfoExpressionKind.INSTANCE,
159 builder.closedWorld.elementEnvironment.getThisType(interface.element), 159 builder.closedWorld.elementEnvironment.getThisType(interface.element),
160 inputs, 160 inputs,
161 builder.commonMasks.dynamicType); 161 builder.commonMasks.dynamicType);
162 return representation; 162 return representation;
163 } 163 }
164 164
165 /// Check that [type] is valid in the context of `localsHandler.contextClass`. 165 /// Check that [type] is valid in the context of `localsHandler.contextClass`.
166 /// This should only be called in assertions. 166 /// This should only be called in assertions.
167 bool assertTypeInContext(DartType type, [Spannable spannable]) { 167 bool assertTypeInContext(DartType type, [Spannable spannable]) {
168 if (builder.compiler.options.useKernel) return true; 168 if (builder.compiler.options.useKernelInSsa) return true;
169 if (builder.compiler.options.loadFromDill) return true;
170 ClassEntity contextClass = DartTypes.getClassContext(type); 169 ClassEntity contextClass = DartTypes.getClassContext(type);
171 assert( 170 assert(
172 contextClass == null || 171 contextClass == null ||
173 contextClass == builder.localsHandler.contextClass, 172 contextClass == builder.localsHandler.contextClass,
174 failedAt( 173 failedAt(
175 spannable ?? CURRENT_ELEMENT_SPANNABLE, 174 spannable ?? CURRENT_ELEMENT_SPANNABLE,
176 "Type '$type' is not valid context of " 175 "Type '$type' is not valid context of "
177 "${builder.localsHandler.contextClass}.")); 176 "${builder.localsHandler.contextClass}."));
178 return true; 177 return true;
179 } 178 }
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 analyzeTypeArgument(type, builder.sourceElement); 265 analyzeTypeArgument(type, builder.sourceElement);
267 // TypeMasks don't encode function types. 266 // TypeMasks don't encode function types.
268 TypeMask refinedMask = original.instructionType; 267 TypeMask refinedMask = original.instructionType;
269 return new HTypeConversion.withTypeRepresentation( 268 return new HTypeConversion.withTypeRepresentation(
270 type, kind, refinedMask, original, reifiedType); 269 type, kind, refinedMask, original, reifiedType);
271 } else { 270 } else {
272 return original.convertType(builder.closedWorld, type, kind); 271 return original.convertType(builder.closedWorld, type, kind);
273 } 272 }
274 } 273 }
275 } 274 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698