Chromium Code Reviews| 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 | 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |