| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 WorkElement { | 5 class WorkElement { |
| 6 final Element element; | 6 final Element element; |
| 7 TreeElements resolutionTree; | 7 TreeElements resolutionTree; |
| 8 Function run; | 8 Function run; |
| 9 | 9 |
| 10 WorkElement.toCompile(this.element) : resolutionTree = null { | 10 WorkElement.toCompile(this.element) : resolutionTree = null { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 generator = new SsaCodeGeneratorTask(this); | 63 generator = new SsaCodeGeneratorTask(this); |
| 64 emitter = new CodeEmitterTask(this); | 64 emitter = new CodeEmitterTask(this); |
| 65 tasks = [scanner, parser, resolver, checker, builder, optimizer, generator, | 65 tasks = [scanner, parser, resolver, checker, builder, optimizer, generator, |
| 66 emitter]; | 66 emitter]; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void ensure(bool condition) { | 69 void ensure(bool condition) { |
| 70 if (!condition) cancel('failed assertion in leg'); | 70 if (!condition) cancel('failed assertion in leg'); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void unimplemented(String methodName) { | 73 void unimplemented(String methodName, |
| 74 cancel("$methodName not implemented"); | 74 [Node node, Token token, HInstruction instruction]) { |
| 75 cancel("$methodName not implemented", node, token, instruction); |
| 75 } | 76 } |
| 76 | 77 |
| 77 void cancel([String reason, Node node, Token token, | 78 void cancel([String reason, Node node, Token token, |
| 78 HInstruction instruction]) { | 79 HInstruction instruction]) { |
| 79 throw new CompilerCancelledException(reason); | 80 throw new CompilerCancelledException(reason); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void log(message) { | 83 void log(message) { |
| 83 // Do nothing. | 84 // Do nothing. |
| 84 } | 85 } |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 233 |
| 233 class CompilerCancelledException { | 234 class CompilerCancelledException { |
| 234 final String reason; | 235 final String reason; |
| 235 CompilerCancelledException(this.reason); | 236 CompilerCancelledException(this.reason); |
| 236 | 237 |
| 237 String toString() { | 238 String toString() { |
| 238 String banner = 'compiler cancelled'; | 239 String banner = 'compiler cancelled'; |
| 239 return (reason !== null) ? '$banner: $reason' : '$banner'; | 240 return (reason !== null) ? '$banner: $reason' : '$banner'; |
| 240 } | 241 } |
| 241 } | 242 } |
| OLD | NEW |