| OLD | NEW |
| 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 import 'dart:collection'; | 5 import 'dart:collection'; |
| 6 | 6 |
| 7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
| 8 | 8 |
| 9 import '../closure.dart'; | 9 import '../closure.dart'; |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 4748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4759 // never built standalone, so in that case [target] is not | 4759 // never built standalone, so in that case [target] is not |
| 4760 // the [member] itself. | 4760 // the [member] itself. |
| 4761 (member.isField && member != target)) { | 4761 (member.isField && member != target)) { |
| 4762 // The type variable is stored in a parameter of the method. | 4762 // The type variable is stored in a parameter of the method. |
| 4763 return localsHandler.readLocal(typeVariableLocal, | 4763 return localsHandler.readLocal(typeVariableLocal, |
| 4764 sourceInformation: sourceInformation); | 4764 sourceInformation: sourceInformation); |
| 4765 } else if (member.isInstanceMember) { | 4765 } else if (member.isInstanceMember) { |
| 4766 // The type variable is stored on the object. | 4766 // The type variable is stored on the object. |
| 4767 return readTypeVariable(member.enclosingClass, type.element, | 4767 return readTypeVariable(member.enclosingClass, type.element, |
| 4768 sourceInformation: sourceInformation); | 4768 sourceInformation: sourceInformation); |
| 4769 } else if (type is MethodTypeVariableType) { | |
| 4770 // TODO(eernst): The enclosing `else if` was added to provide minimal | |
| 4771 // support for generic methods: The method type arguments are always | |
| 4772 // pretending to have the value `dynamic`. Revise for full support. | |
| 4773 DynamicType type = const DynamicType(); | |
| 4774 JavaScriptBackend backend = compiler.backend; | |
| 4775 ClassElement cls = backend.helpers.DynamicRuntimeType; | |
| 4776 HInstruction instruction = | |
| 4777 new HDynamicType(type, new TypeMask.exact(cls, compiler.world)); | |
| 4778 add(instruction); | |
| 4779 return instruction; | |
| 4780 } else { | 4769 } else { |
| 4781 reporter.internalError( | 4770 reporter.internalError( |
| 4782 type.element, 'Unexpected type variable in static context.'); | 4771 type.element, 'Unexpected type variable in static context.'); |
| 4783 return null; | 4772 return null; |
| 4784 } | 4773 } |
| 4785 } | 4774 } |
| 4786 | 4775 |
| 4787 HInstruction analyzeTypeArgument(DartType argument, | 4776 HInstruction analyzeTypeArgument(DartType argument, |
| 4788 {SourceInformation sourceInformation}) { | 4777 {SourceInformation sourceInformation}) { |
| 4789 assert(assertTypeInContext(argument)); | 4778 assert(assertTypeInContext(argument)); |
| (...skipping 3821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8611 const _LoopTypeVisitor(); | 8600 const _LoopTypeVisitor(); |
| 8612 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; | 8601 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; |
| 8613 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; | 8602 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; |
| 8614 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; | 8603 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; |
| 8615 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; | 8604 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; |
| 8616 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 8605 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
| 8617 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 8606 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
| 8618 int visitSwitchStatement(ast.SwitchStatement node) => | 8607 int visitSwitchStatement(ast.SwitchStatement node) => |
| 8619 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; | 8608 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; |
| 8620 } | 8609 } |
| OLD | NEW |