63fd8f63e6
This reverts commit e143a52531.
Reason for revert: Broke all the reload-kernel bots.
Original change's description:
> Load isolate from parent's kernel in Isolate.spawn calls.
>
> Bug: https://github.com/dart-lang/sdk/issues/6610
> Change-Id: Icd6e1c5d6d4b64b611fc58333c051a8a9a50679d
> Reviewed-on: https://dart-review.googlesource.com/c/85724
> Commit-Queue: Liam Appelbe <liama@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
TBR=vegorov@google.com,rmacnak@google.com,asiva@google.com,liama@google.com
Change-Id: Ie9c305256da9b6478153b99502d0c63b0f43a3e6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/6610
Reviewed-on: https://dart-review.googlesource.com/c/86082
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
59 lines
1.6 KiB
C++
59 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 {
|
|
|
|
IsolateData::IsolateData(const char* url,
|
|
const char* package_root,
|
|
const char* packages_file,
|
|
AppSnapshot* app_snapshot)
|
|
: script_url((url != NULL) ? strdup(url) : NULL),
|
|
package_root(NULL),
|
|
packages_file(NULL),
|
|
loader_(NULL),
|
|
app_snapshot_(app_snapshot),
|
|
dependencies_(NULL),
|
|
resolved_packages_config_(NULL),
|
|
kernel_buffer_(NULL),
|
|
kernel_buffer_size_(0),
|
|
owns_kernel_buffer_(false) {
|
|
if (package_root != NULL) {
|
|
ASSERT(packages_file == NULL);
|
|
this->package_root = strdup(package_root);
|
|
} else if (packages_file != NULL) {
|
|
this->packages_file = strdup(packages_file);
|
|
}
|
|
}
|
|
|
|
void IsolateData::OnIsolateShutdown() {
|
|
}
|
|
|
|
IsolateData::~IsolateData() {
|
|
free(script_url);
|
|
script_url = NULL;
|
|
free(package_root);
|
|
package_root = NULL;
|
|
free(packages_file);
|
|
packages_file = NULL;
|
|
free(resolved_packages_config_);
|
|
resolved_packages_config_ = NULL;
|
|
if (owns_kernel_buffer_) {
|
|
ASSERT(kernel_buffer_ != NULL);
|
|
free(kernel_buffer_);
|
|
}
|
|
kernel_buffer_ = NULL;
|
|
kernel_buffer_size_ = 0;
|
|
delete app_snapshot_;
|
|
app_snapshot_ = NULL;
|
|
delete dependencies_;
|
|
}
|
|
|
|
} // namespace bin
|
|
} // namespace dart
|