a94b8ae45d
This relands the following CLs
[vm] Make VM support .dart_tool/package_config.json
https://dart-review.googlesource.com/c/sdk/+/145462
[vm] Make Isolate.resolveUri() work for both `.packages` and `dart_tool/package_config.json`
https://dart-review.googlesource.com/c/sdk/+/145803
[vm] Skip (newly enabled) isolate tests on simarm* and hot-reload configs
https://dart-review.googlesource.com/c/sdk/+/145861
[vm] Remove ../0 postfix from status file entries (test framework does not recognize those multitests)
https://dart-review.googlesource.com/c/sdk/+/145940
[vm] - Fix hang when no package config or .packages exist
https://dart-review.googlesource.com/c/sdk/+/145661
The only change (extra patchset) is to let VM prefer the old/legacy
".packages" format and only use the newer
".dart_tool/package_config.json" if we failed to find a ".packages".
Closes https://github.com/dart-lang/sdk/issues/41739
Closes https://github.com/dart-lang/sdk/issues/41649
Change-Id: I220f808540e6e521d985ae763968f64dbf57fe67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145942
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "bin/isolate_data.h"
|
|
#include "bin/snapshot_utils.h"
|
|
#include "platform/growable_array.h"
|
|
|
|
namespace dart {
|
|
namespace bin {
|
|
|
|
IsolateGroupData::IsolateGroupData(const char* url,
|
|
const char* packages_file,
|
|
AppSnapshot* app_snapshot,
|
|
bool isolate_run_app_snapshot)
|
|
: script_url((url != NULL) ? strdup(url) : NULL),
|
|
app_snapshot_(app_snapshot),
|
|
resolved_packages_config_(NULL),
|
|
kernel_buffer_(NULL),
|
|
kernel_buffer_size_(0),
|
|
isolate_run_app_snapshot_(isolate_run_app_snapshot) {
|
|
if (packages_file != NULL) {
|
|
packages_file_ = strdup(packages_file);
|
|
}
|
|
}
|
|
|
|
IsolateGroupData::~IsolateGroupData() {
|
|
free(script_url);
|
|
script_url = NULL;
|
|
free(packages_file_);
|
|
packages_file_ = NULL;
|
|
free(resolved_packages_config_);
|
|
resolved_packages_config_ = NULL;
|
|
kernel_buffer_ = NULL;
|
|
kernel_buffer_size_ = 0;
|
|
}
|
|
|
|
IsolateData::IsolateData(IsolateGroupData* isolate_group_data)
|
|
: isolate_group_data_(isolate_group_data),
|
|
loader_(nullptr),
|
|
packages_file_(nullptr) {
|
|
if (isolate_group_data->packages_file_ != nullptr) {
|
|
packages_file_ = strdup(isolate_group_data->packages_file_);
|
|
}
|
|
}
|
|
|
|
IsolateData::~IsolateData() {
|
|
free(packages_file_);
|
|
packages_file_ = nullptr;
|
|
}
|
|
|
|
} // namespace bin
|
|
} // namespace dart
|