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

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

Issue 785303003: Add option for outputting a deferred loading mapping. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated format Created 5 years, 11 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) 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 js_backend; 5 part of js_backend;
6 6
7 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR");
10 10
(...skipping 2289 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 aliasedSuperMembers.remove(element); 2300 aliasedSuperMembers.remove(element);
2301 } 2301 }
2302 2302
2303 void registerMainHasArguments(Enqueuer enqueuer) { 2303 void registerMainHasArguments(Enqueuer enqueuer) {
2304 // If the main method takes arguments, this compilation could be the target 2304 // If the main method takes arguments, this compilation could be the target
2305 // of Isolate.spawnUri. Strictly speaking, that can happen also if main 2305 // of Isolate.spawnUri. Strictly speaking, that can happen also if main
2306 // takes no arguments, but in this case the spawned isolate can't 2306 // takes no arguments, but in this case the spawned isolate can't
2307 // communicate with the spawning isolate. 2307 // communicate with the spawning isolate.
2308 enqueuer.enableIsolateSupport(); 2308 enqueuer.enableIsolateSupport();
2309 } 2309 }
2310
2311 /// Returns the filename for the output-unit named [name].
2312 /// The filename is of the form "<main output file>_<name>.part.js".
floitsch 2015/01/08 13:41:07 Probably needs a new line before. Ok. But now it
sigurdm 2015/01/09 10:16:55 Done.
2313 /// If [addExtension] is false, the ".part.js" suffix is left out.
2314 String deferredPartFileName(String name, {bool addExtension: true}) {
2315 assert(name != "");
2316 String outPath = compiler.outputUri != null
2317 ? compiler.outputUri.path
2318 : "out";
2319 String outName = outPath.substring(outPath.lastIndexOf('/') + 1);
2320 String extension = addExtension ? ".part.js" : "";
2321 return "${outName}_$name$extension";
2322 }
2310 } 2323 }
2311 2324
2312 class JavaScriptResolutionCallbacks extends ResolutionCallbacks { 2325 class JavaScriptResolutionCallbacks extends ResolutionCallbacks {
2313 final JavaScriptBackend backend; 2326 final JavaScriptBackend backend;
2314 2327
2315 JavaScriptResolutionCallbacks(this.backend); 2328 JavaScriptResolutionCallbacks(this.backend);
2316 2329
2317 void registerBackendStaticInvocation(Element element, Registry registry) { 2330 void registerBackendStaticInvocation(Element element, Registry registry) {
2318 registry.registerStaticInvocation(backend.registerBackendUse(element)); 2331 registry.registerStaticInvocation(backend.registerBackendUse(element));
2319 } 2332 }
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 } 2519 }
2507 } 2520 }
2508 2521
2509 /// Records that [constant] is used by the element behind [registry]. 2522 /// Records that [constant] is used by the element behind [registry].
2510 class Dependency { 2523 class Dependency {
2511 final ConstantValue constant; 2524 final ConstantValue constant;
2512 final Element annotatedElement; 2525 final Element annotatedElement;
2513 2526
2514 const Dependency(this.constant, this.annotatedElement); 2527 const Dependency(this.constant, this.annotatedElement);
2515 } 2528 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698