Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1066)

Side by Side Diff: frog/leg/compiler.dart

Issue 9027002: Support factory methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/leg/elements/elements.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698