| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.js_emitter.program_builder; | 5 library dart2js.js_emitter.program_builder; |
| 6 | 6 |
| 7 import '../../closure.dart' show ClosureFieldElement; | 7 import '../../closure.dart' show ClosureFieldElement; |
| 8 import '../../common.dart'; | 8 import '../../common.dart'; |
| 9 import '../../common/names.dart' show Names, Selectors; | 9 import '../../common/names.dart' show Names, Selectors; |
| 10 import '../../compiler.dart' show Compiler; | 10 import '../../compiler.dart' show Compiler; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 List<js.TokenFinalizer> finalizers = [_task.metadataCollector]; | 183 List<js.TokenFinalizer> finalizers = [_task.metadataCollector]; |
| 184 if (backend.namer is js.TokenFinalizer) { | 184 if (backend.namer is js.TokenFinalizer) { |
| 185 var namingFinalizer = backend.namer; | 185 var namingFinalizer = backend.namer; |
| 186 finalizers.add(namingFinalizer as js.TokenFinalizer); | 186 finalizers.add(namingFinalizer as js.TokenFinalizer); |
| 187 } | 187 } |
| 188 | 188 |
| 189 return new Program(fragments, holders, _buildLoadMap(), _symbolsMap, | 189 return new Program(fragments, holders, _buildLoadMap(), _symbolsMap, |
| 190 _buildTypeToInterceptorMap(), _task.metadataCollector, finalizers, | 190 _buildTypeToInterceptorMap(), _task.metadataCollector, finalizers, |
| 191 needsNativeSupport: needsNativeSupport, | 191 needsNativeSupport: needsNativeSupport, |
| 192 outputContainsConstantList: collector.outputContainsConstantList, | 192 outputContainsConstantList: collector.outputContainsConstantList, |
| 193 hasIsolateSupport: backend.hasIsolateSupport); | 193 hasIsolateSupport: backend.backendUsage.isIsolateInUse); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void _markEagerClasses() { | 196 void _markEagerClasses() { |
| 197 _markEagerInterceptorClasses(); | 197 _markEagerInterceptorClasses(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 /// Builds a map from loadId to outputs-to-load. | 200 /// Builds a map from loadId to outputs-to-load. |
| 201 Map<String, List<Fragment>> _buildLoadMap() { | 201 Map<String, List<Fragment>> _buildLoadMap() { |
| 202 Map<String, List<Fragment>> loadMap = <String, List<Fragment>>{}; | 202 Map<String, List<Fragment>> loadMap = <String, List<Fragment>>{}; |
| 203 _compiler.deferredLoadTask.hunksToLoad | 203 _compiler.deferredLoadTask.hunksToLoad |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 | 652 |
| 653 bool _methodNeedsStubs(FunctionElement method) { | 653 bool _methodNeedsStubs(FunctionElement method) { |
| 654 return !method.functionSignature.optionalParameters.isEmpty; | 654 return !method.functionSignature.optionalParameters.isEmpty; |
| 655 } | 655 } |
| 656 | 656 |
| 657 bool _methodCanBeReflected(FunctionElement method) { | 657 bool _methodCanBeReflected(FunctionElement method) { |
| 658 return backend.mirrorsData.isAccessibleByReflection(method); | 658 return backend.mirrorsData.isAccessibleByReflection(method); |
| 659 } | 659 } |
| 660 | 660 |
| 661 bool _methodCanBeApplied(FunctionElement method) { | 661 bool _methodCanBeApplied(FunctionElement method) { |
| 662 return backend.hasFunctionApplySupport && | 662 return backend.backendUsage.isFunctionApplyUsed && |
| 663 closedWorld.getMightBePassedToApply(method); | 663 closedWorld.getMightBePassedToApply(method); |
| 664 } | 664 } |
| 665 | 665 |
| 666 /* Map | List */ _computeParameterDefaultValues(FunctionSignature signature) { | 666 /* Map | List */ _computeParameterDefaultValues(FunctionSignature signature) { |
| 667 var /* Map | List */ optionalParameterDefaultValues; | 667 var /* Map | List */ optionalParameterDefaultValues; |
| 668 if (signature.optionalParametersAreNamed) { | 668 if (signature.optionalParametersAreNamed) { |
| 669 optionalParameterDefaultValues = new Map<String, ConstantValue>(); | 669 optionalParameterDefaultValues = new Map<String, ConstantValue>(); |
| 670 signature.forEachOptionalParameter((ParameterElement parameter) { | 670 signature.forEachOptionalParameter((ParameterElement parameter) { |
| 671 ConstantValue def = | 671 ConstantValue def = |
| 672 backend.constants.getConstantValue(parameter.constant); | 672 backend.constants.getConstantValue(parameter.constant); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 Constant constant = new Constant(name, holder, constantValue); | 966 Constant constant = new Constant(name, holder, constantValue); |
| 967 _constants[constantValue] = constant; | 967 _constants[constantValue] = constant; |
| 968 } | 968 } |
| 969 } | 969 } |
| 970 | 970 |
| 971 Holder _registerStaticStateHolder() { | 971 Holder _registerStaticStateHolder() { |
| 972 return _registry.registerHolder(namer.staticStateHolder, | 972 return _registry.registerHolder(namer.staticStateHolder, |
| 973 isStaticStateHolder: true); | 973 isStaticStateHolder: true); |
| 974 } | 974 } |
| 975 } | 975 } |
| OLD | NEW |