| 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 bool allowSpeculativeOptimization = true; | 10 bool allowSpeculativeOptimization = true; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 | 252 |
| 253 void runCompiler(Script script) { | 253 void runCompiler(Script script) { |
| 254 scanBuiltinLibraries(); | 254 scanBuiltinLibraries(); |
| 255 mainApp = new LibraryElement(script); | 255 mainApp = new LibraryElement(script); |
| 256 native.checkNativeSupport(this, mainApp); |
| 257 |
| 256 Element element; | 258 Element element; |
| 257 withCurrentElement(mainApp, () { | 259 withCurrentElement(mainApp, () { |
| 258 scanner.scan(currentElement); | 260 scanner.scan(currentElement); |
| 259 element = mainApp.find(MAIN); | 261 element = mainApp.find(MAIN); |
| 260 if (element === null) cancel('Could not find $MAIN'); | 262 if (element === null) cancel('Could not find $MAIN'); |
| 261 }); | 263 }); |
| 262 worklist.add(new WorkItem.toCompile(element)); | 264 worklist.add(new WorkItem.toCompile(element)); |
| 263 do { | 265 do { |
| 264 while (!worklist.isEmpty()) { | 266 while (!worklist.isEmpty()) { |
| 265 WorkItem work = worklist.removeLast(); | 267 WorkItem work = worklist.removeLast(); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 401 |
| 400 class CompilerCancelledException implements Exception { | 402 class CompilerCancelledException implements Exception { |
| 401 final String reason; | 403 final String reason; |
| 402 CompilerCancelledException(this.reason); | 404 CompilerCancelledException(this.reason); |
| 403 | 405 |
| 404 String toString() { | 406 String toString() { |
| 405 String banner = 'compiler cancelled'; | 407 String banner = 'compiler cancelled'; |
| 406 return (reason !== null) ? '$banner: $reason' : '$banner'; | 408 return (reason !== null) ? '$banner: $reason' : '$banner'; |
| 407 } | 409 } |
| 408 } | 410 } |
| OLD | NEW |