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

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

Issue 1643783002: Fix analyzer warnings for https://codereview.chromium.org/1642493002 (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_task; 5 library dart2js.ir_builder_task;
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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 // t1 = setRuntimeTypeInfo(allocation, TypeExpression($E)); 911 // t1 = setRuntimeTypeInfo(allocation, TypeExpression($E));
912 // return Refinement(t1, <JSArray>); 912 // return Refinement(t1, <JSArray>);
913 // 913 //
914 assert(parameters.length == 1 || parameters.length == 2); 914 assert(parameters.length == 1 || parameters.length == 2);
915 ir.Primitive allocation = irBuilder.buildLocalGet(parameters[0]); 915 ir.Primitive allocation = irBuilder.buildLocalGet(parameters[0]);
916 ClassElement classElement = element.enclosingElement; 916 ClassElement classElement = element.enclosingElement;
917 917
918 // Only call setRuntimeTypeInfo if JSArray requires the type parameter. 918 // Only call setRuntimeTypeInfo if JSArray requires the type parameter.
919 if (requiresRuntimeTypes) { 919 if (requiresRuntimeTypes) {
920 assert(parameters.length == 2); 920 assert(parameters.length == 2);
921 closure.TypeVariableLocal typeParameter = parameters[1];
921 ir.Primitive typeArgument = 922 ir.Primitive typeArgument =
922 irBuilder.buildTypeVariableAccess(parameters[1].typeVariable); 923 irBuilder.buildTypeVariableAccess(typeParameter.typeVariable);
923 924
924 ir.Primitive typeInformation = irBuilder.addPrimitive( 925 ir.Primitive typeInformation = irBuilder.addPrimitive(
925 new ir.TypeExpression(ir.TypeExpressionKind.INSTANCE, 926 new ir.TypeExpression(ir.TypeExpressionKind.INSTANCE,
926 element.enclosingClass.thisType, 927 element.enclosingClass.thisType,
927 <ir.Primitive>[typeArgument])); 928 <ir.Primitive>[typeArgument]));
928 929
929 Element helper = helpers.setRuntimeTypeInfo; 930 MethodElement helper = helpers.setRuntimeTypeInfo;
930 CallStructure callStructure = CallStructure.TWO_ARGS; 931 CallStructure callStructure = CallStructure.TWO_ARGS;
931 Selector selector = new Selector.call(helper.memberName, callStructure); 932 Selector selector = new Selector.call(helper.memberName, callStructure);
932 allocation = irBuilder.buildInvokeStatic( 933 allocation = irBuilder.buildInvokeStatic(
933 helper, selector, <ir.Primitive>[allocation, typeInformation], 934 helper, selector, <ir.Primitive>[allocation, typeInformation],
934 sourceInformationBuilder.buildGeneric(node)); 935 sourceInformationBuilder.buildGeneric(node));
935 } 936 }
936 937
937 ir.Primitive refinement = irBuilder.addPrimitive( 938 ir.Primitive refinement = irBuilder.addPrimitive(
938 new ir.Refinement(allocation, typeMaskSystem.arrayType)); 939 new ir.Refinement(allocation, typeMaskSystem.arrayType));
939 940
(...skipping 2949 matching lines...) Expand 10 before | Expand all | Expand 10 after
3889 } 3890 }
3890 3891
3891 Element get closureConverter { 3892 Element get closureConverter {
3892 return _backend.helpers.closureConverter; 3893 return _backend.helpers.closureConverter;
3893 } 3894 }
3894 3895
3895 void addNativeMethod(FunctionElement function) { 3896 void addNativeMethod(FunctionElement function) {
3896 _backend.emitter.nativeEmitter.nativeMethods.add(function); 3897 _backend.emitter.nativeEmitter.nativeMethods.add(function);
3897 } 3898 }
3898 } 3899 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698