| 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 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 void ensure(bool condition) { | 83 void ensure(bool condition) { |
| 84 if (!condition) cancel('failed assertion in leg'); | 84 if (!condition) cancel('failed assertion in leg'); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void unimplemented(String methodName, | 87 void unimplemented(String methodName, |
| 88 [Node node, Token token, HInstruction instruction]) { | 88 [Node node, Token token, HInstruction instruction]) { |
| 89 cancel("$methodName not implemented", node, token, instruction); | 89 cancel("$methodName not implemented", node, token, instruction); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void internalError(String message, | 92 void internalError(String message, |
| 93 [Node node, Token token, HInstruction instruction]) { | 93 [Node node, Token token, HInstruction instruction, |
| 94 cancel("Internal Error: $message", node, token, instruction); | 94 Element element]) { |
| 95 cancel("Internal Error: $message", node, token, instruction, element); |
| 95 } | 96 } |
| 96 | 97 |
| 97 void cancel([String reason, Node node, Token token, | 98 void cancel([String reason, Node node, Token token, |
| 98 HInstruction instruction]) { | 99 HInstruction instruction, Element element]) { |
| 99 throw new CompilerCancelledException(reason); | 100 throw new CompilerCancelledException(reason); |
| 100 } | 101 } |
| 101 | 102 |
| 102 void log(message) { | 103 void log(message) { |
| 103 // Do nothing. | 104 // Do nothing. |
| 104 } | 105 } |
| 105 | 106 |
| 106 void enqueue(WorkItem work) { | 107 void enqueue(WorkItem work) { |
| 107 worklist.add(work); | 108 worklist.add(work); |
| 108 } | 109 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 | 297 |
| 297 class CompilerCancelledException implements Exception { | 298 class CompilerCancelledException implements Exception { |
| 298 final String reason; | 299 final String reason; |
| 299 CompilerCancelledException(this.reason); | 300 CompilerCancelledException(this.reason); |
| 300 | 301 |
| 301 String toString() { | 302 String toString() { |
| 302 String banner = 'compiler cancelled'; | 303 String banner = 'compiler cancelled'; |
| 303 return (reason !== null) ? '$banner: $reason' : '$banner'; | 304 return (reason !== null) ? '$banner: $reason' : '$banner'; |
| 304 } | 305 } |
| 305 } | 306 } |
| OLD | NEW |