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

Side by Side Diff: runtime/bin/builtin.dart

Issue 2933603002: 1. Dynamic compute the main closure that needs to be run by the main isolate (Closed)
Patch Set: Address review comments. Created 3 years, 6 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 | runtime/bin/main.cc » ('j') | tests/co19/co19-kernel.status » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library builtin; 5 library builtin;
6 6
7 // NOTE: Do not import 'dart:io' in builtin. 7 // NOTE: Do not import 'dart:io' in builtin.
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:_internal' hide Symbol; 10 import 'dart:_internal' hide Symbol;
11 import 'dart:isolate'; 11 import 'dart:isolate';
12 import 'dart:typed_data'; 12 import 'dart:typed_data';
13 13
14 // Embedder sets this to true if the --trace-loading flag was passed on the 14 // Embedder sets this to true if the --trace-loading flag was passed on the
15 // command line. 15 // command line.
16 bool _traceLoading = false; 16 bool _traceLoading = false;
17 17
18 // Before handling an embedder entrypoint we finalize the setup of the 18 // Before handling an embedder entrypoint we finalize the setup of the
19 // dart:_builtin library. 19 // dart:_builtin library.
20 bool _setupCompleted = false; 20 bool _setupCompleted = false;
21 21
22 // The root library (aka the script) is imported into this library. The
23 // standalone embedder uses this to lookup the main entrypoint in the
24 // root library's namespace.
25 Function _getMainClosure() => main;
26
27 // 'print' implementation. 22 // 'print' implementation.
28 // The standalone embedder registers the closurized _print function with the 23 // The standalone embedder registers the closurized _print function with the
29 // dart:core library. 24 // dart:core library.
30 void _printString(String s) native "Builtin_PrintString"; 25 void _printString(String s) native "Builtin_PrintString";
31 26
32 void _print(arg) { 27 void _print(arg) {
33 _printString(arg.toString()); 28 _printString(arg.toString());
34 } 29 }
35 30
36 _getPrintClosure() => _print; 31 _getPrintClosure() => _print;
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 if (_traceLoading) { 373 if (_traceLoading) {
379 _log("Exception when resolving package URI: $packageUri"); 374 _log("Exception when resolving package URI: $packageUri");
380 } 375 }
381 result = null; 376 result = null;
382 } 377 }
383 if (_traceLoading) { 378 if (_traceLoading) {
384 _log("Resolved '$packageUri' to '$result'"); 379 _log("Resolved '$packageUri' to '$result'");
385 } 380 }
386 return result; 381 return result;
387 } 382 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/main.cc » ('j') | tests/co19/co19-kernel.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698