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

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

Issue 2595583002: Remove StatementType (Closed)
Patch Set: Updated cf. comment Created 3 years, 12 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 '../dart_types.dart'; 10 import '../dart_types.dart';
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 ClassElement cls = builder.backend.helpers.RuntimeFunctionType; 302 ClassElement cls = builder.backend.helpers.RuntimeFunctionType;
303 builder.push( 303 builder.push(
304 new HFunctionType(inputs, type, new TypeMask.exact(cls, closedWorld))); 304 new HFunctionType(inputs, type, new TypeMask.exact(cls, closedWorld)));
305 } 305 }
306 306
307 void visitMalformedType(MalformedType type, GraphBuilder builder) { 307 void visitMalformedType(MalformedType type, GraphBuilder builder) {
308 visitDynamicType(const DynamicType(), builder); 308 visitDynamicType(const DynamicType(), builder);
309 } 309 }
310 310
311 void visitStatementType(StatementType type, GraphBuilder builder) {
312 throw 'not implemented visitStatementType($type)';
313 }
314
315 void visitInterfaceType(InterfaceType type, GraphBuilder builder) { 311 void visitInterfaceType(InterfaceType type, GraphBuilder builder) {
316 List<HInstruction> inputs = <HInstruction>[]; 312 List<HInstruction> inputs = <HInstruction>[];
317 for (DartType typeArgument in type.typeArguments) { 313 for (DartType typeArgument in type.typeArguments) {
318 typeArgument.accept(this, builder); 314 typeArgument.accept(this, builder);
319 inputs.add(builder.pop()); 315 inputs.add(builder.pop());
320 } 316 }
321 ClassElement cls; 317 ClassElement cls;
322 if (type.typeArguments.isEmpty) { 318 if (type.typeArguments.isEmpty) {
323 cls = builder.backend.helpers.RuntimeTypePlain; 319 cls = builder.backend.helpers.RuntimeTypePlain;
324 } else { 320 } else {
325 cls = builder.backend.helpers.RuntimeTypeGeneric; 321 cls = builder.backend.helpers.RuntimeTypeGeneric;
326 } 322 }
327 builder.push( 323 builder.push(
328 new HInterfaceType(inputs, type, new TypeMask.exact(cls, closedWorld))); 324 new HInterfaceType(inputs, type, new TypeMask.exact(cls, closedWorld)));
329 } 325 }
330 326
331 void visitTypedefType(TypedefType type, GraphBuilder builder) { 327 void visitTypedefType(TypedefType type, GraphBuilder builder) {
332 DartType unaliased = type.unaliased; 328 DartType unaliased = type.unaliased;
333 if (unaliased is TypedefType) throw 'unable to unalias $type'; 329 if (unaliased is TypedefType) throw 'unable to unalias $type';
334 unaliased.accept(this, builder); 330 unaliased.accept(this, builder);
335 } 331 }
336 332
337 void visitDynamicType(DynamicType type, GraphBuilder builder) { 333 void visitDynamicType(DynamicType type, GraphBuilder builder) {
338 JavaScriptBackend backend = builder.compiler.backend; 334 JavaScriptBackend backend = builder.compiler.backend;
339 ClassElement cls = backend.helpers.DynamicRuntimeType; 335 ClassElement cls = backend.helpers.DynamicRuntimeType;
340 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); 336 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld)));
341 } 337 }
342 } 338 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/serialization/type_serialization.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698