| 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 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2319 // 'new' of the constructor instead of via an upgrade. It is optimized out | 2319 // 'new' of the constructor instead of via an upgrade. It is optimized out |
| 2320 // if there are field initializers. | 2320 // if there are field initializers. |
| 2321 add(new HFieldGet(null, newObject, backend.dynamicType, | 2321 add(new HFieldGet(null, newObject, backend.dynamicType, |
| 2322 isAssignable: false)); | 2322 isAssignable: false)); |
| 2323 for (int i = 0; i < fields.length; i++) { | 2323 for (int i = 0; i < fields.length; i++) { |
| 2324 add(new HFieldSet(fields[i], newObject, constructorArguments[i])); | 2324 add(new HFieldSet(fields[i], newObject, constructorArguments[i])); |
| 2325 } | 2325 } |
| 2326 } | 2326 } |
| 2327 removeInlinedInstantiation(type); | 2327 removeInlinedInstantiation(type); |
| 2328 // Create the runtime type information, if needed. | 2328 // Create the runtime type information, if needed. |
| 2329 if (backend.classNeedsRti(classElement)) { | 2329 if (classElement.typeVariables.isNotEmpty && |
| 2330 backend.classNeedsRti(classElement)) { |
| 2330 // Read the values of the type arguments and create a HTypeInfoExpression | 2331 // Read the values of the type arguments and create a HTypeInfoExpression |
| 2331 // to set on the newly create object. We can identify the case where the | 2332 // to set on the newly create object. We can identify the case where the |
| 2332 // expression would be of the form: | 2333 // expression would be of the form: |
| 2333 // | 2334 // |
| 2334 // [getTypeArgumentByIndex(this, 0), .., getTypeArgumentByIndex(this, k)] | 2335 // [getTypeArgumentByIndex(this, 0), .., getTypeArgumentByIndex(this, k)] |
| 2335 // | 2336 // |
| 2336 // and k is the number of type arguments of this. If this is the case, | 2337 // and k is the number of type arguments of this. If this is the case, |
| 2337 // we can simply copy the list from this. | 2338 // we can simply copy the list from this. |
| 2338 | 2339 |
| 2339 // These locals are modified by [isIndexedTypeArgumentGet]. | 2340 // These locals are modified by [isIndexedTypeArgumentGet]. |
| (...skipping 6299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8639 const _LoopTypeVisitor(); | 8640 const _LoopTypeVisitor(); |
| 8640 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; | 8641 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; |
| 8641 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; | 8642 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; |
| 8642 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; | 8643 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; |
| 8643 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; | 8644 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; |
| 8644 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 8645 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
| 8645 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; | 8646 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; |
| 8646 int visitSwitchStatement(ast.SwitchStatement node) => | 8647 int visitSwitchStatement(ast.SwitchStatement node) => |
| 8647 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; | 8648 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; |
| 8648 } | 8649 } |
| OLD | NEW |