| 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 615 |
| 616 JavaScriptResolutionCallbacks resolutionCallbacks; | 616 JavaScriptResolutionCallbacks resolutionCallbacks; |
| 617 | 617 |
| 618 PatchResolverTask patchResolverTask; | 618 PatchResolverTask patchResolverTask; |
| 619 | 619 |
| 620 bool enabledNoSuchMethod = false; | 620 bool enabledNoSuchMethod = false; |
| 621 | 621 |
| 622 final SourceInformationStrategy sourceInformationStrategy; | 622 final SourceInformationStrategy sourceInformationStrategy; |
| 623 | 623 |
| 624 JavaScriptBackend(Compiler compiler, | 624 JavaScriptBackend(Compiler compiler, |
| 625 {bool generateSourceMap: true}) | 625 {bool generateSourceMap: true, |
| 626 bool useStartupEmitter: false}) |
| 626 : namer = determineNamer(compiler), | 627 : namer = determineNamer(compiler), |
| 627 oneShotInterceptors = new Map<jsAst.Name, Selector>(), | 628 oneShotInterceptors = new Map<jsAst.Name, Selector>(), |
| 628 interceptedElements = new Map<String, Set<Element>>(), | 629 interceptedElements = new Map<String, Set<Element>>(), |
| 629 rti = new RuntimeTypes(compiler), | 630 rti = new RuntimeTypes(compiler), |
| 630 specializedGetInterceptors = new Map<jsAst.Name, Set<ClassElement>>(), | 631 specializedGetInterceptors = new Map<jsAst.Name, Set<ClassElement>>(), |
| 631 annotations = new Annotations(compiler), | 632 annotations = new Annotations(compiler), |
| 632 this.sourceInformationStrategy = | 633 this.sourceInformationStrategy = |
| 633 generateSourceMap | 634 generateSourceMap |
| 634 ? (useNewSourceInfo | 635 ? (useNewSourceInfo |
| 635 ? const PositionSourceInformationStrategy() | 636 ? const PositionSourceInformationStrategy() |
| 636 : const StartEndSourceInformationStrategy()) | 637 : const StartEndSourceInformationStrategy()) |
| 637 : const JavaScriptSourceInformationStrategy(), | 638 : const JavaScriptSourceInformationStrategy(), |
| 638 super(compiler) { | 639 super(compiler) { |
| 639 emitter = new CodeEmitterTask(compiler, namer, generateSourceMap); | 640 emitter = new CodeEmitterTask( |
| 641 compiler, namer, generateSourceMap, useStartupEmitter); |
| 640 typeVariableHandler = new TypeVariableHandler(compiler); | 642 typeVariableHandler = new TypeVariableHandler(compiler); |
| 641 customElementsAnalysis = new CustomElementsAnalysis(this); | 643 customElementsAnalysis = new CustomElementsAnalysis(this); |
| 642 noSuchMethodRegistry = new NoSuchMethodRegistry(this); | 644 noSuchMethodRegistry = new NoSuchMethodRegistry(this); |
| 643 constantCompilerTask = new JavaScriptConstantTask(compiler); | 645 constantCompilerTask = new JavaScriptConstantTask(compiler); |
| 644 resolutionCallbacks = new JavaScriptResolutionCallbacks(this); | 646 resolutionCallbacks = new JavaScriptResolutionCallbacks(this); |
| 645 patchResolverTask = new PatchResolverTask(compiler); | 647 patchResolverTask = new PatchResolverTask(compiler); |
| 646 functionCompiler = compiler.useCpsIr | 648 functionCompiler = compiler.useCpsIr |
| 647 ? new CpsFunctionCompiler( | 649 ? new CpsFunctionCompiler( |
| 648 compiler, this, sourceInformationStrategy) | 650 compiler, this, sourceInformationStrategy) |
| 649 : new SsaFunctionCompiler(this, sourceInformationStrategy); | 651 : new SsaFunctionCompiler(this, sourceInformationStrategy); |
| (...skipping 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3011 } | 3013 } |
| 3012 } | 3014 } |
| 3013 | 3015 |
| 3014 /// Records that [constant] is used by the element behind [registry]. | 3016 /// Records that [constant] is used by the element behind [registry]. |
| 3015 class Dependency { | 3017 class Dependency { |
| 3016 final ConstantValue constant; | 3018 final ConstantValue constant; |
| 3017 final Element annotatedElement; | 3019 final Element annotatedElement; |
| 3018 | 3020 |
| 3019 const Dependency(this.constant, this.annotatedElement); | 3021 const Dependency(this.constant, this.annotatedElement); |
| 3020 } | 3022 } |
| OLD | NEW |