mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
f6900001eb
Remove dead shared snapshot arguments to Dart_CreateIsolateGroup. 6a65ea9cad4b [vm] Remove shared snapshot and reused instructions features. db8370e36147 [gardening] Fix frontend-server dartdevc windows test. 4601bd7bffea Modified supertype check error message to be more descriptive. 0449905e2de6 [CFE] Add a serialization-and-unserialization step to strong test c8b903c2f94f Update CHANGELOG.md 2a12a13d9684 [Test] Skips emit_aot_size_info_flag_test on crossword. b26127fe01a5 [cfe] Add reachability test skeleton
64 lines
1.9 KiB
C++
64 lines
1.9 KiB
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "flutter/runtime/dart_vm_data.h"
|
|
|
|
namespace flutter {
|
|
|
|
std::shared_ptr<const DartVMData> DartVMData::Create(
|
|
Settings settings,
|
|
fml::RefPtr<DartSnapshot> vm_snapshot,
|
|
fml::RefPtr<DartSnapshot> isolate_snapshot) {
|
|
if (!vm_snapshot || !vm_snapshot->IsValid()) {
|
|
// Caller did not provide a valid VM snapshot. Attempt to infer one
|
|
// from the settings.
|
|
vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings);
|
|
if (!vm_snapshot) {
|
|
FML_LOG(ERROR)
|
|
<< "VM snapshot invalid and could not be inferred from settings.";
|
|
return {};
|
|
}
|
|
}
|
|
|
|
if (!isolate_snapshot || !isolate_snapshot->IsValid()) {
|
|
// Caller did not provide a valid isolate snapshot. Attempt to infer one
|
|
// from the settings.
|
|
isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings);
|
|
if (!isolate_snapshot) {
|
|
FML_LOG(ERROR) << "Isolate snapshot invalid and could not be inferred "
|
|
"from settings.";
|
|
return {};
|
|
}
|
|
}
|
|
|
|
return std::shared_ptr<const DartVMData>(new DartVMData(
|
|
std::move(settings), //
|
|
std::move(vm_snapshot), //
|
|
std::move(isolate_snapshot) //
|
|
));
|
|
}
|
|
|
|
DartVMData::DartVMData(Settings settings,
|
|
fml::RefPtr<const DartSnapshot> vm_snapshot,
|
|
fml::RefPtr<const DartSnapshot> isolate_snapshot)
|
|
: settings_(settings),
|
|
vm_snapshot_(vm_snapshot),
|
|
isolate_snapshot_(isolate_snapshot) {}
|
|
|
|
DartVMData::~DartVMData() = default;
|
|
|
|
const Settings& DartVMData::GetSettings() const {
|
|
return settings_;
|
|
}
|
|
|
|
const DartSnapshot& DartVMData::GetVMSnapshot() const {
|
|
return *vm_snapshot_;
|
|
}
|
|
|
|
fml::RefPtr<const DartSnapshot> DartVMData::GetIsolateSnapshot() const {
|
|
return isolate_snapshot_;
|
|
}
|
|
|
|
} // namespace flutter
|