| OLD | NEW |
| 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 2279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2290 aliasedSuperMembers.remove(element); | 2290 aliasedSuperMembers.remove(element); |
| 2291 } | 2291 } |
| 2292 | 2292 |
| 2293 void registerMainHasArguments(Enqueuer enqueuer) { | 2293 void registerMainHasArguments(Enqueuer enqueuer) { |
| 2294 // If the main method takes arguments, this compilation could be the target | 2294 // If the main method takes arguments, this compilation could be the target |
| 2295 // of Isolate.spawnUri. Strictly speaking, that can happen also if main | 2295 // of Isolate.spawnUri. Strictly speaking, that can happen also if main |
| 2296 // takes no arguments, but in this case the spawned isolate can't | 2296 // takes no arguments, but in this case the spawned isolate can't |
| 2297 // communicate with the spawning isolate. | 2297 // communicate with the spawning isolate. |
| 2298 enqueuer.enableIsolateSupport(); | 2298 enqueuer.enableIsolateSupport(); |
| 2299 } | 2299 } |
| 2300 |
| 2301 /// Returns the filename for the output-unit named [name]. |
| 2302 /// |
| 2303 /// The filename is of the form "<main output file>_<name>.part.js". |
| 2304 /// If [addExtension] is false, the ".part.js" suffix is left out. |
| 2305 String deferredPartFileName(String name, {bool addExtension: true}) { |
| 2306 assert(name != ""); |
| 2307 String outPath = compiler.outputUri != null |
| 2308 ? compiler.outputUri.path |
| 2309 : "out"; |
| 2310 String outName = outPath.substring(outPath.lastIndexOf('/') + 1); |
| 2311 String extension = addExtension ? ".part.js" : ""; |
| 2312 return "${outName}_$name$extension"; |
| 2313 } |
| 2300 } | 2314 } |
| 2301 | 2315 |
| 2302 class JavaScriptResolutionCallbacks extends ResolutionCallbacks { | 2316 class JavaScriptResolutionCallbacks extends ResolutionCallbacks { |
| 2303 final JavaScriptBackend backend; | 2317 final JavaScriptBackend backend; |
| 2304 | 2318 |
| 2305 JavaScriptResolutionCallbacks(this.backend); | 2319 JavaScriptResolutionCallbacks(this.backend); |
| 2306 | 2320 |
| 2307 void registerBackendStaticInvocation(Element element, Registry registry) { | 2321 void registerBackendStaticInvocation(Element element, Registry registry) { |
| 2308 registry.registerStaticInvocation(backend.registerBackendUse(element)); | 2322 registry.registerStaticInvocation(backend.registerBackendUse(element)); |
| 2309 } | 2323 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2496 } | 2510 } |
| 2497 } | 2511 } |
| 2498 | 2512 |
| 2499 /// Records that [constant] is used by the element behind [registry]. | 2513 /// Records that [constant] is used by the element behind [registry]. |
| 2500 class Dependency { | 2514 class Dependency { |
| 2501 final ConstantValue constant; | 2515 final ConstantValue constant; |
| 2502 final Element annotatedElement; | 2516 final Element annotatedElement; |
| 2503 | 2517 |
| 2504 const Dependency(this.constant, this.annotatedElement); | 2518 const Dependency(this.constant, this.annotatedElement); |
| 2505 } | 2519 } |
| OLD | NEW |