| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 log('compilation succeeded'); | 126 log('compilation succeeded'); |
| 127 return true; | 127 return true; |
| 128 } | 128 } |
| 129 | 129 |
| 130 void scanCoreLibrary() { | 130 void scanCoreLibrary() { |
| 131 String fileName = io.join([legDirectory, 'lib', 'core.dart']); | 131 String fileName = io.join([legDirectory, 'lib', 'core.dart']); |
| 132 currentElement = new CompilationUnitElement( | 132 currentElement = new CompilationUnitElement( |
| 133 readScript(fileName), currentLibrary); | 133 readScript(fileName), currentLibrary); |
| 134 scanner.scan(currentElement); | 134 scanner.scan(currentElement); |
| 135 // Make our special function a foreign kind. | 135 // Make our special function a foreign kind. |
| 136 universe.define(new ForeignElement(const SourceString('JS'))); | 136 universe.define(new ForeignElement(const SourceString('JS')), this); |
| 137 universe.define(new ForeignElement(const SourceString('UNINTERCEPTED'))); | 137 universe.define(new ForeignElement(const SourceString('UNINTERCEPTED')), |
| 138 this); |
| 138 // TODO(ngeoffray): Lazily add this method. | 139 // TODO(ngeoffray): Lazily add this method. |
| 139 universe.invokedNames[NO_SUCH_METHOD] = new Set<int>.from(<int>[2]); | 140 universe.invokedNames[NO_SUCH_METHOD] = new Set<int>.from(<int>[2]); |
| 140 } | 141 } |
| 141 | 142 |
| 142 void enqueueInvokedInstanceMethods() { | 143 void enqueueInvokedInstanceMethods() { |
| 143 // TODO(floitsch): find a more efficient way of doing this. | 144 // TODO(floitsch): find a more efficient way of doing this. |
| 144 // Run through the classes and see if we need to compile methods. | 145 // Run through the classes and see if we need to compile methods. |
| 145 for (ClassElement classElement in universe.instantiatedClasses) { | 146 for (ClassElement classElement in universe.instantiatedClasses) { |
| 146 for (ClassElement currentClass = classElement; | 147 for (ClassElement currentClass = classElement; |
| 147 currentClass !== null; | 148 currentClass !== null; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 298 |
| 298 class CompilerCancelledException implements Exception { | 299 class CompilerCancelledException implements Exception { |
| 299 final String reason; | 300 final String reason; |
| 300 CompilerCancelledException(this.reason); | 301 CompilerCancelledException(this.reason); |
| 301 | 302 |
| 302 String toString() { | 303 String toString() { |
| 303 String banner = 'compiler cancelled'; | 304 String banner = 'compiler cancelled'; |
| 304 return (reason !== null) ? '$banner: $reason' : '$banner'; | 305 return (reason !== null) ? '$banner: $reason' : '$banner'; |
| 305 } | 306 } |
| 306 } | 307 } |
| OLD | NEW |