| 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 class WorkItem { | 5 class WorkItem { |
| 6 final Element element; | 6 final Element element; |
| 7 TreeElements resolutionTree; | 7 TreeElements resolutionTree; |
| 8 bool allowSpeculativeOptimization = true; | 8 bool allowSpeculativeOptimization = true; |
| 9 List<HTypeGuard> guards = const <HTypeGuard>[]; | 9 List<HTypeGuard> guards = const <HTypeGuard>[]; |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 optimizer.prepareForSpeculativeOptimizations(work, graph); | 54 optimizer.prepareForSpeculativeOptimizations(work, graph); |
| 55 optimizer.optimize(work, graph); | 55 optimizer.optimize(work, graph); |
| 56 } | 56 } |
| 57 return generator.generateMethod(work, graph); | 57 return generator.generateMethod(work, graph); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void processNativeClasses(world, libraries) { | 60 void processNativeClasses(world, libraries) { |
| 61 native.processNativeClasses(world, emitter, libraries); | 61 native.processNativeClasses(world, emitter, libraries); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void assembleProgram() => emitter.assembleProgram(); | 64 void assembleProgram() { |
| 65 emitter.assembleProgram(); |
| 66 } |
| 65 } | 67 } |
| 66 | 68 |
| 67 class DartBackend extends Backend { | 69 class DartBackend extends Backend { |
| 68 DartBackend(Compiler compiler) : super(compiler); | 70 DartBackend(Compiler compiler) : super(compiler); |
| 69 } | 71 } |
| 70 | 72 |
| 71 class Compiler implements DiagnosticListener { | 73 class Compiler implements DiagnosticListener { |
| 72 final Map<String, LibraryElement> libraries; | 74 final Map<String, LibraryElement> libraries; |
| 73 int nextFreeClassId = 0; | 75 int nextFreeClassId = 0; |
| 74 World world; | 76 World world; |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 // invariant that endOffset > beginOffset, but for EOF the | 576 // invariant that endOffset > beginOffset, but for EOF the |
| 575 // charoffset of the next token may be [beginOffset]. This can | 577 // charoffset of the next token may be [beginOffset]. This can |
| 576 // also happen for synthetized tokens that are produced during | 578 // also happen for synthetized tokens that are produced during |
| 577 // error handling. | 579 // error handling. |
| 578 final endOffset = | 580 final endOffset = |
| 579 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1); | 581 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1); |
| 580 assert(endOffset > beginOffset); | 582 assert(endOffset > beginOffset); |
| 581 return f(beginOffset, endOffset); | 583 return f(beginOffset, endOffset); |
| 582 } | 584 } |
| 583 } | 585 } |
| OLD | NEW |