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

Side by Side Diff: pkg/dart2js_incremental/lib/library_updater.dart

Issue 925943002: Refactor SourceFile, SourceFileProvider and SourceLocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js_incremental.library_updater; 5 library dart2js_incremental.library_updater;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:convert' show 10 import 'dart:convert' show
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 _entrySourceFiles.remove(library); 283 _entrySourceFiles.remove(library);
284 } 284 }
285 285
286 Future<Script> _updatedScript(Script before, LibraryElementX library) { 286 Future<Script> _updatedScript(Script before, LibraryElementX library) {
287 if (before == library.entryCompilationUnit.script && 287 if (before == library.entryCompilationUnit.script &&
288 _entrySourceFiles.containsKey(library)) { 288 _entrySourceFiles.containsKey(library)) {
289 return new Future.value(before.copyWithFile(_entrySourceFiles[library])); 289 return new Future.value(before.copyWithFile(_entrySourceFiles[library]));
290 } 290 }
291 291
292 return _readUri(before.resourceUri).then((bytes) { 292 return _readUri(before.resourceUri).then((bytes) {
293 Uri uri = before.file.uri;
293 String filename = before.file.filename; 294 String filename = before.file.filename;
294 SourceFile sourceFile = bytes is String 295 SourceFile sourceFile = bytes is String
295 ? new StringSourceFile(filename, bytes) 296 ? new StringSourceFile(uri, filename, bytes)
296 : new CachingUtf8BytesSourceFile(filename, bytes); 297 : new CachingUtf8BytesSourceFile(uri, filename, bytes);
297 return before.copyWithFile(sourceFile); 298 return before.copyWithFile(sourceFile);
298 }); 299 });
299 } 300 }
300 301
301 Future<bool> _haveTagsChanged(LibraryElement library) { 302 Future<bool> _haveTagsChanged(LibraryElement library) {
302 Script before = library.entryCompilationUnit.script; 303 Script before = library.entryCompilationUnit.script;
303 if (!_context._uriHasUpdate(before.resourceUri)) { 304 if (!_context._uriHasUpdate(before.resourceUri)) {
304 // The entry compilation unit hasn't been updated. So the tags aren't 305 // The entry compilation unit hasn't been updated. So the tags aren't
305 // changed. 306 // changed.
306 return new Future<bool>.value(false); 307 return new Future<bool>.value(false);
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 .buildFieldsHackForIncrementalCompilation(classElement); 1487 .buildFieldsHackForIncrementalCompilation(classElement);
1487 // TODO(ahe): Rewrite for new emitter. 1488 // TODO(ahe): Rewrite for new emitter.
1488 ClassBuilder builder = new ClassBuilder(classElement, namer); 1489 ClassBuilder builder = new ClassBuilder(classElement, namer);
1489 classEmitter.emitFields(cls, builder); 1490 classEmitter.emitFields(cls, builder);
1490 return builder.fields; 1491 return builder.fields;
1491 } 1492 }
1492 } 1493 }
1493 1494
1494 // TODO(ahe): Remove this method. 1495 // TODO(ahe): Remove this method.
1495 NO_WARN(x) => x; 1496 NO_WARN(x) => x;
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | sdk/lib/_internal/pub/lib/src/barback/dart2js_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698