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 14 matching lines...) Expand all Loading... |
25 LibraryElement, | 25 LibraryElement, |
26 MethodElement, | 26 MethodElement, |
27 ParameterElement, | 27 ParameterElement, |
28 TypedefElement, | 28 TypedefElement, |
29 VariableElement; | 29 VariableElement; |
30 import '../../js/js.dart' as js; | 30 import '../../js/js.dart' as js; |
31 import '../../js_backend/backend_helpers.dart' show BackendHelpers; | 31 import '../../js_backend/backend_helpers.dart' show BackendHelpers; |
32 import '../../js_backend/js_backend.dart' | 32 import '../../js_backend/js_backend.dart' |
33 show Namer, JavaScriptBackend, JavaScriptConstantCompiler, StringBackedName; | 33 show Namer, JavaScriptBackend, JavaScriptConstantCompiler, StringBackedName; |
34 import '../../universe/selector.dart' show Selector; | 34 import '../../universe/selector.dart' show Selector; |
35 import '../../universe/universe.dart' show Universe, SelectorConstraints; | 35 import '../../universe/universe.dart' show CodegenUniverse, SelectorConstraints; |
36 import '../js_emitter.dart' | 36 import '../js_emitter.dart' |
37 show | 37 show |
38 ClassStubGenerator, | 38 ClassStubGenerator, |
39 CodeEmitterTask, | 39 CodeEmitterTask, |
40 computeMixinClass, | 40 computeMixinClass, |
41 Emitter, | 41 Emitter, |
42 InterceptorStubGenerator, | 42 InterceptorStubGenerator, |
43 MainCallStubGenerator, | 43 MainCallStubGenerator, |
44 ParameterStubGenerator, | 44 ParameterStubGenerator, |
45 RuntimeTypeGenerator, | 45 RuntimeTypeGenerator, |
(...skipping 26 matching lines...) Expand all Loading... |
72 ProgramBuilder(Compiler compiler, Namer namer, this._task, Emitter emitter, | 72 ProgramBuilder(Compiler compiler, Namer namer, this._task, Emitter emitter, |
73 Set<ClassElement> rtiNeededClasses) | 73 Set<ClassElement> rtiNeededClasses) |
74 : this._compiler = compiler, | 74 : this._compiler = compiler, |
75 this.namer = namer, | 75 this.namer = namer, |
76 this.collector = | 76 this.collector = |
77 new Collector(compiler, namer, rtiNeededClasses, emitter), | 77 new Collector(compiler, namer, rtiNeededClasses, emitter), |
78 this._registry = new Registry(compiler); | 78 this._registry = new Registry(compiler); |
79 | 79 |
80 JavaScriptBackend get backend => _compiler.backend; | 80 JavaScriptBackend get backend => _compiler.backend; |
81 BackendHelpers get helpers => backend.helpers; | 81 BackendHelpers get helpers => backend.helpers; |
82 Universe get universe => _compiler.codegenWorld; | 82 CodegenUniverse get universe => _compiler.codegenWorld; |
83 | 83 |
84 /// Mapping from [ClassElement] to constructed [Class]. We need this to | 84 /// Mapping from [ClassElement] to constructed [Class]. We need this to |
85 /// update the superclass in the [Class]. | 85 /// update the superclass in the [Class]. |
86 final Map<ClassElement, Class> _classes = <ClassElement, Class>{}; | 86 final Map<ClassElement, Class> _classes = <ClassElement, Class>{}; |
87 | 87 |
88 /// Mapping from [OutputUnit] to constructed [Fragment]. We need this to | 88 /// Mapping from [OutputUnit] to constructed [Fragment]. We need this to |
89 /// generate the deferredLoadingMap (to know which hunks to load). | 89 /// generate the deferredLoadingMap (to know which hunks to load). |
90 final Map<OutputUnit, Fragment> _outputs = <OutputUnit, Fragment>{}; | 90 final Map<OutputUnit, Fragment> _outputs = <OutputUnit, Fragment>{}; |
91 | 91 |
92 /// Mapping from [ConstantValue] to constructed [Constant]. We need this to | 92 /// Mapping from [ConstantValue] to constructed [Constant]. We need this to |
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 Constant constant = new Constant(name, holder, constantValue); | 976 Constant constant = new Constant(name, holder, constantValue); |
977 _constants[constantValue] = constant; | 977 _constants[constantValue] = constant; |
978 } | 978 } |
979 } | 979 } |
980 | 980 |
981 Holder _registerStaticStateHolder() { | 981 Holder _registerStaticStateHolder() { |
982 return _registry.registerHolder(namer.staticStateHolder, | 982 return _registry.registerHolder(namer.staticStateHolder, |
983 isStaticStateHolder: true); | 983 isStaticStateHolder: true); |
984 } | 984 } |
985 } | 985 } |
OLD | NEW |