未验证 提交 7a5ec8d7 编写于 作者: J Jason Simmons 提交者: GitHub

Remove build flags for dynamic patching (#9394)

上级 3b529929
...@@ -15,7 +15,7 @@ if (target_cpu == "arm" || target_cpu == "arm64") { ...@@ -15,7 +15,7 @@ if (target_cpu == "arm" || target_cpu == "arm64") {
} }
declare_args() { declare_args() {
# The runtime mode ("debug", "profile", "release", "dynamic_profile", or "dynamic_release") # The runtime mode ("debug", "profile", or "release")
flutter_runtime_mode = "debug" flutter_runtime_mode = "debug"
} }
...@@ -25,8 +25,6 @@ feature_defines_list = [ ...@@ -25,8 +25,6 @@ feature_defines_list = [
"FLUTTER_RUNTIME_MODE_DEBUG=1", "FLUTTER_RUNTIME_MODE_DEBUG=1",
"FLUTTER_RUNTIME_MODE_PROFILE=2", "FLUTTER_RUNTIME_MODE_PROFILE=2",
"FLUTTER_RUNTIME_MODE_RELEASE=3", "FLUTTER_RUNTIME_MODE_RELEASE=3",
"FLUTTER_RUNTIME_MODE_DYNAMIC_PROFILE=4",
"FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE=5",
] ]
if (flutter_runtime_mode == "debug") { if (flutter_runtime_mode == "debug") {
...@@ -35,10 +33,6 @@ if (flutter_runtime_mode == "debug") { ...@@ -35,10 +33,6 @@ if (flutter_runtime_mode == "debug") {
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=2" ] feature_defines_list += [ "FLUTTER_RUNTIME_MODE=2" ]
} else if (flutter_runtime_mode == "release") { } else if (flutter_runtime_mode == "release") {
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=3" ] 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 { } else {
feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ] feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ]
} }
......
...@@ -85,8 +85,7 @@ source_set("runtime") { ...@@ -85,8 +85,7 @@ source_set("runtime") {
public_configs = [ "$flutter_root:config" ] public_configs = [ "$flutter_root:config" ]
if (flutter_runtime_mode != "release" && if (flutter_runtime_mode != "release" && !is_fuchsia) {
flutter_runtime_mode != "dynamic_release" && !is_fuchsia) {
# Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia
# instead puts Observatory into the runner's package. # instead puts Observatory into the runner's package.
deps += [ deps += [
......
...@@ -37,8 +37,7 @@ ...@@ -37,8 +37,7 @@
namespace dart { namespace dart {
namespace observatory { namespace observatory {
#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) && \ #if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE)
(FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE)
// These two symbols are defined in |observatory_archive.cc| which is generated // These two symbols are defined in |observatory_archive.cc| which is generated
// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. // by the |//third_party/dart/runtime/observatory:archive_observatory| rule.
...@@ -48,8 +47,7 @@ extern unsigned int observatory_assets_archive_len; ...@@ -48,8 +47,7 @@ extern unsigned int observatory_assets_archive_len;
extern const uint8_t* observatory_assets_archive; extern const uint8_t* observatory_assets_archive;
#endif // !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != #endif // !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE !=
// FLUTTER_RUNTIME_MODE_RELEASE) && (FLUTTER_RUNTIME_MODE != // FLUTTER_RUNTIME_MODE_RELEASE)
// FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE)
} // namespace observatory } // namespace observatory
} // namespace dart } // namespace dart
...@@ -143,8 +141,7 @@ bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { ...@@ -143,8 +141,7 @@ bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) {
void ThreadExitCallback() {} void ThreadExitCallback() {}
Dart_Handle GetVMServiceAssetsArchiveCallback() { Dart_Handle GetVMServiceAssetsArchiveCallback() {
#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) || \ #if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE)
(FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE)
return nullptr; return nullptr;
#elif OS_FUCHSIA #elif OS_FUCHSIA
fml::UniqueFD fd = fml::OpenFile("pkg/data/observatory.tar", false, fml::UniqueFD fd = fml::OpenFile("pkg/data/observatory.tar", false,
...@@ -303,11 +300,6 @@ DartVM::DartVM(std::shared_ptr<const DartVMData> vm_data, ...@@ -303,11 +300,6 @@ DartVM::DartVM(std::shared_ptr<const DartVMData> vm_data,
// precompiled code only in the debug product mode. // precompiled code only in the debug product mode.
bool enable_asserts = !settings_.disable_dart_asserts; 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 !OS_FUCHSIA
if (IsRunningPrecompiledCode()) { if (IsRunningPrecompiledCode()) {
enable_asserts = false; enable_asserts = false;
......
...@@ -222,8 +222,7 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) { ...@@ -222,8 +222,7 @@ TEST_F(ShellTest, BlacklistedDartVMFlag) {
fml::CommandLine::Option("dart-flags", "--verify_after_gc")}; fml::CommandLine::Option("dart-flags", "--verify_after_gc")};
fml::CommandLine command_line("", options, std::vector<std::string>()); fml::CommandLine command_line("", options, std::vector<std::string>());
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \ #if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
// Upon encountering a non-whitelisted Dart flag the process terminates. // Upon encountering a non-whitelisted Dart flag the process terminates.
const char* expected = const char* expected =
"Encountered blacklisted Dart VM flag: --verify_after_gc"; "Encountered blacklisted Dart VM flag: --verify_after_gc";
...@@ -241,8 +240,7 @@ TEST_F(ShellTest, WhitelistedDartVMFlag) { ...@@ -241,8 +240,7 @@ TEST_F(ShellTest, WhitelistedDartVMFlag) {
fml::CommandLine command_line("", options, std::vector<std::string>()); fml::CommandLine command_line("", options, std::vector<std::string>());
flutter::Settings settings = flutter::SettingsFromCommandLine(command_line); flutter::Settings settings = flutter::SettingsFromCommandLine(command_line);
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \ #if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
EXPECT_EQ(settings.dart_flags.size(), 2u); EXPECT_EQ(settings.dart_flags.size(), 2u);
EXPECT_EQ(settings.dart_flags[0], "--max_profile_depth 1"); EXPECT_EQ(settings.dart_flags[0], "--max_profile_depth 1");
EXPECT_EQ(settings.dart_flags[1], "--random_seed 42"); EXPECT_EQ(settings.dart_flags[1], "--random_seed 42");
......
...@@ -37,8 +37,7 @@ struct SwitchDesc { ...@@ -37,8 +37,7 @@ struct SwitchDesc {
#define DEF_SWITCHES_END }; #define DEF_SWITCHES_END };
// clang-format on // clang-format on
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \ #if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
// List of common and safe VM flags to allow to be passed directly to the VM. // List of common and safe VM flags to allow to be passed directly to the VM.
// clang-format off // clang-format off
...@@ -118,8 +117,7 @@ const fml::StringView FlagForSwitch(Switch swtch) { ...@@ -118,8 +117,7 @@ const fml::StringView FlagForSwitch(Switch swtch) {
return fml::StringView(); return fml::StringView();
} }
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \ #if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
static bool IsWhitelistedDartVMFlag(const std::string& flag) { static bool IsWhitelistedDartVMFlag(const std::string& flag) {
for (uint32_t i = 0; i < fml::size(gDartFlagsWhitelist); ++i) { for (uint32_t i = 0; i < fml::size(gDartFlagsWhitelist); ++i) {
...@@ -294,8 +292,7 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) { ...@@ -294,8 +292,7 @@ Settings SettingsFromCommandLine(const fml::CommandLine& command_line) {
settings.use_test_fonts = settings.use_test_fonts =
command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); command_line.HasOption(FlagForSwitch(Switch::UseTestFonts));
#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \ #if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE
FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE
command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag);
std::string all_dart_flags; std::string all_dart_flags;
if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册