Populate dart_library_sources_kernel in the embedder library in JIT mode (flutter/engine#36059)

This commit is contained in:
Jason Simmons 2022-09-09 17:20:02 -07:00 committed by GitHub
parent 1b44df099e
commit 6e87e08277
2 changed files with 9 additions and 6 deletions

View File

@ -1190,6 +1190,14 @@ void PopulateJITSnapshotMappingCallbacks(const FlutterProjectArgs* args,
reinterpret_cast<const char*>(args->isolate_snapshot_instructions),
true);
}
#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG)
settings.dart_library_sources_kernel = []() {
return std::make_unique<fml::NonOwnedMapping>(kPlatformStrongDill,
kPlatformStrongDillSize);
};
#endif // !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE ==
// FLUTTER_RUNTIME_MODE_DEBUG)
}
void PopulateAOTSnapshotMappingCallbacks(
@ -1239,12 +1247,6 @@ void PopulateAOTSnapshotMappingCallbacks(
args->isolate_snapshot_instructions,
SAFE_ACCESS(args, isolate_snapshot_instructions_size, 0));
}
#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG)
settings.dart_library_sources_kernel =
make_mapping_callback(kPlatformStrongDill, kPlatformStrongDillSize);
#endif // !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE ==
// FLUTTER_RUNTIME_MODE_DEBUG)
}
FlutterEngineResult FlutterEngineRun(size_t version,

View File

@ -1354,6 +1354,7 @@ TEST_F(EmbedderTest, CanSuccessfullyPopulateSpecificJITSnapshotCallbacks) {
ASSERT_NE(settings.vm_snapshot_instr(), nullptr);
ASSERT_NE(settings.isolate_snapshot_data(), nullptr);
ASSERT_NE(settings.isolate_snapshot_instr(), nullptr);
ASSERT_NE(settings.dart_library_sources_kernel(), nullptr);
}
//------------------------------------------------------------------------------