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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 11549017: Clean up the patch file for the isolate library by introducing a new builtin library: isolate_helpe… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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 /** 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 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1808 } 1808 }
1809 $mainEnsureGetter 1809 $mainEnsureGetter
1810 """); 1810 """);
1811 return "${namer.isolateAccess(isolateMain)}($mainAccess)"; 1811 return "${namer.isolateAccess(isolateMain)}($mainAccess)";
1812 } 1812 }
1813 1813
1814 emitMain(CodeBuffer buffer) { 1814 emitMain(CodeBuffer buffer) {
1815 if (compiler.isMockCompilation) return; 1815 if (compiler.isMockCompilation) return;
1816 Element main = compiler.mainApp.find(Compiler.MAIN); 1816 Element main = compiler.mainApp.find(Compiler.MAIN);
1817 String mainCall = null; 1817 String mainCall = null;
1818 if (compiler.isolateLibrary != null) { 1818 if (compiler.isolateHelperLibrary != null) {
1819 Element isolateMain = 1819 Element isolateMain =
1820 compiler.isolateLibrary.find(Compiler.START_ROOT_ISOLATE); 1820 compiler.isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE);
1821 mainCall = buildIsolateSetup(buffer, main, isolateMain); 1821 mainCall = buildIsolateSetup(buffer, main, isolateMain);
1822 } else { 1822 } else {
1823 mainCall = '${namer.isolateAccess(main)}()'; 1823 mainCall = '${namer.isolateAccess(main)}()';
1824 } 1824 }
1825 buffer.add(""" 1825 buffer.add("""
1826 1826
1827 // 1827 //
1828 // BEGIN invoke [main]. 1828 // BEGIN invoke [main].
1829 // 1829 //
1830 if (typeof document !== 'undefined' && document.readyState !== 'complete') { 1830 if (typeof document !== 'undefined' && document.readyState !== 'complete') {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 const String HOOKS_API_USAGE = """ 1974 const String HOOKS_API_USAGE = """
1975 // Generated by dart2js, the Dart to JavaScript compiler. 1975 // Generated by dart2js, the Dart to JavaScript compiler.
1976 // The code supports the following hooks: 1976 // The code supports the following hooks:
1977 // dartPrint(message) - if this function is defined it is called 1977 // dartPrint(message) - if this function is defined it is called
1978 // instead of the Dart [print] method. 1978 // instead of the Dart [print] method.
1979 // dartMainRunner(main) - if this function is defined, the Dart [main] 1979 // dartMainRunner(main) - if this function is defined, the Dart [main]
1980 // method will not be invoked directly. 1980 // method will not be invoked directly.
1981 // Instead, a closure that will invoke [main] is 1981 // Instead, a closure that will invoke [main] is
1982 // passed to [dartMainRunner]. 1982 // passed to [dartMainRunner].
1983 """; 1983 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698