Skip to content

Commit

Permalink
Roll Dart to a5c11d7. (flutter#5269)
Browse files Browse the repository at this point in the history
Update engine for removal of Dart_ReadKernelBinary and refactored build targets.
  • Loading branch information
rmacnak-google authored May 15, 2018
1 parent db34bb6 commit e32e390
Show file tree
Hide file tree
Showing 10 changed files with 238 additions and 333 deletions.
4 changes: 2 additions & 2 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS.
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': '46ab040e589adc5200370dec7952ce5150850822',
'dart_revision': 'a5c11d7d0329432ca37e35bb249b20f60aa0aa31',

'dart_args_tag': '1.4.1',
'dart_async_tag': '2.0.6',
Expand Down Expand Up @@ -126,7 +126,7 @@ deps = {
Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67',

'src/topaz':
Var('fuchsia_git') + '/topaz' + '@' + 'e331f910c1003d154a4de6e1b5356f8d785fd6ec',
Var('fuchsia_git') + '/topaz' + '@' + '5fa651cf9cc5f338379e34964ff5dd70052f6237',

'src/third_party/benchmark':
Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22',
Expand Down
11 changes: 8 additions & 3 deletions content_handler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ template("flutter_content_handler") {

deps = [
"//third_party/dart/runtime/bin:libdart_builtin",
"//third_party/dart/runtime/platform:libdart_platform",
"//garnet/public/lib/app/cpp",
"//garnet/public/lib/fonts/fidl",
"//garnet/public/lib/fsl",
Expand Down Expand Up @@ -108,10 +107,16 @@ template("flutter_content_handler") {

flutter_content_handler("aot") {
output_name = "flutter_aot_runner"
extra_deps = [ "//third_party/dart/runtime:libdart_precompiled_runtime" ]
extra_deps = [
"//third_party/dart/runtime:libdart_precompiled_runtime",
"//third_party/dart/runtime/platform:libdart_platform_precompiled_runtime",
]
}

flutter_content_handler("jit") {
output_name = "flutter_jit_runner"
extra_deps = [ "//third_party/dart/runtime:libdart_jit" ]
extra_deps = [
"//third_party/dart/runtime:libdart_jit",
"//third_party/dart/runtime/platform:libdart_platform_jit",
]
}
24 changes: 13 additions & 11 deletions runtime/dart_isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate(
// thread.
service_isolate->ResetWeakPtrFactory();

const bool isolate_snapshot_is_dart_2 =
Dart_IsDart2Snapshot(vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer());
const bool isolate_snapshot_is_dart_2 = Dart_IsDart2Snapshot(
vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer());
const bool is_preview_dart2 =
vm->GetPlatformKernel() != nullptr || isolate_snapshot_is_dart_2;
(vm->GetPlatformKernel().GetSize() > 0) || isolate_snapshot_is_dart_2;
const bool running_from_sources =
!DartVM::IsRunningPrecompiledCode() && !is_preview_dart2;

Expand Down Expand Up @@ -648,14 +648,16 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair(

// Create the Dart VM isolate and give it the embedder object as the baton.
Dart_Isolate isolate =
vm->GetPlatformKernel() != nullptr
? Dart_CreateIsolateFromKernel(advisory_script_uri, //
advisory_script_entrypoint, //
vm->GetPlatformKernel(), //
flags, //
embedder_isolate.get(), //
error //
)
(vm->GetPlatformKernel().GetSize() > 0)
? Dart_CreateIsolateFromKernel(
advisory_script_uri, //
advisory_script_entrypoint, //
vm->GetPlatformKernel().GetMapping(), //
vm->GetPlatformKernel().GetSize(), //
flags, //
embedder_isolate.get(), //
error //
)
: Dart_CreateIsolate(advisory_script_uri, //
advisory_script_entrypoint, //
embedder_isolate->GetIsolateSnapshot()
Expand Down
20 changes: 4 additions & 16 deletions runtime/dart_vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,6 @@ DartVM::DartVM(const Settings& settings,
FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid())
<< "Isolate snapshot must be valid.";

if (platform_kernel_mapping_->GetSize() > 0) {
// The platform kernel mapping lifetime is managed by this instance of the
// DartVM and hence will exceed that of the PlatformKernel. So provide an
// empty release callback.
Dart_ReleaseBufferCallback empty = [](auto arg) {};
platform_kernel_ = reinterpret_cast<PlatformKernel*>(Dart_ReadKernelBinary(
platform_kernel_mapping_->GetMapping(), // buffer
platform_kernel_mapping_->GetSize(), // buffer size
empty // buffer deleter
));
}

{
TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo");
dart::bin::BootstrapDartIo();
Expand Down Expand Up @@ -340,11 +328,11 @@ DartVM::DartVM(const Settings& settings,
Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer());

const bool is_preview_dart2 =
platform_kernel_ != nullptr || isolate_snapshot_is_dart_2;
(platform_kernel_mapping_->GetSize() > 0) || isolate_snapshot_is_dart_2;

FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? "is" : "is NOT")
<< " enabled. Platform kernel: "
<< static_cast<bool>(platform_kernel_)
<< static_cast<bool>(platform_kernel_mapping_->GetSize() > 0)
<< " Isolate Snapshot is Dart 2: "
<< isolate_snapshot_is_dart_2;

Expand Down Expand Up @@ -453,8 +441,8 @@ const Settings& DartVM::GetSettings() const {
return settings_;
}

DartVM::PlatformKernel* DartVM::GetPlatformKernel() const {
return platform_kernel_;
const fml::Mapping& DartVM::GetPlatformKernel() const {
return *platform_kernel_mapping_.get();
}

const DartSnapshot& DartVM::GetVMSnapshot() const {
Expand Down
5 changes: 1 addition & 4 deletions runtime/dart_vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ namespace blink {

class DartVM : public fxl::RefCountedThreadSafe<DartVM> {
public:
class PlatformKernel;

static fxl::RefPtr<DartVM> ForProcess(Settings settings);

static fxl::RefPtr<DartVM> ForProcess(
Expand All @@ -40,7 +38,7 @@ class DartVM : public fxl::RefCountedThreadSafe<DartVM> {

const Settings& GetSettings() const;

PlatformKernel* GetPlatformKernel() const;
const fml::Mapping& GetPlatformKernel() const;

const DartSnapshot& GetVMSnapshot() const;

Expand All @@ -55,7 +53,6 @@ class DartVM : public fxl::RefCountedThreadSafe<DartVM> {
const fxl::RefPtr<DartSnapshot> vm_snapshot_;
const fxl::RefPtr<DartSnapshot> isolate_snapshot_;
std::unique_ptr<fml::Mapping> platform_kernel_mapping_;
PlatformKernel* platform_kernel_ = nullptr;
ServiceProtocol service_protocol_;
fxl::WeakPtrFactory<DartVM> weak_factory_;

Expand Down
2 changes: 1 addition & 1 deletion runtime/dart_vm_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TEST(DartVM, SimpleInitialization) {
ASSERT_TRUE(vm);
ASSERT_EQ(vm, DartVM::ForProcess(settings));
ASSERT_FALSE(DartVM::IsRunningPrecompiledCode());
ASSERT_EQ(vm->GetPlatformKernel(), nullptr);
ASSERT_EQ(vm->GetPlatformKernel().GetSize(), 0u);
}

} // namespace blink
1 change: 0 additions & 1 deletion shell/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ source_set("common") {
"$flutter_root/third_party/txt",
"//garnet/public/lib/fxl",
"//third_party/dart/runtime:dart_api",
"//third_party/dart/runtime/platform:libdart_platform",
"//third_party/rapidjson",
"//third_party/skia",
"//third_party/skia:gpu",
Expand Down
2 changes: 0 additions & 2 deletions shell/testing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ executable("testing") {
"//garnet/public/lib/fxl",
"//third_party/dart/runtime:libdart_jit",
"//third_party/dart/runtime/bin:embedded_dart_io",
"//third_party/dart/runtime/bin:libdart_builtin",
"//third_party/dart/runtime/platform:libdart_platform",
"//third_party/skia",
"//topaz/lib/tonic",
]
Expand Down
2 changes: 1 addition & 1 deletion travis/licenses_golden/licenses_third_party
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 8ddb0126ef903204d99d1ccfd231a1e0
Signature: 1b192480901ca7233d44dac3da78293c

UNUSED LICENSES:

Expand Down
Loading

0 comments on commit e32e390

Please sign in to comment.