| 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 /** | 7 /** |
| 8 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
| 9 * from the given element. | 9 * from the given element. |
| 10 */ | 10 */ |
| (...skipping 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 } | 1906 } |
| 1907 $mainEnsureGetter | 1907 $mainEnsureGetter |
| 1908 """); | 1908 """); |
| 1909 return "${namer.isolateAccess(isolateMain)}($mainAccess)"; | 1909 return "${namer.isolateAccess(isolateMain)}($mainAccess)"; |
| 1910 } | 1910 } |
| 1911 | 1911 |
| 1912 emitMain(CodeBuffer buffer) { | 1912 emitMain(CodeBuffer buffer) { |
| 1913 if (compiler.isMockCompilation) return; | 1913 if (compiler.isMockCompilation) return; |
| 1914 Element main = compiler.mainApp.find(Compiler.MAIN); | 1914 Element main = compiler.mainApp.find(Compiler.MAIN); |
| 1915 String mainCall = null; | 1915 String mainCall = null; |
| 1916 if (compiler.isolateLibrary != null) { | 1916 if (compiler.hasIsolateSupport()) { |
| 1917 Element isolateMain = | 1917 Element isolateMain = |
| 1918 compiler.isolateLibrary.find(Compiler.START_ROOT_ISOLATE); | 1918 compiler.isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE); |
| 1919 mainCall = buildIsolateSetup(buffer, main, isolateMain); | 1919 mainCall = buildIsolateSetup(buffer, main, isolateMain); |
| 1920 } else { | 1920 } else { |
| 1921 mainCall = '${namer.isolateAccess(main)}()'; | 1921 mainCall = '${namer.isolateAccess(main)}()'; |
| 1922 } | 1922 } |
| 1923 if (!compiler.enableMinification) { | 1923 if (!compiler.enableMinification) { |
| 1924 buffer.add(""" | 1924 buffer.add(""" |
| 1925 | 1925 |
| 1926 // | 1926 // |
| 1927 // BEGIN invoke [main]. | 1927 // BEGIN invoke [main]. |
| 1928 // | 1928 // |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2103 """; | 2103 """; |
| 2104 const String HOOKS_API_USAGE = """ | 2104 const String HOOKS_API_USAGE = """ |
| 2105 // The code supports the following hooks: | 2105 // The code supports the following hooks: |
| 2106 // dartPrint(message) - if this function is defined it is called | 2106 // dartPrint(message) - if this function is defined it is called |
| 2107 // instead of the Dart [print] method. | 2107 // instead of the Dart [print] method. |
| 2108 // dartMainRunner(main) - if this function is defined, the Dart [main] | 2108 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 2109 // method will not be invoked directly. | 2109 // method will not be invoked directly. |
| 2110 // Instead, a closure that will invoke [main] is | 2110 // Instead, a closure that will invoke [main] is |
| 2111 // passed to [dartMainRunner]. | 2111 // passed to [dartMainRunner]. |
| 2112 """; | 2112 """; |
| OLD | NEW |