mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:42:11 +00:00
Make --trace-loading great again.
R=fschneider@google.com Review-Url: https://codereview.chromium.org/2775463002 .
This commit is contained in:
parent
ff1a3f4f2d
commit
2aecd5e588
|
@ -1428,7 +1428,8 @@ static Dart_Isolate CreateServiceIsolate(const char* script_uri,
|
|||
ASSERT(Dart_IsServiceIsolate(isolate));
|
||||
// Load embedder specific bits and return. Will not start http server.
|
||||
if (!VmService::Setup("127.0.0.1", -1, false /* running_precompiled */,
|
||||
false /* server dev mode */)) {
|
||||
false /* server dev mode */,
|
||||
false /* trace_loading */)) {
|
||||
*error = strdup(VmService::GetErrorMessage());
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -917,7 +917,8 @@ static Dart_Isolate CreateIsolateAndSetupHelper(bool is_main_isolate,
|
|||
// If this is the service isolate, load embedder specific bits and return.
|
||||
bool skip_library_load = isolate_run_app_snapshot;
|
||||
if (!VmService::Setup(vm_service_server_ip, vm_service_server_port,
|
||||
skip_library_load, vm_service_dev_mode)) {
|
||||
skip_library_load, vm_service_dev_mode,
|
||||
trace_loading)) {
|
||||
*error = strdup(VmService::GetErrorMessage());
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,8 @@ class FileRequest {
|
|||
FileRequest(this.sp, this.tag, this.uri, this.resolvedUri, this.libraryUrl);
|
||||
}
|
||||
|
||||
bool _traceLoading = false;
|
||||
|
||||
// State associated with the isolate that is used for loading.
|
||||
class IsolateLoaderState extends IsolateEmbedderData {
|
||||
IsolateLoaderState(this.isolateId);
|
||||
|
@ -101,8 +103,6 @@ class IsolateLoaderState extends IsolateEmbedderData {
|
|||
// The root script's uri.
|
||||
Uri _rootScript;
|
||||
|
||||
bool _traceLoading = false;
|
||||
|
||||
// Packages are either resolved looking up in a map or resolved from within a
|
||||
// package root.
|
||||
bool get _packagesReady =>
|
||||
|
|
|
@ -170,7 +170,8 @@ bool VmService::LoadForGenPrecompiled() {
|
|||
bool VmService::Setup(const char* server_ip,
|
||||
intptr_t server_port,
|
||||
bool running_precompiled,
|
||||
bool dev_mode_server) {
|
||||
bool dev_mode_server,
|
||||
bool trace_loading) {
|
||||
Dart_Isolate isolate = Dart_CurrentIsolate();
|
||||
ASSERT(isolate != NULL);
|
||||
SetServerAddress("");
|
||||
|
@ -257,6 +258,12 @@ bool VmService::Setup(const char* server_ip,
|
|||
Dart_SetField(library, DartUtils::NewString("_isFuchsia"), is_fuchsia);
|
||||
SHUTDOWN_ON_ERROR(result);
|
||||
|
||||
if (trace_loading) {
|
||||
result = Dart_SetField(library, DartUtils::NewString("_traceLoading"),
|
||||
Dart_True());
|
||||
SHUTDOWN_ON_ERROR(result);
|
||||
}
|
||||
|
||||
// Get _getWatchSignalInternal from dart:io.
|
||||
Dart_Handle dart_io_str = Dart_NewStringFromCString(DartUtils::kIOLibURL);
|
||||
SHUTDOWN_ON_ERROR(dart_io_str);
|
||||
|
|
|
@ -19,7 +19,8 @@ class VmService {
|
|||
static bool Setup(const char* server_ip,
|
||||
intptr_t server_port,
|
||||
bool running_precompiled,
|
||||
bool dev_mode_server);
|
||||
bool dev_mode_server,
|
||||
bool trace_loading);
|
||||
|
||||
// Error message if startup failed.
|
||||
static const char* GetErrorMessage();
|
||||
|
|
Loading…
Reference in a new issue