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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.dart

Issue 118253004: Remove tracking of factories with type arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * A special element for the extra parameter taken by intercepted 8 * A special element for the extra parameter taken by intercepted
9 * methods. We need to override [Element.computeType] because our 9 * methods. We need to override [Element.computeType] because our
10 * optimizers may look at its declared type. 10 * optimizers may look at its declared type.
(...skipping 4070 matching lines...) Expand 10 before | Expand all | Expand 10 after
4081 // TODO(5347): Try to avoid the need for calling [implementation] before 4081 // TODO(5347): Try to avoid the need for calling [implementation] before
4082 // calling [addStaticSendArgumentsToList]. 4082 // calling [addStaticSendArgumentsToList].
4083 bool succeeded = addStaticSendArgumentsToList(selector, send.arguments, 4083 bool succeeded = addStaticSendArgumentsToList(selector, send.arguments,
4084 constructor.implementation, 4084 constructor.implementation,
4085 inputs); 4085 inputs);
4086 if (!succeeded) { 4086 if (!succeeded) {
4087 generateWrongArgumentCountError(send, constructor, send.arguments); 4087 generateWrongArgumentCountError(send, constructor, send.arguments);
4088 return; 4088 return;
4089 } 4089 }
4090 4090
4091 if (constructor.isFactoryConstructor() &&
4092 !expectedType.typeArguments.isEmpty) {
4093 compiler.enqueuer.codegen.registerFactoryWithTypeArguments(elements);
4094 }
4095
4096 TypeMask elementType = computeType(constructor); 4091 TypeMask elementType = computeType(constructor);
4097 if (isFixedListConstructorCall) { 4092 if (isFixedListConstructorCall) {
4098 if (!inputs[0].isNumber(compiler)) { 4093 if (!inputs[0].isNumber(compiler)) {
4099 HTypeConversion conversion = new HTypeConversion( 4094 HTypeConversion conversion = new HTypeConversion(
4100 null, HTypeConversion.ARGUMENT_TYPE_CHECK, backend.numType, 4095 null, HTypeConversion.ARGUMENT_TYPE_CHECK, backend.numType,
4101 inputs[0], null); 4096 inputs[0], null);
4102 add(conversion); 4097 add(conversion);
4103 inputs[0] = conversion; 4098 inputs[0] = conversion;
4104 } 4099 }
4105 js.Expression code = js.js.parseForeignJS('Array(#)'); 4100 js.Expression code = js.js.parseForeignJS('Array(#)');
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after
6398 DartType unaliased = type.unalias(builder.compiler); 6393 DartType unaliased = type.unalias(builder.compiler);
6399 if (unaliased is TypedefType) throw 'unable to unalias $type'; 6394 if (unaliased is TypedefType) throw 'unable to unalias $type';
6400 unaliased.accept(this, builder); 6395 unaliased.accept(this, builder);
6401 } 6396 }
6402 6397
6403 void visitDynamicType(DynamicType type, SsaFromAstMixin builder) { 6398 void visitDynamicType(DynamicType type, SsaFromAstMixin builder) {
6404 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType'); 6399 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType');
6405 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); 6400 builder.push(new HDynamicType(type, new TypeMask.exact(cls)));
6406 } 6401 }
6407 } 6402 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698