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

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

Issue 9413006: Handle imports of dart:core and dart:coreimpl (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 10 months 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 | dart/frog/leg/scanner/scanner_task.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) 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // we add the implicit import of coreLibrary now. This can be 162 // we add the implicit import of coreLibrary now. This can be
163 // cleaned up when we have proper support for "dart:core" and 163 // cleaned up when we have proper support for "dart:core" and
164 // don't need to access it through the field "coreLibrary". 164 // don't need to access it through the field "coreLibrary".
165 // TODO(ahe): Clean this up as described above. 165 // TODO(ahe): Clean this up as described above.
166 scanner.importLibrary(coreImplLibrary, coreLibrary, null); 166 scanner.importLibrary(coreImplLibrary, coreLibrary, null);
167 scanner.importLibrary(jsHelperLibrary, coreLibrary, null); 167 scanner.importLibrary(jsHelperLibrary, coreLibrary, null);
168 addForeignFunctions(jsHelperLibrary); 168 addForeignFunctions(jsHelperLibrary);
169 // TODO(ngeoffray): Lazily add this method. 169 // TODO(ngeoffray): Lazily add this method.
170 universe.invokedNames[NO_SUCH_METHOD] = 170 universe.invokedNames[NO_SUCH_METHOD] =
171 new Set<Invocation>.from(<Invocation>[new Invocation(2)]); 171 new Set<Invocation>.from(<Invocation>[new Invocation(2)]);
172
173 universe.libraries['dart:core'] = coreLibrary;
174 universe.libraries['dart:coreimpl'] = coreImplLibrary;
172 } 175 }
173 176
174 /** Define the JS helper functions in the given library. */ 177 /** Define the JS helper functions in the given library. */
175 void addForeignFunctions(LibraryElement library) { 178 void addForeignFunctions(LibraryElement library) {
176 library.define(new ForeignElement( 179 library.define(new ForeignElement(
177 const SourceString('JS'), library), this); 180 const SourceString('JS'), library), this);
178 library.define(new ForeignElement( 181 library.define(new ForeignElement(
179 const SourceString('UNINTERCEPTED'), library), this); 182 const SourceString('UNINTERCEPTED'), library), this);
180 library.define(new ForeignElement( 183 library.define(new ForeignElement(
181 const SourceString('JS_HAS_EQUALS'), library), this); 184 const SourceString('JS_HAS_EQUALS'), library), this);
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 369
367 class CompilerCancelledException implements Exception { 370 class CompilerCancelledException implements Exception {
368 final String reason; 371 final String reason;
369 CompilerCancelledException(this.reason); 372 CompilerCancelledException(this.reason);
370 373
371 String toString() { 374 String toString() {
372 String banner = 'compiler cancelled'; 375 String banner = 'compiler cancelled';
373 return (reason !== null) ? '$banner: $reason' : '$banner'; 376 return (reason !== null) ? '$banner: $reason' : '$banner';
374 } 377 }
375 } 378 }
OLDNEW
« no previous file with comments | « no previous file | dart/frog/leg/scanner/scanner_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698