| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 void ensure(bool condition) { | 70 void ensure(bool condition) { |
| 71 if (!condition) cancel('failed assertion in leg'); | 71 if (!condition) cancel('failed assertion in leg'); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void unimplemented(String methodName, | 74 void unimplemented(String methodName, |
| 75 [Node node, Token token, HInstruction instruction]) { | 75 [Node node, Token token, HInstruction instruction]) { |
| 76 cancel("$methodName not implemented", node, token, instruction); | 76 cancel("$methodName not implemented", node, token, instruction); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void internalError(String message, |
| 80 [Node node, Token token, HInstruction instruction]) { |
| 81 cancel("Internal Error: $message", node, token, instruction); |
| 82 } |
| 83 |
| 79 void cancel([String reason, Node node, Token token, | 84 void cancel([String reason, Node node, Token token, |
| 80 HInstruction instruction]) { | 85 HInstruction instruction]) { |
| 81 throw new CompilerCancelledException(reason); | 86 throw new CompilerCancelledException(reason); |
| 82 } | 87 } |
| 83 | 88 |
| 84 void log(message) { | 89 void log(message) { |
| 85 // Do nothing. | 90 // Do nothing. |
| 86 } | 91 } |
| 87 | 92 |
| 88 bool run(Script script) { | 93 bool run(Script script) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 250 |
| 246 class CompilerCancelledException implements Exception { | 251 class CompilerCancelledException implements Exception { |
| 247 final String reason; | 252 final String reason; |
| 248 CompilerCancelledException(this.reason); | 253 CompilerCancelledException(this.reason); |
| 249 | 254 |
| 250 String toString() { | 255 String toString() { |
| 251 String banner = 'compiler cancelled'; | 256 String banner = 'compiler cancelled'; |
| 252 return (reason !== null) ? '$banner: $reason' : '$banner'; | 257 return (reason !== null) ? '$banner: $reason' : '$banner'; |
| 253 } | 258 } |
| 254 } | 259 } |
| OLD | NEW |