| 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 class InvocationInfo { | 5 class InvocationInfo { |
| 6 int parameterCount = -1; | 6 int parameterCount = -1; |
| 7 List<HType> providedTypes; | 7 List<HType> providedTypes; |
| 8 List<Element> compiledFunctions; | 8 List<Element> compiledFunctions; |
| 9 | 9 |
| 10 InvocationInfo(HInvoke node, HTypeMap types) | 10 InvocationInfo(HInvoke node, HTypeMap types) |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 395 } |
| 396 } | 396 } |
| 397 | 397 |
| 398 info.update(returnType, recompile); | 398 info.update(returnType, recompile); |
| 399 } else { | 399 } else { |
| 400 returnInfo[element] = new ReturnInfo(returnType); | 400 returnInfo[element] = new ReturnInfo(returnType); |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 | 403 |
| 404 /** | 404 /** |
| 405 * Retreive the return type of the function [calee]. The type is optimistic | 405 * Retreive the return type of the function [callee]. The type is optimistic |
| 406 * in the sense that is is based on the compilation of [callee]. If [calee] is | 406 * in the sense that is is based on the compilation of [callee]. If [callee] |
| 407 * recompiled the return type might change to someting broader. For that | 407 * is recompiled the return type might change to someting broader. For that |
| 408 * reason [caller] is registered for recompilation if this happens. If the | 408 * reason [caller] is registered for recompilation if this happens. If the |
| 409 * function [callee] has not yet been compiled the returned type is [null]. | 409 * function [callee] has not yet been compiled the returned type is [null]. |
| 410 */ | 410 */ |
| 411 HType optimisticReturnTypesWithRecompilationOnTypeChange( | 411 HType optimisticReturnTypesWithRecompilationOnTypeChange( |
| 412 FunctionElement caller, FunctionElement callee) { | 412 FunctionElement caller, FunctionElement callee) { |
| 413 returnInfo.putIfAbsent(calee, () => new ReturnInfo.unknownType()); | 413 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType()); |
| 414 ReturnInfo info = returnInfo[calee]; | 414 ReturnInfo info = returnInfo[callee]; |
| 415 if (info.returnType != HType.UNKNOWN && caller != null) { | 415 if (info.returnType != HType.UNKNOWN && caller != null) { |
| 416 info.addCompiledFunction(caller); | 416 info.addCompiledFunction(caller); |
| 417 } | 417 } |
| 418 return info.returnType; | 418 return info.returnType; |
| 419 } | 419 } |
| 420 } | 420 } |
| OLD | NEW |