| 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 part of js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 const VERBOSE_OPTIMIZER_HINTS = false; | 7 const VERBOSE_OPTIMIZER_HINTS = false; |
| 8 | 8 |
| 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); | 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 /// List of elements that the user has requested for reflection. | 293 /// List of elements that the user has requested for reflection. |
| 294 final Set<Element> targetsUsed = new Set<Element>(); | 294 final Set<Element> targetsUsed = new Set<Element>(); |
| 295 | 295 |
| 296 /// List of annotations provided by user that indicate that the annotated | 296 /// List of annotations provided by user that indicate that the annotated |
| 297 /// element must be retained. | 297 /// element must be retained. |
| 298 final Set<Element> metaTargetsUsed = new Set<Element>(); | 298 final Set<Element> metaTargetsUsed = new Set<Element>(); |
| 299 | 299 |
| 300 /// List of elements that the backend may use. | 300 /// List of elements that the backend may use. |
| 301 final Set<Element> helpersUsed = new Set<Element>(); | 301 final Set<Element> helpersUsed = new Set<Element>(); |
| 302 | 302 |
| 303 |
| 304 /// Set of typedefs that are used as type literals. |
| 305 final Set<TypedefElement> typedefTypeLiterals = new Set<TypedefElement>(); |
| 306 |
| 303 /// All the checked mode helpers. | 307 /// All the checked mode helpers. |
| 304 static const checkedModeHelpers = CheckedModeHelper.helpers; | 308 static const checkedModeHelpers = CheckedModeHelper.helpers; |
| 305 | 309 |
| 306 // Checked mode helpers indexed by name. | 310 // Checked mode helpers indexed by name. |
| 307 Map<String, CheckedModeHelper> checkedModeHelperByName = | 311 Map<String, CheckedModeHelper> checkedModeHelperByName = |
| 308 new Map<String, CheckedModeHelper>.fromIterable( | 312 new Map<String, CheckedModeHelper>.fromIterable( |
| 309 checkedModeHelpers, | 313 checkedModeHelpers, |
| 310 key: (helper) => helper.name); | 314 key: (helper) => helper.name); |
| 311 | 315 |
| 312 TypeVariableHandler typeVariableHandler; | 316 TypeVariableHandler typeVariableHandler; |
| (...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 } | 1957 } |
| 1954 | 1958 |
| 1955 void onTypeLiteral(DartType type, Registry registry) { | 1959 void onTypeLiteral(DartType type, Registry registry) { |
| 1956 assert(registry.isForResolution); | 1960 assert(registry.isForResolution); |
| 1957 registerBackendInstantiation(backend.typeImplementation, registry); | 1961 registerBackendInstantiation(backend.typeImplementation, registry); |
| 1958 registerBackendStaticInvocation(backend.getCreateRuntimeType(), registry); | 1962 registerBackendStaticInvocation(backend.getCreateRuntimeType(), registry); |
| 1959 // TODO(ahe): Might want to register [element] as an instantiated class | 1963 // TODO(ahe): Might want to register [element] as an instantiated class |
| 1960 // when reflection is used. However, as long as we disable tree-shaking | 1964 // when reflection is used. However, as long as we disable tree-shaking |
| 1961 // eagerly it doesn't matter. | 1965 // eagerly it doesn't matter. |
| 1962 if (type.isTypedef) { | 1966 if (type.isTypedef) { |
| 1963 backend.compiler.world.allTypedefs.add(type.element); | 1967 backend.typedefTypeLiterals.add(type.element); |
| 1964 } | 1968 } |
| 1965 backend.customElementsAnalysis.registerTypeLiteral(type, registry); | 1969 backend.customElementsAnalysis.registerTypeLiteral(type, registry); |
| 1966 } | 1970 } |
| 1967 | 1971 |
| 1968 void onStackTraceInCatch(Registry registry) { | 1972 void onStackTraceInCatch(Registry registry) { |
| 1969 assert(registry.isForResolution); | 1973 assert(registry.isForResolution); |
| 1970 registerBackendStaticInvocation(backend.getTraceFromException(), registry); | 1974 registerBackendStaticInvocation(backend.getTraceFromException(), registry); |
| 1971 } | 1975 } |
| 1972 | 1976 |
| 1973 | 1977 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2100 } | 2104 } |
| 2101 | 2105 |
| 2102 /// Records that [constant] is used by the element behind [registry]. | 2106 /// Records that [constant] is used by the element behind [registry]. |
| 2103 class Dependency { | 2107 class Dependency { |
| 2104 final Constant constant; | 2108 final Constant constant; |
| 2105 // TODO(johnniwinther): Change to [Element] when dependency nodes are added. | 2109 // TODO(johnniwinther): Change to [Element] when dependency nodes are added. |
| 2106 final Registry registry; | 2110 final Registry registry; |
| 2107 | 2111 |
| 2108 const Dependency(this.constant, this.registry); | 2112 const Dependency(this.constant, this.registry); |
| 2109 } | 2113 } |
| OLD | NEW |