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

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

Issue 2616653003: Use elements/types.dart in codegen.dart (Closed)
Patch Set: Created 3 years, 11 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 '../closure.dart'; 5 import '../closure.dart';
6 import '../common.dart'; 6 import '../common.dart';
7 import '../common/codegen.dart' show CodegenRegistry; 7 import '../common/codegen.dart' show CodegenRegistry;
8 import '../compiler.dart'; 8 import '../compiler.dart';
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../elements/resolution_types.dart'; 10 import '../elements/resolution_types.dart';
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 // TODO(karlklose): this is needed to avoid a bug where the resolved type is 217 // TODO(karlklose): this is needed to avoid a bug where the resolved type is
218 // not stored on a type annotation in the closure translator. Remove when 218 // not stored on a type annotation in the closure translator. Remove when
219 // fixed. 219 // fixed.
220 bool hasDirectLocal(Local local) { 220 bool hasDirectLocal(Local local) {
221 return !localsHandler.isAccessedDirectly(local) || 221 return !localsHandler.isAccessedDirectly(local) ||
222 localsHandler.directLocals[local] != null; 222 localsHandler.directLocals[local] != null;
223 } 223 }
224 224
225 HInstruction callSetRuntimeTypeInfoWithTypeArguments( 225 HInstruction callSetRuntimeTypeInfoWithTypeArguments(
226 DartType type, List<HInstruction> rtiInputs, HInstruction newObject) { 226 InterfaceType type, List<HInstruction> rtiInputs, HInstruction newObject) {
227 if (!backend.classNeedsRti(type.element)) { 227 if (!backend.classNeedsRti(type.element)) {
228 return newObject; 228 return newObject;
229 } 229 }
230 230
231 HInstruction typeInfo = new HTypeInfoExpression( 231 HInstruction typeInfo = new HTypeInfoExpression(
232 TypeInfoExpressionKind.INSTANCE, 232 TypeInfoExpressionKind.INSTANCE,
233 (type.element as ClassElement).thisType, 233 type.asRaw(),
234 rtiInputs, 234 rtiInputs,
235 closedWorld.commonMasks.dynamicType); 235 closedWorld.commonMasks.dynamicType);
236 add(typeInfo); 236 add(typeInfo);
237 return callSetRuntimeTypeInfo(typeInfo, newObject); 237 return callSetRuntimeTypeInfo(typeInfo, newObject);
238 } 238 }
239 239
240 HInstruction callSetRuntimeTypeInfo( 240 HInstruction callSetRuntimeTypeInfo(
241 HInstruction typeInfo, HInstruction newObject); 241 HInstruction typeInfo, HInstruction newObject);
242 242
243 /// The element for which this SSA builder is being used. 243 /// The element for which this SSA builder is being used.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 if (unaliased is TypedefType) throw 'unable to unalias $type'; 329 if (unaliased is TypedefType) throw 'unable to unalias $type';
330 unaliased.accept(this, builder); 330 unaliased.accept(this, builder);
331 } 331 }
332 332
333 void visitDynamicType(DynamicType type, GraphBuilder builder) { 333 void visitDynamicType(DynamicType type, GraphBuilder builder) {
334 JavaScriptBackend backend = builder.compiler.backend; 334 JavaScriptBackend backend = builder.compiler.backend;
335 ClassElement cls = backend.helpers.DynamicRuntimeType; 335 ClassElement cls = backend.helpers.DynamicRuntimeType;
336 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); 336 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld)));
337 } 337 }
338 } 338 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698