| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 String compileMethod(WorkElement work) { | 167 String compileMethod(WorkElement work) { |
| 168 String code = universe.generatedCode[work.element]; | 168 String code = universe.generatedCode[work.element]; |
| 169 if (code !== null) return code; | 169 if (code !== null) return code; |
| 170 analyzeMethod(work); | 170 analyzeMethod(work); |
| 171 return codegenMethod(work); | 171 return codegenMethod(work); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void addToWorklist(Element element) { | 174 void addToWorklist(Element element) { |
| 175 if (element.kind === ElementKind.CONSTRUCTOR) { | 175 if (element.kind === ElementKind.GENERATIVE_CONSTRUCTOR) { |
| 176 registerInstantiatedClass(element.enclosingElement); | 176 registerInstantiatedClass(element.enclosingElement); |
| 177 } | 177 } |
| 178 worklist.add(new WorkElement.toCompile(element)); | 178 worklist.add(new WorkElement.toCompile(element)); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void registerStaticInvocation(Element element) { | 181 void registerStaticInvocation(Element element) { |
| 182 addToWorklist(element); | 182 addToWorklist(element); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void registerDynamicInvocation(String methodName) { | 185 void registerDynamicInvocation(String methodName) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 class CompilerCancelledException { | 240 class CompilerCancelledException { |
| 241 final String reason; | 241 final String reason; |
| 242 CompilerCancelledException(this.reason); | 242 CompilerCancelledException(this.reason); |
| 243 | 243 |
| 244 String toString() { | 244 String toString() { |
| 245 String banner = 'compiler cancelled'; | 245 String banner = 'compiler cancelled'; |
| 246 return (reason !== null) ? '$banner: $reason' : '$banner'; | 246 return (reason !== null) ? '$banner: $reason' : '$banner'; |
| 247 } | 247 } |
| 248 } | 248 } |
| OLD | NEW |