| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } | 279 } |
| 280 | 280 |
| 281 /** | 281 /** |
| 282 * Register a dynamic invocation and collect the provided types for the | 282 * Register a dynamic invocation and collect the provided types for the |
| 283 * named selector. | 283 * named selector. |
| 284 */ | 284 */ |
| 285 void registerDynamicInvocation(HInvokeDynamicMethod node, | 285 void registerDynamicInvocation(HInvokeDynamicMethod node, |
| 286 Selector selector, | 286 Selector selector, |
| 287 HTypeMap types) { | 287 HTypeMap types) { |
| 288 Map<Selector, InvocationInfo> invocationInfos = | 288 Map<Selector, InvocationInfo> invocationInfos = |
| 289 invocationInfo.putIfAbsent(node.name, | 289 invocationInfo.putIfAbsent(selector.name, |
| 290 () => new Map<Selector, InvocationInfo>()); | 290 () => new Map<Selector, InvocationInfo>()); |
| 291 InvocationInfo info = invocationInfos[selector]; | 291 InvocationInfo info = invocationInfos[selector]; |
| 292 if (info != null) { | 292 if (info != null) { |
| 293 void recompile(Element element) { | 293 void recompile(Element element) { |
| 294 if (compiler.phase == Compiler.PHASE_COMPILING) { | 294 if (compiler.phase == Compiler.PHASE_COMPILING) { |
| 295 invalidateAfterCodegen.add(element); | 295 invalidateAfterCodegen.add(element); |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 | 298 |
| 299 info.update(node, types, recompile); | 299 info.update(node, types, recompile); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 HType optimisticReturnTypesWithRecompilationOnTypeChange( | 411 HType optimisticReturnTypesWithRecompilationOnTypeChange( |
| 412 FunctionElement caller, FunctionElement callee) { | 412 FunctionElement caller, FunctionElement callee) { |
| 413 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType()); | 413 returnInfo.putIfAbsent(callee, () => new ReturnInfo.unknownType()); |
| 414 ReturnInfo info = returnInfo[callee]; | 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 |