| 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 Function run; | 8 Function run; |
| 9 Map<int, BailoutInfo> bailouts = null; | 9 Map<int, BailoutInfo> bailouts = null; |
| 10 bool allowSpeculativeOptimization = true; | 10 bool allowSpeculativeOptimization = true; |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 261 } |
| 262 | 262 |
| 263 TreeElements analyze(WorkItem work) { | 263 TreeElements analyze(WorkItem work) { |
| 264 work.resolutionTree = analyzeElement(work.element); | 264 work.resolutionTree = analyzeElement(work.element); |
| 265 return work.resolutionTree; | 265 return work.resolutionTree; |
| 266 } | 266 } |
| 267 | 267 |
| 268 String codegen(WorkItem work) { | 268 String codegen(WorkItem work) { |
| 269 String code; | 269 String code; |
| 270 if (work.element.kind == ElementKind.FIELD | 270 if (work.element.kind == ElementKind.FIELD |
| 271 || work.element.kind == ElementKind.PARAMETER) { | 271 || work.element.kind == ElementKind.PARAMETER |
| 272 || work.element.kind == ElementKind.FIELD_PARAMETER) { |
| 272 constantHandler.compileWorkItem(work); | 273 constantHandler.compileWorkItem(work); |
| 273 return null; | 274 return null; |
| 274 } else { | 275 } else { |
| 275 HGraph graph = builder.build(work); | 276 HGraph graph = builder.build(work); |
| 276 optimizer.optimize(work, graph); | 277 optimizer.optimize(work, graph); |
| 277 code = generator.generate(work, graph); | 278 code = generator.generate(work, graph); |
| 278 universe.addGeneratedCode(work, code); | 279 universe.addGeneratedCode(work, code); |
| 279 return code; | 280 return code; |
| 280 } | 281 } |
| 281 } | 282 } |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 } | 476 } |
| 476 } | 477 } |
| 477 | 478 |
| 478 class SourceSpan { | 479 class SourceSpan { |
| 479 final Uri uri; | 480 final Uri uri; |
| 480 final int begin; | 481 final int begin; |
| 481 final int end; | 482 final int end; |
| 482 | 483 |
| 483 const SourceSpan(this.uri, this.begin, this.end); | 484 const SourceSpan(this.uri, this.begin, this.end); |
| 484 } | 485 } |
| OLD | NEW |