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 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 if (!localsHandler.isBoxed(parameter)) { | 1389 if (!localsHandler.isBoxed(parameter)) { |
1390 bodyCallInputs.add(localsHandler.readLocal(parameter)); | 1390 bodyCallInputs.add(localsHandler.readLocal(parameter)); |
1391 } | 1391 } |
1392 }); | 1392 }); |
1393 | 1393 |
1394 // If there are locals that escape (ie mutated in closures), we | 1394 // If there are locals that escape (ie mutated in closures), we |
1395 // pass the box to the constructor. | 1395 // pass the box to the constructor. |
1396 // The box must be passed before any type variable. | 1396 // The box must be passed before any type variable. |
1397 ClosureAnalysisInfo scopeData = | 1397 ClosureAnalysisInfo scopeData = |
1398 closureDataLookup.getClosureAnalysisInfo(node); | 1398 closureDataLookup.getClosureAnalysisInfo(node); |
1399 if (scopeData.requiresContextBox()) { | 1399 if (scopeData.requiresContextBox) { |
1400 bodyCallInputs.add(localsHandler.readLocal(scopeData.context)); | 1400 bodyCallInputs.add(localsHandler.readLocal(scopeData.context)); |
1401 } | 1401 } |
1402 | 1402 |
1403 // Type variables arguments must come after the box (if there is one). | 1403 // Type variables arguments must come after the box (if there is one). |
1404 ClassElement currentClass = constructor.enclosingClass; | 1404 ClassElement currentClass = constructor.enclosingClass; |
1405 if (rtiNeed.classNeedsRti(currentClass)) { | 1405 if (rtiNeed.classNeedsRti(currentClass)) { |
1406 // If [currentClass] needs RTI, we add the type variables as | 1406 // If [currentClass] needs RTI, we add the type variables as |
1407 // parameters of the generative constructor body. | 1407 // parameters of the generative constructor body. |
1408 currentClass.typeVariables | 1408 currentClass.typeVariables |
1409 .forEach((ResolutionTypeVariableType argument) { | 1409 .forEach((ResolutionTypeVariableType argument) { |
(...skipping 5457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6867 this.oldReturnLocal, | 6867 this.oldReturnLocal, |
6868 this.oldReturnType, | 6868 this.oldReturnType, |
6869 this.oldResolvedAst, | 6869 this.oldResolvedAst, |
6870 this.oldStack, | 6870 this.oldStack, |
6871 this.oldLocalsHandler, | 6871 this.oldLocalsHandler, |
6872 this.inTryStatement, | 6872 this.inTryStatement, |
6873 this.allFunctionsCalledOnce, | 6873 this.allFunctionsCalledOnce, |
6874 this.oldElementInferenceResults) | 6874 this.oldElementInferenceResults) |
6875 : super(function); | 6875 : super(function); |
6876 } | 6876 } |
OLD | NEW |