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 typedef void Recompile(Element element); | 7 typedef void Recompile(Element element); |
8 | 8 |
9 class ReturnInfo { | 9 class ReturnInfo { |
10 HType returnType; | 10 HType returnType; |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 assert(invariant(node, element.isDeclaration)); | 478 assert(invariant(node, element.isDeclaration)); |
479 if (optimizedStaticFunctions.contains(element)) { | 479 if (optimizedStaticFunctions.contains(element)) { |
480 backend.scheduleForRecompilation(element); | 480 backend.scheduleForRecompilation(element); |
481 } | 481 } |
482 staticTypeMap[element] = HTypeList.ALL_UNKNOWN; | 482 staticTypeMap[element] = HTypeList.ALL_UNKNOWN; |
483 } | 483 } |
484 | 484 |
485 void registerDynamicInvocation(HInvokeDynamic node, | 485 void registerDynamicInvocation(HInvokeDynamic node, |
486 Selector selector, | 486 Selector selector, |
487 HTypeMap types) { | 487 HTypeMap types) { |
| 488 if (selector.isClosureCall()) { |
| 489 // We cannot use the current framework to do optimizations based |
| 490 // on the 'call' selector because we are also generating closure |
| 491 // calls during the emitter phase, which at this point, does not |
| 492 // track parameter types, nor invalidates optimized methods. |
| 493 return; |
| 494 } |
488 HTypeList providedTypes = | 495 HTypeList providedTypes = |
489 new HTypeList.fromDynamicInvocation(node, selector, types); | 496 new HTypeList.fromDynamicInvocation(node, selector, types); |
490 if (!selectorTypeMap.containsKey(selector)) { | 497 if (!selectorTypeMap.containsKey(selector)) { |
491 selectorTypeMap[selector] = providedTypes; | 498 selectorTypeMap[selector] = providedTypes; |
492 } else { | 499 } else { |
493 HTypeList oldTypes = selectorTypeMap[selector]; | 500 HTypeList oldTypes = selectorTypeMap[selector]; |
494 updateTypes(oldTypes, providedTypes, selector, selectorTypeMap); | 501 updateTypes(oldTypes, providedTypes, selector, selectorTypeMap); |
495 } | 502 } |
496 | 503 |
497 // If we're not compiling, we don't have to do anything. | 504 // If we're not compiling, we don't have to do anything. |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 print("Inferred return types:"); | 1142 print("Inferred return types:"); |
1136 print("----------------------"); | 1143 print("----------------------"); |
1137 dumpReturnTypes(); | 1144 dumpReturnTypes(); |
1138 print(""); | 1145 print(""); |
1139 print("Inferred field types:"); | 1146 print("Inferred field types:"); |
1140 print("------------------------"); | 1147 print("------------------------"); |
1141 fieldTypes.dump(); | 1148 fieldTypes.dump(); |
1142 print(""); | 1149 print(""); |
1143 } | 1150 } |
1144 } | 1151 } |
OLD | NEW |