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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart

Issue 1637843002: typeInformation in CreateInstance is a kind of TypeExpression (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 library dart2js.ir_builder; 5 library dart2js.ir_builder;
6 6
7 import '../closure.dart' as closure; 7 import '../closure.dart' as closure;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/names.dart' show 9 import '../common/names.dart' show
10 Names, 10 Names,
(...skipping 2394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 value = buildThis(); 2405 value = buildThis();
2406 } else if (field.local is closure.TypeVariableLocal) { 2406 } else if (field.local is closure.TypeVariableLocal) {
2407 closure.TypeVariableLocal variable = field.local; 2407 closure.TypeVariableLocal variable = field.local;
2408 value = buildTypeVariableAccess(variable.typeVariable); 2408 value = buildTypeVariableAccess(variable.typeVariable);
2409 } else { 2409 } else {
2410 value = environment.lookup(field.local); 2410 value = environment.lookup(field.local);
2411 } 2411 }
2412 arguments.add(value); 2412 arguments.add(value);
2413 } 2413 }
2414 return addPrimitive(new ir.CreateInstance( 2414 return addPrimitive(new ir.CreateInstance(
2415 classElement, arguments, const <ir.Primitive>[], sourceInformation)); 2415 classElement, arguments, null, sourceInformation));
2416 } 2416 }
2417 2417
2418 /// Create a read access of [local] function, variable, or parameter. 2418 /// Create a read access of [local] function, variable, or parameter.
2419 ir.Primitive buildLocalGet(LocalElement local) { 2419 ir.Primitive buildLocalGet(LocalElement local) {
2420 assert(isOpen); 2420 assert(isOpen);
2421 ClosureLocation location = state.boxedVariables[local]; 2421 ClosureLocation location = state.boxedVariables[local];
2422 if (location != null) { 2422 if (location != null) {
2423 ir.Primitive result = new ir.GetField(environment.lookup(location.box), 2423 ir.Primitive result = new ir.GetField(environment.lookup(location.box),
2424 location.field); 2424 location.field);
2425 result.useElementAsHint(local); 2425 result.useElementAsHint(local);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 ir.Primitive buildTypeExpression(DartType type) { 2571 ir.Primitive buildTypeExpression(DartType type) {
2572 type = program.unaliasType(type); 2572 type = program.unaliasType(type);
2573 if (type is TypeVariableType) { 2573 if (type is TypeVariableType) {
2574 return buildTypeVariableAccess(type); 2574 return buildTypeVariableAccess(type);
2575 } else if (type is InterfaceType || type is FunctionType) { 2575 } else if (type is InterfaceType || type is FunctionType) {
2576 List<ir.Primitive> arguments = <ir.Primitive>[]; 2576 List<ir.Primitive> arguments = <ir.Primitive>[];
2577 type.forEachTypeVariable((TypeVariableType variable) { 2577 type.forEachTypeVariable((TypeVariableType variable) {
2578 ir.Primitive value = buildTypeVariableAccess(variable); 2578 ir.Primitive value = buildTypeVariableAccess(variable);
2579 arguments.add(value); 2579 arguments.add(value);
2580 }); 2580 });
2581 return addPrimitive(new ir.TypeExpression(type, arguments)); 2581 return addPrimitive(new ir.TypeExpression(type, arguments, false));
2582 } else if (type.treatAsDynamic) { 2582 } else if (type.treatAsDynamic) {
2583 return buildNullConstant(); 2583 return buildNullConstant();
2584 } else { 2584 } else {
2585 // TypedefType can reach here, and possibly other things. 2585 // TypedefType can reach here, and possibly other things.
2586 throw 'unimplemented translation of type expression $type (${type.kind})'; 2586 throw 'unimplemented translation of type expression $type (${type.kind})';
2587 } 2587 }
2588 } 2588 }
2589 2589
2590 /// Obtains the internal type representation of the type held in [variable]. 2590 /// Obtains the internal type representation of the type held in [variable].
2591 /// 2591 ///
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
2838 } 2838 }
2839 2839
2840 class SwitchCaseInfo { 2840 class SwitchCaseInfo {
2841 final List<ir.Primitive> constants = <ir.Primitive>[]; 2841 final List<ir.Primitive> constants = <ir.Primitive>[];
2842 final SubbuildFunction buildBody; 2842 final SubbuildFunction buildBody;
2843 2843
2844 SwitchCaseInfo(this.buildBody); 2844 SwitchCaseInfo(this.buildBody);
2845 2845
2846 void addConstant(ir.Primitive constant) => constants.add(constant); 2846 void addConstant(ir.Primitive constant) => constants.add(constant);
2847 } 2847 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart » ('j') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698