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

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: Addressed review comment and addressed initializers 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 assert(world.checkNoEnqueuedInvokedInstanceMethods()); 448 assert(world.checkNoEnqueuedInvokedInstanceMethods());
449 world.registerFieldClosureInvocations(); 449 world.registerFieldClosureInvocations();
450 } 450 }
451 451
452 processRecompilationQueue(Enqueuer world) { 452 processRecompilationQueue(Enqueuer world) {
453 pass = 2; 453 pass = 2;
454 while (!world.recompilationCandidates.isEmpty()) { 454 while (!world.recompilationCandidates.isEmpty()) {
455 WorkItem work = world.recompilationCandidates.next(); 455 WorkItem work = world.recompilationCandidates.next();
456 var oldCode = world.universe.generatedCode[work.element]; 456 var oldCode = world.universe.generatedCode[work.element];
457 world.universe.generatedCode.remove(work.element); 457 world.universe.generatedCode.remove(work.element);
458 world.universe.generatedBailoutCode.remove(work.element);
458 withCurrentElement(work.element, () => work.run(this, world)); 459 withCurrentElement(work.element, () => work.run(this, world));
459 var newCode = world.universe.generatedCode[work.element]; 460 var newCode = world.universe.generatedCode[work.element];
460 if (REPORT_PASS2_OPTIMIZATIONS && newCode != oldCode) { 461 if (REPORT_PASS2_OPTIMIZATIONS && newCode != oldCode) {
461 log("Pass 2 optimization:"); 462 log("Pass 2 optimization:");
462 log("Before:\n$oldCode"); 463 log("Before:\n$oldCode");
463 log("After:\n$newCode"); 464 log("After:\n$newCode");
464 } 465 }
465 } 466 }
466 } 467 }
467 468
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 // invariant that endOffset > beginOffset, but for EOF the 739 // invariant that endOffset > beginOffset, but for EOF the
739 // charoffset of the next token may be [beginOffset]. This can 740 // charoffset of the next token may be [beginOffset]. This can
740 // also happen for synthetized tokens that are produced during 741 // also happen for synthetized tokens that are produced during
741 // error handling. 742 // error handling.
742 final endOffset = 743 final endOffset =
743 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1); 744 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1);
744 assert(endOffset > beginOffset); 745 assert(endOffset > beginOffset);
745 return f(beginOffset, endOffset); 746 return f(beginOffset, endOffset);
746 } 747 }
747 } 748 }
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