| 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 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:convert' show JSON; | 8 import 'dart:convert' show JSON; |
| 9 | 9 |
| 10 import '../../closure.dart' show ClosureConversionTask, ClosureFieldElement; | 10 import '../../closure.dart' show ClosureConversionTask, ClosureFieldElement; |
| 11 import '../../common.dart'; | 11 import '../../common.dart'; |
| 12 import '../../common/names.dart' show Names, Selectors; | 12 import '../../common/names.dart' show Names, Selectors; |
| 13 import '../../constants/values.dart' | 13 import '../../constants/values.dart' |
| 14 show ConstantValue, InterceptorConstantValue; | 14 show ConstantValue, InterceptorConstantValue; |
| 15 import '../../common_elements.dart' show CommonElements, ElementEnvironment; | 15 import '../../common_elements.dart' show CommonElements, ElementEnvironment; |
| 16 import '../../deferred_load.dart' show DeferredLoadTask, OutputUnit; | 16 import '../../deferred_load.dart' show DeferredLoadTask, OutputUnit; |
| 17 import '../../elements/elements.dart' | 17 import '../../elements/elements.dart' |
| 18 show | 18 show |
| 19 ClassElement, | 19 ClassElement, |
| 20 FieldElement, | 20 FieldElement, |
| 21 FunctionSignature, | 21 FunctionSignature, |
| 22 GetterElement, | 22 GetterElement, |
| 23 LibraryElement, | 23 LibraryElement, |
| 24 MemberElement, | 24 MemberElement, |
| 25 MethodElement, | 25 MethodElement, |
| 26 ParameterElement; | 26 ParameterElement; |
| 27 import '../../elements/entities.dart'; | 27 import '../../elements/entities.dart'; |
| 28 import '../../elements/resolution_types.dart' | 28 import '../../elements/resolution_types.dart' |
| 29 show ResolutionDartType, ResolutionFunctionType, ResolutionTypedefType; | 29 show ResolutionDartType, ResolutionFunctionType, ResolutionTypedefType; |
| 30 import '../../elements/types.dart' show DartType, DartTypes; | 30 import '../../elements/types.dart' show DartType, DartTypes, FunctionType; |
| 31 import '../../js/js.dart' as js; | 31 import '../../js/js.dart' as js; |
| 32 import '../../js_backend/backend.dart' show SuperMemberData; | 32 import '../../js_backend/backend.dart' show SuperMemberData; |
| 33 import '../../js_backend/backend_usage.dart'; | 33 import '../../js_backend/backend_usage.dart'; |
| 34 import '../../js_backend/constant_handler_javascript.dart' | 34 import '../../js_backend/constant_handler_javascript.dart' |
| 35 show JavaScriptConstantCompiler; | 35 show JavaScriptConstantCompiler; |
| 36 import '../../js_backend/custom_elements_analysis.dart'; | 36 import '../../js_backend/custom_elements_analysis.dart'; |
| 37 import '../../js_backend/namer.dart' show Namer, StringBackedName; | 37 import '../../js_backend/namer.dart' show Namer, StringBackedName; |
| 38 import '../../js_backend/native_data.dart'; | 38 import '../../js_backend/native_data.dart'; |
| 39 import '../../js_backend/interceptor_data.dart'; | 39 import '../../js_backend/interceptor_data.dart'; |
| 40 import '../../js_backend/mirrors_data.dart'; | 40 import '../../js_backend/mirrors_data.dart'; |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 isClosureCallMethod: isClosureCallMethod, | 963 isClosureCallMethod: isClosureCallMethod, |
| 964 aliasName: aliasName, | 964 aliasName: aliasName, |
| 965 canBeApplied: canBeApplied, | 965 canBeApplied: canBeApplied, |
| 966 canBeReflected: canBeReflected, | 966 canBeReflected: canBeReflected, |
| 967 requiredParameterCount: requiredParameterCount, | 967 requiredParameterCount: requiredParameterCount, |
| 968 optionalParameterDefaultValues: optionalParameterDefaultValues, | 968 optionalParameterDefaultValues: optionalParameterDefaultValues, |
| 969 functionType: functionType); | 969 functionType: functionType); |
| 970 } | 970 } |
| 971 | 971 |
| 972 js.Expression _generateFunctionType( | 972 js.Expression _generateFunctionType( |
| 973 ResolutionFunctionType type, OutputUnit outputUnit) { | 973 FunctionType type, OutputUnit outputUnit) { |
| 974 if (type.containsTypeVariables) { | 974 if (type.containsTypeVariables) { |
| 975 js.Expression thisAccess = js.js(r'this.$receiver'); | 975 js.Expression thisAccess = js.js(r'this.$receiver'); |
| 976 return _rtiEncoder.getSignatureEncoding(_task.emitter, type, thisAccess); | 976 return _rtiEncoder.getSignatureEncoding(_task.emitter, type, thisAccess); |
| 977 } else { | 977 } else { |
| 978 return _task.metadataCollector.reifyTypeForOutputUnit(type, outputUnit); | 978 return _task.metadataCollector.reifyTypeForOutputUnit(type, outputUnit); |
| 979 } | 979 } |
| 980 } | 980 } |
| 981 | 981 |
| 982 List<ParameterStubMethod> _generateParameterStubs( | 982 List<ParameterStubMethod> _generateParameterStubs( |
| 983 FunctionEntity element, bool canTearOff) { | 983 FunctionEntity element, bool canTearOff) { |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1190 Constant constant = new Constant(name, holder, constantValue); | 1190 Constant constant = new Constant(name, holder, constantValue); |
| 1191 _constants[constantValue] = constant; | 1191 _constants[constantValue] = constant; |
| 1192 } | 1192 } |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 Holder _registerStaticStateHolder() { | 1195 Holder _registerStaticStateHolder() { |
| 1196 return _registry.registerHolder(_namer.staticStateHolder, | 1196 return _registry.registerHolder(_namer.staticStateHolder, |
| 1197 isStaticStateHolder: true); | 1197 isStaticStateHolder: true); |
| 1198 } | 1198 } |
| 1199 } | 1199 } |
| OLD | NEW |