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

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

Issue 2288453002: Make source map paths relative (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Fix paths in map Created 4 years, 3 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
« no previous file with comments | « no previous file | lib/src/compiler/compiler.dart » ('j') | lib/src/compiler/compiler.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'dart:collection' show HashMap, HashSet; 5 import 'dart:collection' show HashMap, HashSet;
6 import 'dart:math' show min, max; 6 import 'dart:math' show min, max;
7 7
8 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 8 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType; 10 import 'package:analyzer/dart/ast/token.dart' show Token, TokenType;
(...skipping 11 matching lines...) Expand all
22 import 'package:analyzer/src/summary/summarize_elements.dart' 22 import 'package:analyzer/src/summary/summarize_elements.dart'
23 show PackageBundleAssembler; 23 show PackageBundleAssembler;
24 import 'package:analyzer/src/task/strong/ast_properties.dart' 24 import 'package:analyzer/src/task/strong/ast_properties.dart'
25 show isDynamicInvoke, setIsDynamicInvoke; 25 show isDynamicInvoke, setIsDynamicInvoke;
26 import 'package:path/path.dart' show separator; 26 import 'package:path/path.dart' show separator;
27 27
28 import '../closure/closure_annotator.dart' show ClosureAnnotator; 28 import '../closure/closure_annotator.dart' show ClosureAnnotator;
29 import '../js_ast/js_ast.dart' as JS; 29 import '../js_ast/js_ast.dart' as JS;
30 import '../js_ast/js_ast.dart' show js; 30 import '../js_ast/js_ast.dart' show js;
31 import 'ast_builder.dart' show AstBuilder; 31 import 'ast_builder.dart' show AstBuilder;
32 import 'compiler.dart' 32 import 'compiler.dart' show BuildUnit, CompilerOptions, JSModuleFile;
33 show BuildUnit, CompilerOptions, JSModuleFile;
34 import 'element_helpers.dart'; 33 import 'element_helpers.dart';
35 import 'element_loader.dart' show ElementLoader; 34 import 'element_loader.dart' show ElementLoader;
36 import 'extension_types.dart' show ExtensionTypeSet; 35 import 'extension_types.dart' show ExtensionTypeSet;
37 import 'js_field_storage.dart' show checkForPropertyOverride, getSuperclasses; 36 import 'js_field_storage.dart' show checkForPropertyOverride, getSuperclasses;
38 import 'js_interop.dart'; 37 import 'js_interop.dart';
39 import 'js_metalet.dart' as JS; 38 import 'js_metalet.dart' as JS;
40 import 'js_names.dart' as JS; 39 import 'js_names.dart' as JS;
41 import 'js_typeref_codegen.dart' show JsTypeRefCodegen; 40 import 'js_typeref_codegen.dart' show JsTypeRefCodegen;
42 import 'module_builder.dart' show pathToJSIdentifier; 41 import 'module_builder.dart' show pathToJSIdentifier;
43 import 'nullable_type_inference.dart' show NullableTypeInference; 42 import 'nullable_type_inference.dart' show NullableTypeInference;
(...skipping 3173 matching lines...) Expand 10 before | Expand all | Expand 10 after
3217 var element = node.methodName.staticElement; 3216 var element = node.methodName.staticElement;
3218 bool isStatic = element is ExecutableElement && element.isStatic; 3217 bool isStatic = element is ExecutableElement && element.isStatic;
3219 var memberName = _emitMemberName(name, type: type, isStatic: isStatic); 3218 var memberName = _emitMemberName(name, type: type, isStatic: isStatic);
3220 3219
3221 JS.Expression jsTarget = _visit(target); 3220 JS.Expression jsTarget = _visit(target);
3222 if (isDynamicInvoke(target) || isDynamicInvoke(node.methodName)) { 3221 if (isDynamicInvoke(target) || isDynamicInvoke(node.methodName)) {
3223 if (_inWhitelistCode(target)) { 3222 if (_inWhitelistCode(target)) {
3224 var vars = <JS.MetaLetVariable, JS.Expression>{}; 3223 var vars = <JS.MetaLetVariable, JS.Expression>{};
3225 var l = _visit(_bindValue(vars, 'l', target)); 3224 var l = _visit(_bindValue(vars, 'l', target));
3226 jsTarget = new JS.MetaLet(vars, [ 3225 jsTarget = new JS.MetaLet(vars, [
3227 js.call('(#[(#[dart._extensionType]) ? dartx[#] : #])', [ 3226 js.call('(#[(#[dart._extensionType]) ? dartx[#] : #])',
3228 l, 3227 [l, l, memberName, memberName,])
3229 l,
3230 memberName,
3231 memberName,
3232 ])
3233 ]); 3228 ]);
3234 if (typeArgs != null) jsTarget = new JS.Call(jsTarget, typeArgs); 3229 if (typeArgs != null) jsTarget = new JS.Call(jsTarget, typeArgs);
3235 return new JS.Call(jsTarget, args); 3230 return new JS.Call(jsTarget, args);
3236 } 3231 }
3237 if (typeArgs != null) { 3232 if (typeArgs != null) {
3238 return js.call('dart.dgsend(#, #, #, #)', 3233 return js.call('dart.dgsend(#, #, #, #)',
3239 [jsTarget, new JS.ArrayInitializer(typeArgs), memberName, args]); 3234 [jsTarget, new JS.ArrayInitializer(typeArgs), memberName, args]);
3240 } else { 3235 } else {
3241 return js.call('dart.dsend(#, #, #)', [jsTarget, memberName, args]); 3236 return js.call('dart.dsend(#, #, #)', [jsTarget, memberName, args]);
3242 } 3237 }
(...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after
5368 } 5363 }
5369 5364
5370 bool isLibraryPrefix(Expression node) => 5365 bool isLibraryPrefix(Expression node) =>
5371 node is SimpleIdentifier && node.staticElement is PrefixElement; 5366 node is SimpleIdentifier && node.staticElement is PrefixElement;
5372 5367
5373 LibraryElement _getLibrary(AnalysisContext c, String uri) => 5368 LibraryElement _getLibrary(AnalysisContext c, String uri) =>
5374 c.computeLibraryElement(c.sourceFactory.forUri(uri)); 5369 c.computeLibraryElement(c.sourceFactory.forUri(uri));
5375 5370
5376 bool _isDartRuntime(LibraryElement l) => 5371 bool _isDartRuntime(LibraryElement l) =>
5377 l.isInSdk && l.source.uri.toString() == 'dart:_runtime'; 5372 l.isInSdk && l.source.uri.toString() == 'dart:_runtime';
OLDNEW
« no previous file with comments | « no previous file | lib/src/compiler/compiler.dart » ('j') | lib/src/compiler/compiler.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698