| 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 typedef void Recompile(Element element); | 5 typedef void Recompile(Element element); |
| 6 | 6 |
| 7 // Gather the type information provided. If the types contains no | 7 // Gather the type information provided. If the types contains no |
| 8 // useful information there is no need to actually store them. | 8 // useful information there is no need to actually store them. |
| 9 List<HType> computeProvidedTypes(HInvoke node, HTypeMap types) { | 9 List<HType> computeProvidedTypes(HInvoke node, HTypeMap types) { |
| 10 bool allUnknown = true; | 10 bool allUnknown = true; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 final HTypeMap types; | 130 final HTypeMap types; |
| 131 | 131 |
| 132 JavaScriptItemCompilationContext() : types = new HTypeMap(); | 132 JavaScriptItemCompilationContext() : types = new HTypeMap(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 class JavaScriptBackend extends Backend { | 135 class JavaScriptBackend extends Backend { |
| 136 SsaBuilderTask builder; | 136 SsaBuilderTask builder; |
| 137 SsaOptimizerTask optimizer; | 137 SsaOptimizerTask optimizer; |
| 138 SsaCodeGeneratorTask generator; | 138 SsaCodeGeneratorTask generator; |
| 139 CodeEmitterTask emitter; | 139 CodeEmitterTask emitter; |
| 140 |
| 140 final Map<Element, Map<Element, HType>> fieldInitializers; | 141 final Map<Element, Map<Element, HType>> fieldInitializers; |
| 141 final Map<Element, Map<Element, HType>> fieldConstructorSetters; | 142 final Map<Element, Map<Element, HType>> fieldConstructorSetters; |
| 142 final Map<Element, Map<Element, HType>> fieldSettersType; | 143 final Map<Element, Map<Element, HType>> fieldSettersType; |
| 143 | 144 |
| 144 final Map<Element, InvocationInfo> staticInvocationInfo; | 145 final Map<Element, InvocationInfo> staticInvocationInfo; |
| 145 final Map<SourceString, Map<Selector, InvocationInfo>> invocationInfo; | 146 final Map<SourceString, Map<Selector, InvocationInfo>> invocationInfo; |
| 146 final Map<Element, ReturnInfo> returnInfo; | 147 final Map<Element, ReturnInfo> returnInfo; |
| 147 | 148 |
| 148 final List<Element> invalidateAfterCodegen; | 149 final List<Element> invalidateAfterCodegen; |
| 149 final SelectorMap<List<HType>> selectorTypeMap; | 150 final SelectorMap<List<HType>> selectorTypeMap; |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 HType optimisticReturnTypesWithRecompilationOnTypeChange( | 486 HType optimisticReturnTypesWithRecompilationOnTypeChange( |
| 486 FunctionElement caller, FunctionElement callee) { | 487 FunctionElement caller, FunctionElement callee) { |
| 487 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType()); | 488 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType()); |
| 488 ReturnInfo info = returnInfo[callee]; | 489 ReturnInfo info = returnInfo[callee]; |
| 489 if (info.returnType != HType.UNKNOWN && caller != null) { | 490 if (info.returnType != HType.UNKNOWN && caller != null) { |
| 490 info.addCompiledFunction(caller); | 491 info.addCompiledFunction(caller); |
| 491 } | 492 } |
| 492 return info.returnType; | 493 return info.returnType; |
| 493 } | 494 } |
| 494 } | 495 } |
| OLD | NEW |