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

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

Issue 2000223002: Revert "Adjusts dart2js backend to handle method type arguments." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 Selectors; 9 import '../common/names.dart' show Selectors;
10 import '../compile_time_constants.dart' show BackendConstantEnvironment; 10 import '../compile_time_constants.dart' show BackendConstantEnvironment;
(...skipping 2716 matching lines...) Expand 10 before | Expand all | Expand 10 after
2727 /// Creates a type test or type cast of [value] against [type]. 2727 /// Creates a type test or type cast of [value] against [type].
2728 ir.Primitive buildTypeOperator( 2728 ir.Primitive buildTypeOperator(
2729 ir.Primitive value, DartType type, SourceInformation sourceInformation, 2729 ir.Primitive value, DartType type, SourceInformation sourceInformation,
2730 {bool isTypeTest}) { 2730 {bool isTypeTest}) {
2731 assert(isOpen); 2731 assert(isOpen);
2732 assert(isTypeTest != null); 2732 assert(isTypeTest != null);
2733 2733
2734 type = program.unaliasType(type); 2734 type = program.unaliasType(type);
2735 2735
2736 if (type.isMalformed) { 2736 if (type.isMalformed) {
2737 String message; 2737 ErroneousElement element = type.element;
2738 if (type is MalformedType) { 2738 ir.Primitive message = buildStringConstant(element.message);
2739 ErroneousElement element = type.element;
2740 message = element.message;
2741 } else {
2742 assert(type is MethodTypeVariableType);
2743 message = "Method type variables are not reified, "
2744 "so they cannot be tested dynamically";
2745 }
2746 ir.Primitive irMessage = buildStringConstant(message);
2747 return buildStaticFunctionInvocation(program.throwTypeErrorHelper, 2739 return buildStaticFunctionInvocation(program.throwTypeErrorHelper,
2748 <ir.Primitive>[irMessage], sourceInformation); 2740 <ir.Primitive>[message], sourceInformation);
2749 } 2741 }
2750 2742
2751 List<ir.Primitive> typeArguments = const <ir.Primitive>[]; 2743 List<ir.Primitive> typeArguments = const <ir.Primitive>[];
2752 if (type is GenericType && type.typeArguments.isNotEmpty) { 2744 if (type is GenericType && type.typeArguments.isNotEmpty) {
2753 typeArguments = type.typeArguments.map(buildTypeExpression).toList(); 2745 typeArguments = type.typeArguments.map(buildTypeExpression).toList();
2754 } else if (type is TypeVariableType) { 2746 } else if (type is TypeVariableType) {
2755 typeArguments = <ir.Primitive>[buildTypeVariableAccess(type)]; 2747 typeArguments = <ir.Primitive>[buildTypeVariableAccess(type)];
2756 } else if (type is FunctionType) { 2748 } else if (type is FunctionType) {
2757 typeArguments = <ir.Primitive>[buildTypeExpression(type)]; 2749 typeArguments = <ir.Primitive>[buildTypeExpression(type)];
2758 } 2750 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
2918 this.sourceInformation}); 2910 this.sourceInformation});
2919 } 2911 }
2920 2912
2921 class SwitchCaseInfo { 2913 class SwitchCaseInfo {
2922 final SubbuildFunction buildCondition; 2914 final SubbuildFunction buildCondition;
2923 final SubbuildFunction buildBody; 2915 final SubbuildFunction buildBody;
2924 final SourceInformation sourceInformation; 2916 final SourceInformation sourceInformation;
2925 2917
2926 SwitchCaseInfo(this.buildCondition, this.buildBody, this.sourceInformation); 2918 SwitchCaseInfo(this.buildCondition, this.buildBody, this.sourceInformation);
2927 } 2919 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698