| 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 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 7 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
| 8 final Set<HInstruction> boundsChecked; | 8 final Set<HInstruction> boundsChecked; |
| 9 | 9 |
| 10 JavaScriptItemCompilationContext() | 10 JavaScriptItemCompilationContext() |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 /// List of elements that the user has requested for reflection. | 334 /// List of elements that the user has requested for reflection. |
| 335 final Set<Element> targetsUsed = new Set<Element>(); | 335 final Set<Element> targetsUsed = new Set<Element>(); |
| 336 | 336 |
| 337 /// List of annotations provided by user that indicate that the annotated | 337 /// List of annotations provided by user that indicate that the annotated |
| 338 /// element must be retained. | 338 /// element must be retained. |
| 339 final Set<Element> metaTargetsUsed = new Set<Element>(); | 339 final Set<Element> metaTargetsUsed = new Set<Element>(); |
| 340 | 340 |
| 341 /// List of elements that the backend may use. | 341 /// List of elements that the backend may use. |
| 342 final Set<Element> helpersUsed = new Set<Element>(); | 342 final Set<Element> helpersUsed = new Set<Element>(); |
| 343 | 343 |
| 344 /// Set of typedefs that are used as type literals. |
| 345 final Set<TypedefElement> typedefTypeLiterals = new Set<TypedefElement>(); |
| 346 |
| 344 JavaScriptBackend(Compiler compiler, bool generateSourceMap, bool disableEval) | 347 JavaScriptBackend(Compiler compiler, bool generateSourceMap, bool disableEval) |
| 345 : namer = determineNamer(compiler), | 348 : namer = determineNamer(compiler), |
| 346 oneShotInterceptors = new Map<String, Selector>(), | 349 oneShotInterceptors = new Map<String, Selector>(), |
| 347 interceptedElements = new Map<SourceString, Set<Element>>(), | 350 interceptedElements = new Map<SourceString, Set<Element>>(), |
| 348 rti = new RuntimeTypes(compiler), | 351 rti = new RuntimeTypes(compiler), |
| 349 specializedGetInterceptors = new Map<String, Set<ClassElement>>(), | 352 specializedGetInterceptors = new Map<String, Set<ClassElement>>(), |
| 350 super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) { | 353 super(compiler, JAVA_SCRIPT_CONSTANT_SYSTEM) { |
| 351 emitter = disableEval | 354 emitter = disableEval |
| 352 ? new CodeEmitterNoEvalTask(compiler, namer, generateSourceMap) | 355 ? new CodeEmitterNoEvalTask(compiler, namer, generateSourceMap) |
| 353 : new CodeEmitterTask(compiler, namer, generateSourceMap); | 356 : new CodeEmitterTask(compiler, namer, generateSourceMap); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 | 806 |
| 804 void registerLazyField(TreeElements elements) { | 807 void registerLazyField(TreeElements elements) { |
| 805 enqueueInResolution(getCyclicThrowHelper(), elements); | 808 enqueueInResolution(getCyclicThrowHelper(), elements); |
| 806 } | 809 } |
| 807 | 810 |
| 808 void registerTypeLiteral(Element element, TreeElements elements) { | 811 void registerTypeLiteral(Element element, TreeElements elements) { |
| 809 enqueueInResolution(getCreateRuntimeType(), elements); | 812 enqueueInResolution(getCreateRuntimeType(), elements); |
| 810 // TODO(ahe): Might want to register [element] as an instantiated class | 813 // TODO(ahe): Might want to register [element] as an instantiated class |
| 811 // when reflection is used. However, as long as we disable tree-shaking | 814 // when reflection is used. However, as long as we disable tree-shaking |
| 812 // eagerly it doesn't matter. | 815 // eagerly it doesn't matter. |
| 816 if (element.isTypedef()) { |
| 817 typedefTypeLiterals.add(element); |
| 818 } |
| 813 } | 819 } |
| 814 | 820 |
| 815 void registerStackTraceInCatch(TreeElements elements) { | 821 void registerStackTraceInCatch(TreeElements elements) { |
| 816 enqueueInResolution(getTraceFromException(), elements); | 822 enqueueInResolution(getTraceFromException(), elements); |
| 817 } | 823 } |
| 818 | 824 |
| 819 void registerSetRuntimeType(TreeElements elements) { | 825 void registerSetRuntimeType(TreeElements elements) { |
| 820 enqueueInResolution(getSetRuntimeTypeInfo(), elements); | 826 enqueueInResolution(getSetRuntimeTypeInfo(), elements); |
| 821 } | 827 } |
| 822 | 828 |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1692 copy(constant.values); | 1698 copy(constant.values); |
| 1693 copy(constant.protoValue); | 1699 copy(constant.protoValue); |
| 1694 copy(constant); | 1700 copy(constant); |
| 1695 } | 1701 } |
| 1696 | 1702 |
| 1697 void visitConstructed(ConstructedConstant constant) { | 1703 void visitConstructed(ConstructedConstant constant) { |
| 1698 copy(constant.fields); | 1704 copy(constant.fields); |
| 1699 copy(constant); | 1705 copy(constant); |
| 1700 } | 1706 } |
| 1701 } | 1707 } |
| OLD | NEW |