| 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 class ReturnInfo { | 7 class ReturnInfo { |
| 8 HType returnType; | 8 HType returnType; |
| 9 List<Element> compiledFunctions; | 9 List<Element> compiledFunctions; |
| 10 | 10 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 final HTypeMap types; | 255 final HTypeMap types; |
| 256 | 256 |
| 257 JavaScriptItemCompilationContext() : types = new HTypeMap(); | 257 JavaScriptItemCompilationContext() : types = new HTypeMap(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 class JavaScriptBackend extends Backend { | 260 class JavaScriptBackend extends Backend { |
| 261 SsaBuilderTask builder; | 261 SsaBuilderTask builder; |
| 262 SsaOptimizerTask optimizer; | 262 SsaOptimizerTask optimizer; |
| 263 SsaCodeGeneratorTask generator; | 263 SsaCodeGeneratorTask generator; |
| 264 CodeEmitterTask emitter; | 264 CodeEmitterTask emitter; |
| 265 |
| 265 final Map<Element, Map<Element, HType>> fieldInitializers; | 266 final Map<Element, Map<Element, HType>> fieldInitializers; |
| 266 final Map<Element, Map<Element, HType>> fieldConstructorSetters; | 267 final Map<Element, Map<Element, HType>> fieldConstructorSetters; |
| 267 final Map<Element, Map<Element, HType>> fieldSettersType; | 268 final Map<Element, Map<Element, HType>> fieldSettersType; |
| 268 | 269 |
| 269 final Map<Element, ReturnInfo> returnInfo; | 270 final Map<Element, ReturnInfo> returnInfo; |
| 270 | 271 |
| 271 final List<Element> invalidateAfterCodegen; | 272 final List<Element> invalidateAfterCodegen; |
| 272 ArgumentTypesRegistry argumentTypes; | 273 ArgumentTypesRegistry argumentTypes; |
| 273 | 274 |
| 274 List<CompilerTask> get tasks { | 275 List<CompilerTask> get tasks { |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 HType optimisticReturnTypesWithRecompilationOnTypeChange( | 500 HType optimisticReturnTypesWithRecompilationOnTypeChange( |
| 500 FunctionElement caller, FunctionElement callee) { | 501 FunctionElement caller, FunctionElement callee) { |
| 501 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType()); | 502 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType()); |
| 502 ReturnInfo info = returnInfo[callee]; | 503 ReturnInfo info = returnInfo[callee]; |
| 503 if (info.returnType != HType.UNKNOWN && caller != null) { | 504 if (info.returnType != HType.UNKNOWN && caller != null) { |
| 504 info.addCompiledFunction(caller); | 505 info.addCompiledFunction(caller); |
| 505 } | 506 } |
| 506 return info.returnType; | 507 return info.returnType; |
| 507 } | 508 } |
| 508 } | 509 } |
| OLD | NEW |