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

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 893963005: Refactor handling of source map information. (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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/dart2jslib.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 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 Token position = element.position; 1899 Token position = element.position;
1900 Uri uri = element.compilationUnit.script.readableUri; 1900 Uri uri = element.compilationUnit.script.readableUri;
1901 return (position == null) 1901 return (position == null)
1902 ? new SourceSpan(uri, 0, 0) 1902 ? new SourceSpan(uri, 0, 0)
1903 : spanFromTokens(position, position, uri); 1903 : spanFromTokens(position, position, uri);
1904 } 1904 }
1905 1905
1906 SourceSpan spanFromHInstruction(HInstruction instruction) { 1906 SourceSpan spanFromHInstruction(HInstruction instruction) {
1907 Element element = _elementFromHInstruction(instruction); 1907 Element element = _elementFromHInstruction(instruction);
1908 if (element == null) element = currentElement; 1908 if (element == null) element = currentElement;
1909 var position = instruction.sourcePosition; 1909 SourceInformation position = instruction.sourceInformation;
1910 if (position == null) return spanFromElement(element); 1910 if (position == null) return spanFromElement(element);
1911 Token token = position.token; 1911 return position.sourceSpan;
1912 if (token == null) return spanFromElement(element);
1913 Uri uri = element.compilationUnit.script.readableUri;
1914 return spanFromTokens(token, token, uri);
1915 } 1912 }
1916 1913
1917 /** 1914 /**
1918 * Translates the [resolvedUri] into a readable URI. 1915 * Translates the [resolvedUri] into a readable URI.
1919 * 1916 *
1920 * The [importingLibrary] holds the library importing [resolvedUri] or 1917 * The [importingLibrary] holds the library importing [resolvedUri] or
1921 * [:null:] if [resolvedUri] is loaded as the main library. The 1918 * [:null:] if [resolvedUri] is loaded as the main library. The
1922 * [importingLibrary] is used to grant access to internal libraries from 1919 * [importingLibrary] is used to grant access to internal libraries from
1923 * platform libraries and patch libraries. 1920 * platform libraries and patch libraries.
1924 * 1921 *
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
2407 return futureClass.computeType(compiler).createInstantiation([elementType]); 2404 return futureClass.computeType(compiler).createInstantiation([elementType]);
2408 } 2405 }
2409 2406
2410 @override 2407 @override
2411 InterfaceType streamType([DartType elementType = const DynamicType()]) { 2408 InterfaceType streamType([DartType elementType = const DynamicType()]) {
2412 return streamClass.computeType(compiler).createInstantiation([elementType]); 2409 return streamClass.computeType(compiler).createInstantiation([elementType]);
2413 } 2410 }
2414 } 2411 }
2415 2412
2416 typedef void InternalErrorFunction(Spannable location, String message); 2413 typedef void InternalErrorFunction(Spannable location, String message);
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/dart2jslib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698