| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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')), this); | 136 universe.define(new ForeignElement(const SourceString('JS')), this); |
| 137 universe.define(new ForeignElement(const SourceString('UNINTERCEPTED')), | 137 universe.define(new ForeignElement( |
| 138 this); | 138 const SourceString('UNINTERCEPTED')), this); |
| 139 universe.define(new ForeignElement( |
| 140 const SourceString('JS_HAS_EQUALS')), this); |
| 139 // TODO(ngeoffray): Lazily add this method. | 141 // TODO(ngeoffray): Lazily add this method. |
| 140 universe.invokedNames[NO_SUCH_METHOD] = new Set<int>.from(<int>[2]); | 142 universe.invokedNames[NO_SUCH_METHOD] = new Set<int>.from(<int>[2]); |
| 141 } | 143 } |
| 142 | 144 |
| 143 void enqueueInvokedInstanceMethods() { | 145 void enqueueInvokedInstanceMethods() { |
| 144 // TODO(floitsch): find a more efficient way of doing this. | 146 // TODO(floitsch): find a more efficient way of doing this. |
| 145 // Run through the classes and see if we need to compile methods. | 147 // Run through the classes and see if we need to compile methods. |
| 146 for (ClassElement classElement in universe.instantiatedClasses) { | 148 for (ClassElement classElement in universe.instantiatedClasses) { |
| 147 for (ClassElement currentClass = classElement; | 149 for (ClassElement currentClass = classElement; |
| 148 currentClass !== null; | 150 currentClass !== null; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 309 |
| 308 class CompilerCancelledException implements Exception { | 310 class CompilerCancelledException implements Exception { |
| 309 final String reason; | 311 final String reason; |
| 310 CompilerCancelledException(this.reason); | 312 CompilerCancelledException(this.reason); |
| 311 | 313 |
| 312 String toString() { | 314 String toString() { |
| 313 String banner = 'compiler cancelled'; | 315 String banner = 'compiler cancelled'; |
| 314 return (reason !== null) ? '$banner: $reason' : '$banner'; | 316 return (reason !== null) ? '$banner: $reason' : '$banner'; |
| 315 } | 317 } |
| 316 } | 318 } |
| OLD | NEW |