mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove build flags for dynamic patching (flutter/engine#9394)
This commit is contained in:
parent
743e0e7cce
commit
0e29357616
@ -15,7 +15,7 @@ if (target_cpu == "arm" || target_cpu == "arm64") {
|
||||
}
|
||||
|
||||
declare_args() {
|
||||
# The runtime mode ("debug", "profile", "release", "dynamic_profile", or "dynamic_release")
|
||||
# The runtime mode ("debug", "profile", or "release")
|
||||
flutter_runtime_mode = "debug"
|
||||
}
|
||||
|
||||
@ -25,8 +25,6 @@ feature_defines_list = [
|
||||
"FLUTTER_RUNTIME_MODE_DEBUG=1",
|
||||
"FLUTTER_RUNTIME_MODE_PROFILE=2",
|
||||
"FLUTTER_RUNTIME_MODE_RELEASE=3",
|
||||
"FLUTTER_RUNTIME_MODE_DYNAMIC_PROFILE=4",
|
||||
"FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE=5",
|
||||
]
|
||||
|
||||
if (flutter_runtime_mode == "debug") {
|
||||
@ -35,10 +33,6 @@ if (flutter_runtime_mode == "debug") {
|
||||
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=2" ]
|
||||
} else if (flutter_runtime_mode == "release") {
|
||||
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=3" ]
|
||||
} else if (flutter_runtime_mode == "dynamic_profile") {
|
||||
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=4" ]
|
||||
} else if (flutter_runtime_mode == "dynamic_release") {
|
||||
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=5" ]
|
||||
} else {
|
||||
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ]
|
||||
}
|
||||
|
||||
@ -85,8 +85,7 @@ source_set("runtime") {
|
||||
|
||||
public_configs = [ "$flutter_root:config" ]
|
||||
|
||||
if (flutter_runtime_mode != "release" &&
|
||||
flutter_runtime_mode != "dynamic_release" && !is_fuchsia) {
|
||||
if (flutter_runtime_mode != "release" && !is_fuchsia) {
|
||||
# Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia
|
||||
# instead puts Observatory into the runner's package.
|
||||
deps += [
|
||||
|
||||
@ -37,8 +37,7 @@
|
||||
namespace dart {
|
||||
namespace observatory {
|
||||
|
||||
#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) && \
|
||||
(FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE)
|
||||
#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE)
|
||||
|
||||
// These two symbols are defined in |observatory_archive.cc| which is generated
|
||||
// by the |//third_party/dart/runtime/observatory:archive_observatory| rule.
|
||||
@ -48,8 +47,7 @@ extern unsigned int observatory_assets_archive_len;
|
||||
extern const uint8_t* observatory_assets_archive;
|
||||
|
||||
#endif // !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE !=
|
||||
// FLUTTER_RUNTIME_MODE_RELEASE) && (FLUTTER_RUNTIME_MODE !=
|
||||
// FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE)
|
||||
// FLUTTER_RUNTIME_MODE_RELEASE)
|
||||
|
||||
} // namespace observatory
|
||||
} // namespace dart
|
||||
@ -143,8 +141,7 @@ bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) {
|
||||
void ThreadExitCallback() {}
|
||||
|
||||
Dart_Handle GetVMServiceAssetsArchiveCallback() {
|
||||
#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) || \
|
||||
(FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE)
|
||||
#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE)
|
||||
return nullptr;
|
||||
#elif OS_FUCHSIA
|
||||
fml::UniqueFD fd = fml::OpenFile("pkg/data/observatory.tar", false,
|
||||
@ -303,11 +300,6 @@ DartVM::DartVM(std::shared_ptr<const DartVMData> vm_data,
|
||||
// precompiled code only in the debug product mode.
|
||||
bool enable_asserts = !settings_.disable_dart_asserts;
|
||||
|
||||
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_PROFILE || \
|
||||
FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
|
||||
enable_asserts = false;
|
||||
#endif
|
||||
|
||||
#if !OS_FUCHSIA
|
||||
if (IsRunningPrecompiledCode()) {
|
||||
enable_asserts = false;
|
||||
|
||||
@ -222,8 +222,7 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) {
|
||||
fml::CommandLine::Option("dart-flags", "--verify_after_gc")};
|
||||
fml::CommandLine command_line("", options, std::vector<std::string>());
|
||||
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \
|
||||
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
|
||||
// Upon encountering a non-whitelisted Dart flag the process terminates.
|
||||
const char* expected =
|
||||
"Encountered blacklisted Dart VM flag: --verify_after_gc";
|
||||
@ -241,8 +240,7 @@ TEST_F(ShellTest, WhitelistedDartVMFlag) {
|
||||
fml::CommandLine command_line("", options, std::vector<std::string>());
|
||||
flutter::Settings settings = flutter::SettingsFromCommandLine(command_line);
|
||||
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \
|
||||
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
|
||||
EXPECT_EQ(settings.dart_flags.size(), 2u);
|
||||
EXPECT_EQ(settings.dart_flags[0], "--max_profile_depth 1");
|
||||
EXPECT_EQ(settings.dart_flags[1], "--random_seed 42");
|
||||
|
||||
@ -37,8 +37,7 @@ struct SwitchDesc {
|
||||
#define DEF_SWITCHES_END };
|
||||
// clang-format on
|
||||
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \
|
||||
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
|
||||
|
||||
// List of common and safe VM flags to allow to be passed directly to the VM.
|
||||
// clang-format off
|
||||
@ -118,8 +117,7 @@ const fml::StringView FlagForSwitch(Switch swtch) {
|
||||
return fml::StringView();
|
||||
}
|
||||
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \
|
||||
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
|
||||
|
||||
static bool IsWhitelistedDartVMFlag(const std::string& flag) {
|
||||
for (uint32_t i = 0; i < fml::size(gDartFlagsWhitelist); ++i) {
|
||||
@ -294,8 +292,7 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
|
||||
settings.use_test_fonts =
|
||||
command_line.HasOption(FlagForSwitch(Switch::UseTestFonts));
|
||||
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \
|
||||
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
|
||||
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
|
||||
command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag);
|
||||
std::string all_dart_flags;
|
||||
if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user