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

Side by Side Diff: lib/compiler/implementation/compiler.dart

Issue 10539156: Track fields which are known to be always set to integer constants (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fix Created 8 years, 6 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
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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 final bool REPORT_EXCESS_RESOLUTION = false; 10 final bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 }); 456 });
457 world.queueIsClosed = true; 457 world.queueIsClosed = true;
458 assert(world.checkNoEnqueuedInvokedInstanceMethods()); 458 assert(world.checkNoEnqueuedInvokedInstanceMethods());
459 world.registerFieldClosureInvocations(); 459 world.registerFieldClosureInvocations();
460 } 460 }
461 461
462 void processRecompilationQueue(Enqueuer world) { 462 void processRecompilationQueue(Enqueuer world) {
463 assert(phase == PHASE_RECOMPILING); 463 assert(phase == PHASE_RECOMPILING);
464 while (!world.recompilationCandidates.isEmpty()) { 464 while (!world.recompilationCandidates.isEmpty()) {
465 WorkItem work = world.recompilationCandidates.next(); 465 WorkItem work = world.recompilationCandidates.next();
466 var oldCode = world.universe.generatedCode[work.element];
floitsch 2012/06/18 13:20:40 Please type your code.
Søren Gjesse 2012/06/19 14:35:00 Done.
466 world.universe.generatedCode.remove(work.element); 467 world.universe.generatedCode.remove(work.element);
467 var oldCode = world.universe.generatedCode[work.element]; 468 world.universe.generatedBailoutCode.remove(work.element);
468 withCurrentElement(work.element, () => work.run(this, world)); 469 withCurrentElement(work.element, () => work.run(this, world));
469 var newCode = world.universe.generatedCode[work.element]; 470 var newCode = world.universe.generatedCode[work.element];
470 if (REPORT_PASS2_OPTIMIZATIONS && newCode != oldCode) { 471 if (REPORT_PASS2_OPTIMIZATIONS && newCode != oldCode) {
471 log("Pass 2 optimization:"); 472 log("Pass 2 optimization:");
472 log("Before:\n$oldCode"); 473 log("Before:\n$oldCode");
473 log("After:\n$newCode"); 474 log("After:\n$newCode");
474 } 475 }
475 } 476 }
476 } 477 }
477 478
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 // invariant that endOffset > beginOffset, but for EOF the 763 // invariant that endOffset > beginOffset, but for EOF the
763 // charoffset of the next token may be [beginOffset]. This can 764 // charoffset of the next token may be [beginOffset]. This can
764 // also happen for synthetized tokens that are produced during 765 // also happen for synthetized tokens that are produced during
765 // error handling. 766 // error handling.
766 final endOffset = 767 final endOffset =
767 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1); 768 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1);
768 assert(endOffset > beginOffset); 769 assert(endOffset > beginOffset);
769 return f(beginOffset, endOffset); 770 return f(beginOffset, endOffset);
770 } 771 }
771 } 772 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/enqueue.dart » ('j') | lib/compiler/implementation/ssa/optimize.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698