Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 11958009: Do not track parameter types of closures, since closure calls can be generated during the emitter. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698