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

Side by Side Diff: lib/compiler/implementation/compiler.dart

Issue 10828413: Only add JS once, and not to very single patched library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased. Created 8 years, 4 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 | no next file » | 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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 final bool REPORT_EXCESS_RESOLUTION = false; 10 final bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 scanner.importLibrary(library, 372 scanner.importLibrary(library,
373 coreLibrary, 373 coreLibrary,
374 null, 374 null,
375 library.entryCompilationUnit); 375 library.entryCompilationUnit);
376 } 376 }
377 377
378 void patchDartLibrary(LibraryElement library, String dartLibraryPath) { 378 void patchDartLibrary(LibraryElement library, String dartLibraryPath) {
379 if (library.isPatched) return; 379 if (library.isPatched) return;
380 Uri patchUri = resolvePatchUri(dartLibraryPath); 380 Uri patchUri = resolvePatchUri(dartLibraryPath);
381 if (patchUri !== null) { 381 if (patchUri !== null) {
382 patchParser.patchLibrary(patchUri, library); 382 patchParser.patchLibrary(patchUri, library);
383 // We allow foreign functions in patched libraries.
384 addForeignFunctions(library); // Is safe even if already added.
385 } 383 }
386 } 384 }
387 385
388 void applyContainerPatch(ScopeContainerElement original, 386 void applyContainerPatch(ScopeContainerElement original,
389 Link<Element> patches) { 387 Link<Element> patches) {
390 while (!patches.isEmpty()) { 388 while (!patches.isEmpty()) {
391 Element patchElement = patches.head; 389 Element patchElement = patches.head;
392 Element originalElement = original.localLookup(patchElement.name); 390 Element originalElement = original.localLookup(patchElement.name);
393 if (patchElement.isAccessor()) { 391 if (patchElement.isAccessor()) {
394 // TODO(lrn): When we change to always add accessors to members, and 392 // TODO(lrn): When we change to always add accessors to members, and
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 final endOffset = end.charOffset + end.slowCharCount; 899 final endOffset = end.charOffset + end.slowCharCount;
902 900
903 // [begin] and [end] might be the same for the same empty token. This 901 // [begin] and [end] might be the same for the same empty token. This
904 // happens for instance when scanning '$$'. 902 // happens for instance when scanning '$$'.
905 assert(endOffset >= beginOffset); 903 assert(endOffset >= beginOffset);
906 return f(beginOffset, endOffset); 904 return f(beginOffset, endOffset);
907 } 905 }
908 906
909 String toString() => 'SourceSpan($uri, $begin, $end)'; 907 String toString() => 'SourceSpan($uri, $begin, $end)';
910 } 908 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698